Joshua Abraham Ben Smith PBNJ using MySQL Backend Fri Mar 23 22:46:31 EDT 2007 The following are the steps used to setup an example of MySQL 5.03 listening on the network. This documentation was written and tested on Debian Etch Testing Let me know how it goes. Regards, Josh & Ben ********************************************* Reference: http://dev.mysql.com/doc/refman/5.0/en/adding-users.html ********************************************* Step #0: Install MySQL either version 4 or 5 Install mysql 4.1 # apt-get install mysql-server-4.1 Instal mysql 5.0 # apt-get install mysql-server-5.0 ********************************************* Step #1: Connect to MySql # mysql ********************************************* Step #2: read the help mysql>\h ... snipped ... Note when using MySQL all lines start with mysql> ********************************************* Step # 3: Create a MySQL PBNJ database Type the following command mysql>CREATE DATABASE pbnj; Output: Query OK, 1 row affected (0.00 sec) ********************************************* Step #4: Add a user called bob Type the following command to create a user called bob with a password called testPassword: mysql> GRANT SELECT,INSERT,UPDATE,CREATE ON pbnj.* -> TO 'bob'@'SERVER IP' IDENTIFIED BY 'testPassword'; Please, note that: SERVER IP should be replaced with the actual ip address of the server. ex: mysql> GRANT SELECT,INSERT,UPDATE,CREATE ON pbnj.* -> TO 'bob'@'192.168.1.50' IDENTIFIED BY 'testPassword'; ********************************************* Step #5: Setting up the configuration file # cd # mkdir -p .pbnj-2.0 # cp /usr/share/doc/pbnj/examples/mysql.yaml config.yaml # nano config.yaml Set the following configuration db: mysql # for SQLite the name of the file. For mysql the name of the database database: pbnj # Username for the database. For SQLite no username is needed. user: "bob" # Password for the database. For SQLite no password is needed. passwd: "testPassword" # HostName for the database. For SQLite no host is needed. host: "127.0.0.1" #Port for the database. For SQLite no port is needed. port: "3306" ********************************************* Step #6: Scan and Query for Results cd ~/ scanpbnj 192.168.1.0/24 ... snipped ... outputpbnj -q latestinfo ... snipped ... ********************************************* Step #7: Verify your data is in the database: # mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 Server version: 5.0.36-Debian_1-log Debian etch distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | pbnj | +--------------------+ mysql> use pbnj; mysql> select * from machines; +-----+---------------+------+--------+--------------+-----------------+--------------------------+ | mid | ip | host | localh | os | machine_created | created_on | +-----+---------------+------+--------+--------------+-----------------+--------------------------+ | 0 | 192.168.1.105 | 0 | 0 | Windows 2003 | 1174691397 | Fri Mar 23 19:09:57 2007 | +-----+---------------+------+--------+--------------+-----------------+--------------------------+ 1 row in set (0.00 sec) mysql> select * from services; +------+--------------+-------+------+----------+-----------------+-------------------------------------+-----------------+--------------------------+ | mid | service | state | port | protocol | version | banner | machine_updated | updated_on | +------+--------------+-------+------+----------+-----------------+-------------------------------------+-----------------+--------------------------+ | 0 | ftp | up | 21 | tcp | unknown version | Cerberus FTP Server | 1174691397 | Fri Mar 23 19:09:57 2007 | | 0 | domain | up | 53 | tcp | unknown version | Microsoft DNS | 1174691397 | Fri Mar 23 19:09:57 2007 | | 0 | kerberos-sec | up | 88 | tcp | unknown version | Microsoft Windows kerberos-sec | 1174691397 | Fri Mar 23 19:09:57 2007 | | 0 | msrpc | up | 135 | tcp | unknown version | Microsoft Windows RPC | 1174691397 | Fri Mar 23 19:09:57 2007 | | 0 | netbios-ssn | up | 139 | tcp | unknown version | unknown product | 1174691397 | Fri Mar 23 19:09:57 2007 | | 0 | ldap | up | 389 | tcp | unknown version | Microsoft LDAP server | 1174691397 | Fri Mar 23 19:09:57 2007 | | 0 | microsoft-ds | up | 445 | tcp | unknown version | Microsoft Windows 2003 microsoft-ds | 1174691397 | Fri Mar 23 19:09:57 2007 | | 0 | kpasswd5 | up | 464 | tcp | unknown version | unknown product | 1174691397 | Fri Mar 23 19:09:57 2007 | | 0 | ncacn_http | up | 593 | tcp | 1.0 | Microsoft Windows RPC over HTTP | 1174691397 | Fri Mar 23 19:09:57 2007 | | 0 | tcpwrapped | up | 636 | tcp | unknown version | unknown product | 1174691397 | Fri Mar 23 19:09:57 2007 | +------+--------------+-------+------+----------+-----------------+-------------------------------------+-----------------+--------------------------+ 10 rows in set (0.01 sec) That's it your all set