mailing list archives
Re: [RFC][patch] XML structured script output
From: Daniel Miller <bonsaiviking () gmail com>
Date: Thu, 24 May 2012 22:51:41 -0500
Here's an update to the NSE-XML structured output patch that includes
better comments, a little cleanup, and some memory management changes
that preserve the original source in a few places that I had changed
initially. The patch is larger because it includes the changes I
submitted separately regarding PortList::nextPort. If that patch
gets accepted first, I'll rebase and submit the smaller diff of just
the NSE-XML feature.
On Mon, May 21, 2012 at 8:57 PM, Daniel Miller <bonsaiviking () gmail com> wrote:
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 , 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!
Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/