Nmap Development mailing list archives

Re: XML structured script output (storing results per script instance)


From: Patrick Donnelly <batrick () batbytes com>
Date: Wed, 1 Aug 2012 15:17:57 -0400

On Tue, Jul 31, 2012 at 10:56 PM, David Fifield <david () bamsoftware com> wrote:
So what's the recommended way to do this? Previously set_output
immediately converted a Lua string to a std::string, with no need to
hold on to a lua_State. Now set_output can receive more generally a
table, which I suggested keeping in the Lua registry rather than
converting to a C++ representation of the same table.

Ideally, have nse_main.lua generate an XML representation (or
nse_main.cc) and save that in addition to normal output.

Otherwise, use luaL_Ref instead of coroutine pointer string keys. You
should use L_NSE static variable for ScriptResult manipulation instead
of whatever is calling cnse.set_output(). These calls need to be
wrapped in appropriate protected calls (lua_pcall) so errors don't
crash Nmap.
-- 
- Patrick Donnelly
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: