NexposeSimpleXML::Parser - Parse NeXpose scan data with Perl
This document describes the latest version of NexposeSimpleXML::Parser.
my $nxp = new NexposeSimpleXML::Parser; my $parser = $nxp->parse_file('test1.xml'); #a NexposeSimpleXML::Parser Object my @host = $parser->get_all_hosts(); #an Array of NexposeSimpleXML::Parser::Host Objects my $host1 = $hosts[0]; my @services = $host1->get_all_services(); #an Array of NexposeSimpleXML::Parser::Host::Service Objects my $service1 = $services[0]; my @vulnerabilities = $host1->get_all_vulnerabilities(); #an Array of NexposeSimpleXML::Parser::Vulnerabilities Objects for #the host OS. or my @vulnerabilities = $service1->get_all_vulnerabilities(); #an Array of NexposeSimpleXML::Parser::Vulnerabilities Objects for #this service. my $vulnerability1 = $vulnerabilities[0]; my @references = $$vulnerability1->get_all_references(); #an Array of NexposeSimpleXML::Parser::References Objects for this #specific vulnerability.
For a full listing of methods see the documentation corresponding to each object.
NexposeSimpleXML::Parser -- Core parser | +--NexposeSimpleXML::Parser::Session -- NeXpose scan session information | +--NexposeSimpleXML::Parser::Vulnerabilitiy -- Vulnerability information | +--NexposeSimpleXML::Parser::Reference -- Reference for vulnerability data | +--NexposeSimpleXML::Parser::Fingerprint -- Fingerprint information (os or service) | +--NexposeSimpleXML::Parser::Host -- General host information | | | |--NexposeSimpleXML::Parser::Service -- Port information | | |
The main idea behind the core modules is, you will first parse the scan data then extract the information. Therefore, you should run parse_file or parse_scan then the you can use any of the get_* methods.
Parse a NeXpose SimpleXML file.
Obtain the NexposeSimpleXML::Parser::Session object which contains the session scan information.
Obtain an Array of NexposeSimpleXML::Parser::Host objects which contain host information.
This object contains the scan session information of the NeXpose scan.
Returns the timestamp the report was generated.
This object contains the information for a host.
Returns a string which contains the ip of this host.
Returns an array of NexposeSimpleXML::Parser::Host::Service objects, which represent the services that this host has open.
Obtain a NexposeSimpleXML::Parser::Host::Service object which contains the service information.
Obtain an Array of NexposeSimpleXML::Parser::Host::Service objects which contain port information.
Obtain a NexposeSimpleXML::Parser::Fingerprint object which contain the fingerprint of the OS for this host.
This object contains the fingerprint details for the OS or service.
Returns a string which contains the certainty of this fingerprint.
Returns a string which contains the description this fingerprint. Example of an OS fingerprint: Ubuntu Linux 8.10
Returns a string which contains the vendor this fingerprint. Example of an OS fingerprint: Ubuntu
Returns a string which contains the family of this fingerprint. Example of an OS fingerprint: Linux
Returns a string which contains the product of this fingerprint. Example of an OS fingerprint: Linux
Returns a string which contains the version of this fingerprint. Example of an OS fingerprint: 8.10
Returns a string which contains the device_class of this fingerprint. This is undef for a service fingerprint.
Returns a string which contains the arch of this fingerprint. This is undef for a service fingerprint. Exampleo of an OS fingerprint: x86_64
This object contains the information for a port.
Returns a string which contains the service name.
Returns a string which contains the protocol.
Returns a string which contains the port number.
Returns an Array of NexposeSimpleXML::Parser::Vulnerability objects which contain information about the vulnerabilities for this service.
Obtain a NexposeSimpleXML::Parser::Fingerprint object which contain the fingerprint of the service.
This object contains the information for vulnerability.
Returns the id of this vulnerability.
Returns the response code. This can be VE or VV. VE means 'vulnerable exploited'. VV means 'vulnerable version'.
Returns an Array of NexposeSimpleXML::Parser::Reference objects which contain reference details for the vulnerability.
This object contains the reference details for a vulnerability.
Returns the id of this reference.
Returns the type of the reference. Example: cve
Here is an example of parsing an XML file using NexposeSimpleXML::Parser:
my $nxp = new NexposeSimpleXML::Parser; my $parser = $nxp->parse_file('test1.xml'); foreach my $h ( $parser->get_all_hosts() ){ print "ip: " . $h->address . "\n"; foreach my $s ( $h->get_all_services() ) { print "port: " . $s->port . "\n"; print "name: " . $s->name . "\n"; print "protocol: " . $s->protocol . "\n"; } print "---\n"; }
XML::LibXML and Object::InsideOut
Joshua D. Abraham, <jabra AT spl0it DOT org>
Copyright 2010 Joshua D. Abraham. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install NexposeSimpleXML::Parser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm NexposeSimpleXML::Parser
CPAN shell
perl -MCPAN -e shell install NexposeSimpleXML::Parser
For more information on module installation, please visit the detailed CPAN module installation guide.