Nmap Development mailing list archives
[NSE] Syntax error messages and help finding them.
From: jah <jah () zadkiel plus com>
Date: Thu, 07 Aug 2008 03:53:00 +0100
Hello,
If one makes a syntax error that prevents an NSE script from loading one
would see the following:
SCRIPT ENGINE: error while initializing script rules:
'C:\Program Files\Nmap\dev\foo.nse' could not be loaded!
stack traceback:
[C]: ?
[C]: ?
SCRIPT ENGINE: Aborting script scan.
This certainly applies to windows, I don't know if there's any more
detail shown when this happens on other OSes. I've attached a quick
script for those that would like to find out - it uses an assignment
operator where it should use comparison.
Using Nmap 4.53 the error message pointed to the actual mistake:
LUA INTERPRETER in ..\nse_init.cc:760: C:\Program
Files\Nmap\dev\foo.nse:11: 'end' expected (to close 'function' at line
10) near '='
SCRIPT ENGINE: Aborting script scan.
Both of these messages are helpful, but I've often spent ages hunting
through lines of script trying to find the source of the error and have
wished many times for that LUA INTERPRETER message to point me at a mistake.
If these two messages could be combined I think it would be really
beneficial and especially so for users who are new to NSE scripting.
Regards,
jah
id="foo" author="" runlevel="1" description = "" hostrule = function( host ) return true end action = function( host ) return 1=1 end
_______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
Current thread:
- [NSE] Syntax error messages and help finding them. jah (Aug 06)
- Re: [NSE] Syntax error messages and help finding them. Brandon Enright (Aug 06)
- Re: [NSE] Syntax error messages and help finding them. Kris Katterjohn (Aug 06)
- Re: [NSE] Syntax error messages and help finding them. Patrick Donnelly (Aug 07)
- Re: [NSE] Syntax error messages and help finding them. Brandon Enright (Aug 06)
