Nmap Development mailing list archives

NSE Enhanced Output Patch


From: devin bjelland <devinbjelland () gmail com>
Date: Wed, 21 May 2014 16:24:09 +0100

Hi list,

I finished writing a patch based on community suggestions that Patrick had
started a while back. print_debug and print_verbose have been superseded by
debug and verbose respectively. Scripts should no longer pass SCRIPT_NAME
to these functions as stdnse now determines the running script. Depending
on the debug/verbosity level, the target ip and/or thread ID is also
printed. To do this, several new functions have been added retrieve
information about the running script.

To avoid printing the script id multiple times, the old behaviour of
print_debug and print_verbose has been kept but deprecated.
David Fifield wrote on Sep 24, 2012; 5:40am:
Let us not simply alias print_debug and
print_verbose to the new functions, because of the double script id
problem you mentioned. Rather let's keep the behavior of those functions
the same and deprecate them, and then change scripts to use the new
names, pruning script ids when needed.

The thread ID is only printed for the higher debug levels since it is less
useful.
Fyodor wrote on Sep 26, 2012; 10:33pm:
But given that a thread ID like 0x38472a17 isn't a whole lot
shorter than "74.207.244.221:22", and given that the latter is a lot
more meaningful for end users, maybe we should stick to printing the
target IP (and port number if it is a portrule).

The target IP and port number are printed for the higher verbosity levels
and all debug levels.

To summarize, the new output looks like this:
Patrick Donnelly wrote on Sep 27, 2012; 2:42am:
For debugging == 1:
NSE: [http-title 127.0.0.1:80] ...

For debugging >= 2:
NSE: [http-title M:0xdeadbeef 127.0.0.1:80] ...
or for worker threads (stdnse.new_thread):
NSE: [http-title W:0xdeadbeef 127.0.0.1:80] ...

For verbosity == 1:
NSE: [http-title] ...

For verbosity >= 2:
NSE: [http-title 127.0.0.1:80] ...

So far I have migrated http-default-accounts to use the new functions so
everyone can see the beautiful new output in action.

Cheers,
Devin Bjelland

Attachment: nse-enhanced-output.patch
Description:

_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: