Nmap Script Updatedb

After adding a custom NSE script and updating nmap database, the following error was shown. My nmap was installed from Mac OS X Binary from nmap.org.

$ nmap --script-updatedb
Starting Nmap 6.25 ( http://nmap.org ) at 2013-03-29 00:40 SGT
NSE: Updating rule database.
NSE: Failed to load /usr/local/bin/../share/nmap/scripts//sql-injection.nse:
/usr/local/bin/../share/nmap/scripts//sql-injection.nse:44: variable 'shortport' is not declared
stack traceback:
	[C]: in function 'error'
	/usr/local/bin/../share/nmap/nselib/strict.lua:80: in function '__index'
	/usr/local/bin/../share/nmap/scripts//sql-injection.nse:44: in function </usr/local/bin/../share/nmap/scripts//sql-injection.nse:1>
NSE: failed to initialize the script engine:
/usr/local/bin/../share/nmap/nse_main.lua:523: could not load script
stack traceback:
	[C]: in function 'error'
	/usr/local/bin/../share/nmap/nse_main.lua:523: in function 'new'
	/usr/local/bin/../share/nmap/nse_main.lua:1223: in main chunk
	[C]: in ?
QUITTING!

I tried to examine the sql-injection.nse and shortport.lua. In sql-injection.nse, the variable shortport is properly import with require(‘shortport’) and I could not find any issues in shortport.lua.

require('url')
require('shortport')
.
.
portrule = shortport.port_or_service({80, 443}, {"http","https"})
.
.

Normally Lua assumes the name from require statement as the variable. The only way I could try is explicitly declaring the variable for each require statements and giving the same name as the required module. Then I could update properly my nmap scripts database.

local url = require('url')
local shortport = require('shortport')
local stdnse = require('stdnse')
local strbuf = require('strbuf')
local comm = require('comm')
local http = require('http')
local nsedebug = require('nsedebug')
local httpspider = require('httpspider')
.
.

Blackberry 10 QML Design Mode

I had to try Blackberry 10 native cascade development. I could install QNX Momentics IDE and Blackberry 10 simulator with VMWare Fusion on Mac OSX Mountain Lion. Normally I don’t want to use commercial software, I tired to setup the simulator with VirtualBox. Unfortunately I couldn’t success, VirtualBox got stuck at the starting screen.

IDE and Simulator is working fine on my Mac. But I found that the QML editor is only working on source mode. After finding out several minutes in preferences, I found the option Disable QML Preview is checked under Preferences->Blackberry->QML Editor. After tried to enable the QML Preview, the following message was shown.

QML Preview compatibility check failed. QML Preview is disabled.

Eclipse usually have the log file under workspace/.metadata/.log. The log file shows some errors relating to the JVM.

!ENTRY com.rim.tad.tools.qml.simulator 1 0 2013-02-03 23:18:25.827
!MESSAGE /usr/bin/java -d32 -cp /Applications/bbndk/ide/macosx/x86/eclipse/plugins/com.rim.tad.tools.qml.simulator_10.0.9.201212070504/ com.rim.tad.tools.qml.sim.check.RenderingCheck -target /Applications/bbndk/target_10_0_9_1673/qnx6

!ENTRY com.rim.tad.tools.qml.simulator 4 0 2013-02-03 23:18:26.015
!MESSAGE QML Preview compatibility check log.
Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.

Process exited with code: 1

QML simulator was trying to use 64 bits JVM with -d32. Java 7 was installed and used on my computer. Java 7 does not support with -d32 for 32 bits compatible mode. I tried to use Java 6 as default JVM. The QML preview compatibility checking succeeded and the design mode was start working.

Jetpack and Open Graph Tags

Facebook Debugger shows that the Open Graph Tags of my website are duplicated. Jetpack and the Facebook plugin are used in my site. These are making duplicated Tags. The Facebook plugin allows me easily modifying Open Graph Tags. I chose to remove adding Tags from Jetpack. Jetpack does not provide to disable it from admin panel. It needs to change a few lines of code. There will be two options, modifying Jetpack Plugin or modifying WordPress Theme.

Modifying Jetpack Plugin

  1. Open functions.opengraph.php under Jetpack plugin directory
  2. Find add_action( 'wp_head', 'jetpack_og_tags' );
  3. Remove or comment it

Modifying WordPress Theme

  1. Open functions.php under WordPress Theme directory
  2. Add a new line remove_action('wp_head', 'jetpack_og_tags');