Nmap Development mailing list archives

Re: Converting Nmap output to SQL


From: Henri Salo <henri () nerv fi>
Date: Sun, 28 Mar 2010 09:45:49 +0300

On Thu, 25 Mar 2010 11:48:47 -0500
Ron <ron () skullsecurity net> wrote:

On Thu, 25 Mar 2010 11:43:00 -0500 Kris Katterjohn
<katterjohn () gmail com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/25/2010 11:19 AM, Ron wrote:
Hey,

A friend of mine wants to create a PHP dashboard for his business,
showing open ports, operating systems, etc. He was hoping to put
an Nmap scan into a database, then I'd write him a PHP front-end
to display it. 

Has anybody looked at a way to convert the XML output to SQL? I
don't have a whole lot of experience with XML, but it'd definitely
be a cool feature. 



Do you mean just separately 1) extracting the data from the XML and
2) storing it in a database?
Separately or together doesn't really matter -- as long as it ends up
in a database I'll be happy. 


Check out Metasploit's db functionality, such as db_nmap.  It stores
Nmap XML into a database (using ActiveRecord).  Also, a Metasploit
developer emailed me a couple of months ago in reference to using my
Ruby Nmap::Parser in a project related to his work (not Metasploit)
in which he wanted to scan and store in a sqlite3 database.  It can
be done just the same along with the Perl Nmap parsers I'm sure.

Parsers for Nmap extract the data from the XML so he just has to put
it in a db somehow, which shouldn't be too hard.  Coming up with a
decent schema is probably the worst of it all, depending on what all
data you want to keep.
Cool, sounds promising! I'm only just getting my feet wet with Ruby
right now, but I'll keep that in mind. 

Thanks!


Cheers,
Kris Katterjohn

I think Nmap itself should have feature to do is. Should we add it to
TODO-list?

---
Henri Salo
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: