On Mon, Aug 04, 2003 at 11:05:36PM -0400, George Theall wrote:

> In theory, this should work but I just
> can't get nessus to handle the conversion -- it complains each time with
> "xml_output: No SERVER_INFO found", even if I use NBE or NSR files
> produced by nessus directly.

I was wrong - the conversion happens just fine; the message above is
only a warning. 

Attached is a simple perl script (nsr) to filter the session data to an
NSR file.  Once you have that, you can use the nessus client to convert
to XML.  For example:

  perl nsr /usr/local/var/nessus/users/<user>/sessions/20030804-111856-data > 
session.nsr
  nessus -i session.nsr -o session.xml

Hope this helps,

George
-- 
[EMAIL PROTECTED]
# Convert from Nessus session data file to NSR output.
#
# updated: 04-Aug-2003, George A. Theall

while (<>) {
    chomp;

    next unless (/^SERVER <\|> (.+) <\|> SERVER$/);
    my @f = split(/ <\|> /, $1);

    my $msg;
    if ($f[0] eq 'PORT') {
        print join("|",
            $f[1],                 # host
            $f[2],                 # port
        ), "\n";
    }
    elsif (grep($f[0] eq $_, ('NOTE', 'INFO', 'REPORT'))) {
        print join("|",
            $f[1],                 # host
            $f[2],                 # port
            $f[4],                 # plugin id
            $f[0],                 # NOTE|INFO|REPORT
            $f[3]                  # text of report
        ), "\n";
    }
}

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to