RE: mySQL database for nessusd (code!)

"Minderhout, Doug" <[email protected]>
Newsgroups gmane.comp.security.nessus.devel
Message-ID <40D7D4949218D5118B690050DA2898681C1154@NTSERVER1>

> -----Original Message-----
> From: William Heinbockel [mailto:[email protected]]
> Sent: Friday, February 07, 2003 8:53 AM
> To: Javier Fernandez-Sanguino
> Cc: [email protected]
> Subject: Re: mySQL database for nessusd (code!)
> 
> 
> On Fri, 7 Feb 2003, Javier Fernandez-Sanguino wrote:
> 
> > William Heinbockel wrote:
> > > Just an update on the database backend for nessusd...
> > > 
> > > I've started coding a mysql interface/library for nessusd.
> > > It is written in C and uses mysql.h (the mysql C API).
> > 
> > That's great!
> > 
> > > I'm working with the database schema that Javi posted awhile back,
> > > but due to my lack of SQL knowledge and the way nessusd is set-up,
> > > I don't think that some of the tables can be setup in that manner.
> > 
> > 	Which ones specifically?
> > 
> All of the ID's...
> Currently I'm using the timestamp for the SessionID, but have no
> idea what to do with the UserID, ExecutionID, ProtocolID...
> This is probably most due to my lack of knowledge with databases.
> And what is UserSessions::Location and User::Hash?

I think that the hash column in the user table is to store a hash of the
user's password (MD5 or SHA1). I don't know what to do with location.

> It might also end up being a problem to store these ID's and pass
> them in the program.

The ID colums are generated in the database and are used as indexes
into some of the tables and to link rows in the tables together. We 
really shouldn't have to worry about having the IDs used in the 
program.

> > > 
> > > I think the easiest way to incorporate the non-session 
> specific data
> > > (i.e. the Nessus-plugin table and Services table and the 
> like...) is
> > > to write a simple [perl?] script to create an sql modules directly
> > > from the plugins' directory and hard code a script to 
> deal with the
> > > services.
> > 
> > 	For the plugin information you already have a way to do 
> it. Check the 
> > nessus-extract tool:
> > 
> http://cvs.nessus.org/cgi-bin/cvsweb.cgi/nessus-tools/nessus-e
xtract/nessus-extract.pl?rev=1.4&content-type=text/x-cvsweb-markup
> 
> It does not (yet) output in the schema that I proposed a while back for 
> plugins (CVE/Bugtraq references should be held in a separate table to 
> accomodate better with having multiple references per plugin)
> 
>
>Right now, I am mainly trying to focus on where the information for the
>database can be best obtained, for some stuff with the plugins, such
>as RevisionNumber, you might have to integrate some code into NASL and
>such.  I don't know for certain though.
> 
> 
> 	As for the service information it should be pretty easy to make a 
> script to take all services (from /etc/services, the nmap services file 
> or whatever) and add them to a table. However, since services are not 
> referenced by port you need to first look into the service table (and 
> extract the ServiceId before inserting into the DetectedService table.
> 	Regards
> 
> 	Javi
> 
> PS: Starting next week I hope I will have more time available to work on 
> this.
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.