This module implements a interface to the information contained in an nmap scan. It is implemented by parsing the xml scan data that is generated by nmap. This will enable anyone who utilizes nmap to quickly create fast and robust security scripts that utilize the powerful port scanning abilities of nmap.
October 23, 2007 at 12:17 pm
Question about nmap:parser. I’m trying to get the ip address of the down hosts from an xml file – is this possible? Here’s a quick segment of my code, but I get nothing:
$np->parsefile(“$ARGV[0])”);
@down = $np->all_hosts(‘down’);
foreach $h (@down) {
$addr = $h->addr();
print “addr is $addr\n”;
}
I’ve also tried to get_ips(‘down’) and it returns nothing. What am I doing wrong here?
December 20, 2007 at 3:34 pm
do you plan on incorporating the ability to pull in the data retrieved by various NSE scripts? for example, when doing a service check for MySQL or MS SQL and then running a NSE script to pull in extra info about the server and service.
i’ve done some testing, but don’t see that this data is being collected or even seen by the parser.
thanks,
chris
December 20, 2007 at 6:07 pm
The Nmap Scripting Engine is something I am currently looking at implementing, however it hasn’t been a widely asked feature. I’ll look into it further.
Thanks.
December 31, 2008 at 8:54 am
Hello apersaud@gmail.com
Good morning, I am not sure, whether you are the right contact for this module? I am fan of Perl and using it for automating my daily tasks.
Could you please help, what is the issue, I am facing? I am getting error as below while executing this simple code.
Eorror
read error at /usr/lib/perl5/vendor_perl/5.10.0/i586-linux-thread-multi/XML/Parser/Expat.pm line 469.
at /usr/lib/perl5/site_perl/5.10.0/Nmap/Parser.pm line 78
Code
#!/usr/bin/perl
# Batch mode of Nmap::Parser
use Nmap::Parser;
my $nmapexec=”/opt/bin/nmap”;
my $nmapargs=”-p 22″;
my $ost=”200.140.11.2″;
$np = new Nmap::Parser;
$np->parsescan($nmapexec, $nmapargs, $ost);
for my $hosts ($np->all_hosts()){
print $host->hostname();
}