Subject: | Not a bug - only partial functionality with Nmap version 5 - cannot parse info from the "Host script results:" section |
Date: | Fri, 18 Sep 2009 15:16:57 -0400 |
To: | <bug-Nmap-Parser [...] rt.cpan.org> |
From: | "Alex Eden" <Alex.Eden [...] senet-int.com> |
Hello,
I'm using your module with a bundled utility nmap2db.pl.
I'm using this nmap:
nmap -V
Nmap version 5.00 ( http://nmap.org )
I ran a test scan of one of my laptops:
nmap -sT -T4 -p1-65535 -sV -A -oA mylaptop4test 10.51.191.54
Starting Nmap 5.00 ( http://nmap.org ) at 2009-09-18 09:45 EDT
Interesting ports on pizza.####.#### (10.51.191.54):
Not shown: 65522 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp Microsoft ftpd
|_ ftp-anon: Anonymous FTP login allowed
25/tcp open smtp Microsoft ESMTP 6.0.3790.3959
| smtp-commands: EHLO pizza Hello [10.51.191.53], SIZE 2097152, PIPELINING,
DSN, ENHANCEDSTATUSCODES, 8bitmime, BINARYMIME, CHUNKING, VRFY
|_ HELP This server supports the following commands: HELO EHLO STARTTLS RCPT
DATA RSET MAIL QUIT HELP AUTH BDAT VRFY
80/tcp open http Microsoft IIS webserver 6.0
|_ html-title: Site doesn't have a title (text/html).
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn
445/tcp open netbios-ssn
1025/tcp open msrpc Microsoft Windows RPC
1026/tcp open msrpc Microsoft Windows RPC
1027/tcp open msrpc Microsoft Windows RPC
1031/tcp open msrpc Microsoft Windows RPC
1433/tcp open ms-sql-s Microsoft SQL Server 2005 9.00.1399; RTM
2383/tcp open ms-olap4?
3389/tcp open microsoft-rdp Microsoft Terminal Service
Service Info: OS: Windows
Host script results:
|_ nbstat: NetBIOS name: PIZZA, NetBIOS user: <unknown>, NetBIOS MAC:
00:18:8b:##:##:##
| smb-os-discovery: Windows XP 3790 Service Pack 2
| LAN Manager: Windows XP 5.2
| Name: WORKGROUP\PIZZA
|_ System time: 2009-09-18 13:42:24 UTC-4
Service detection performed. Please report any incorrect results at
http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 63.09 seconds
I replaced domain name and half of the mac address with # sign.
Then I ran nmap2db.pl:
perl nmap2db.pl --dbtype mysql --db scans --dbuser root --dbpass '#####'
--table nmap --xml mylaptop4test.xml
nmap2db.pl - ( http://nmapparser.wordpress.com )
--------------------------------------------------
Using DATABASE : scans
Database type : mysql
Using host : localhost
Using user : root
Using TABLE : nmap
Generating table: nmap ...
DBD::mysql::db do failed: Table 'nmap' already exists at nmap2db.pl line 122.
Processing file mylaptop4test.xml...
..> 10.51.191.54 : ( up) : ok
Then I ran a cpl queries in MqSQL:
Show quoted text
mysql> select mac from nmap where ip='10.51.191.54';
+------+
| mac |
+------+
| NULL |
+------+
1 row in set (0.02 sec)
Show quoted textmysql> select * from nmap where ip='10.51.191.54';
+--------------+------+--------+-----------------+---------------------------
------------------------------+----------------+--------+----------+-------+-
--------------------+
| ip | mac | status | hostname | open_ports
| filtered_ports | osname | osfamily | osgen | last_scanned |
+--------------+------+--------+-----------------+---------------------------
------------------------------+----------------+--------+----------+-------+-
--------------------+
| 10.51.191.54 | NULL | up | pizza.####.#### |
21,25,80,135,139,445,1025,1026,1027,1031,1433,2383,3389 | NULL |
NULL | NULL | NULL | 2009-09-18 10:26:07 |
+--------------+------+--------+-----------------+---------------------------
------------------------------+----------------+--------+----------+-------+-
--------------------+
1 row in set (0.00 sec)
In my tests it looks like it cannot extract many other pieces of information
from a typical nmap xml output file produced with Nmap version 5.
I hope you will find time soon to update your module to work with Nmap v. 5.
Thank you.