Nmap Development mailing list archives

[RFC][patch] XML structured script output


From: Daniel Miller <bonsaiviking () gmail com>
Date: Mon, 21 May 2012 20:57:38 -0500

Congratulations everyone on version 6!

For a year or so, I've been looking for feedback on my patch for XML
structured output for NSE scripts [1], and as it has been a while, I
thought I'd bring it up again. I've fixed a couple bugs since last
time, and I've started keeping my local copy of the Nmap source under
Git source control, so I can rebase my branch as development continues
on the official source. I'm attaching 2 patches: nse-structured.diff
has all the code changes to use XML output for scripts, and
scripts-structured.diff patches a few scripts to take better advantage
of the structured output.

As far as impact to script writers, there shouldn't be much, since a
table passed to stdnse.format_output() will work as it always has, as
will simply returning a string from a script. In this regard, the
functionality is largely opt-in. If the patch is accepted, I'll spend
time updating existing scripts to structure their output.

There is room for improvement: Currently, "horizontal lists" don't
work; that is, comma-separated values on one line of normal output
should be output as a list of <elem> elements in XML. The base
functionality is there, with ScriptOutputNode.set_display(FLOW), but
the logic to tie it in as a Lua function is missing. I don't figure
this is a big deal, and can be added in later.

Looking forward to hearing feedback!

Dan

Attachment: nse-structured.diff
Description:

Attachment: scripts-structured.diff
Description:

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

Current thread: