Skip to content
🗃️🖥️Essentially an nmap wrapper built around Streamline inventorying hosts on your network (and ports associated with them historically) by injecting nmap results into a SQLite database.
Branch: master
Clone or download
Pull request Compare This branch is 9 commits ahead, 12 commits behind argp:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


                     | |                  
 _ ____   _____ _ __ | |_ ___  _ __ _   _ 
| '_ \ \ / / _ \ '_ \| __/ _ \| '__| | | |
| | | \ V /  __/ | | | || (_) | |  | |_| |
|_| |_|\_/ \___|_| |_|\__\___/|_|   \__, |
                                     __/ |

A light-weight NMAP wrapper based on

alt text


  1. Linux, MacOSX
  2. python2
  3. libsqlite3-dev
  4. pysqlite (


  1. cd to $ nventory-master/installer
  2. $ sudo python2
  3. You're done!


$ nventory

What's next?

Everything else from this point is straight-forward.

You can use list files (-iL) for inventorying multiple hosts.

You can explicitly type specific single hosts for inventory as well.

All working elements of this software are located at /opt/nventory.

Actual database location: /opt/nventory/database/database.db.

Feel free to fork it / break it / bop it.


  • Create a man page
  • Create DEB and RPM packages
  • Release v1.0


nmapdb parses nmap's XML output files and inserts them into an SQLite database.

I coded this a while back (mid 2009) and have been using it since. Some people I have shared nmapdb with have found it useful, so I am releasing it publicly.

Example usage:

$ sudo nmap -A -oX scanme.xml

Starting Nmap ...

$ ls scanme.xml
$ ./ -h
usage: ./ [options] <nmap output XML file(s)>
     (-h) --help         this message
     (-v) --verbose      verbose output
     (-c) --create       specify input SQL file to create SQLite DB
     (-d) --database     specify output SQLite DB file
     (-f) --frequency    list most frequent open ports from specified DB
     (-n) --nodb         do not perform any DB operations (i.e. dry run)
     (-V) --version      output version number and exit

Use -c to create a database from the schema on the first run:

$ ./ -c nmapdb.sql -d myscan.db scanme.xml
$ file myscan.db
myscan.db: SQLite 3.x database
$ sqlite3 myscan.db
SQLite version 3.7.7 ...
sqlite> select * from hosts;|||ipv4|Linux 2.6.18|Linux|85|2.6.X|1316681984|up|
sqlite> select * from ports;|22|tcp|ssh|open||80|tcp|http|open|

Subsequent scans can be entered into the same database:

$ ./ -d myscan.db bar.xml foo.xml host1.xml host2.xml \
    host3.xml host4.xml meh.xml (or simply *.xml)
$ sqlite3 myscan.db
SQLite version 3.7.7 ...
sqlite> select * from ports where ports.port='22';|22|tcp|ssh|open||22|tcp|ssh|open|
sqlite> select * from ports where ports.port='23';|23|tcp|telnet|open|
sqlite> select * from hosts inner join ports on hosts.ip=ports.ip where hosts.ip='' and ports.state='open';|00:00:C5:CF:86:30|modem|ipv4||||||up|Farallon Computing/netopia||23|tcp|telnet|open||00:00:C5:CF:86:30|modem|ipv4||||||up|Farallon Computing/netopia||80|tcp|http|open|
sqlite> select * from hosts inner join ports on hosts.ip=ports.ip where hosts.os_name like '%bsd%' and ports.port=22;|||ipv4|FreeBSD 7.0-STABLE|FreeBSD|95|7.X|1231841556|up|||22|tcp|ssh|open|

Feel free to fork, submit patches, whatever.

Thanks to antonat and thomas for providing feedback.

argp, Mon Apr 30 14:49:21 EEST 2012

You can’t perform that action at this time.