From a37d45e49db89e5ec30d50df41b1c11dd4f79ce6 Mon Sep 17 00:00:00 2001 From: Cras Date: Wed, 20 Feb 2019 23:11:53 +0000 Subject: [PATCH] werkin --- README.md | 21 ++++++++++++++++++++- parser.py | 4 ++-- scanned.db | Bin 8192 -> 0 bytes 3 files changed, 22 insertions(+), 3 deletions(-) delete mode 100644 scanned.db diff --git a/README.md b/README.md index 5e7f53f..69abca4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,21 @@ # gutterbox -nmap -O -oX scan.xml 192.168.1.0/24 +## setup +Install the dependancies + +specify the correct version for sqlite3 +``` +sudo apt update +sudo apt install php libapache2-mod-php php-mysql +sudo apt install php7.0-sqlite3 +``` + +## Use it! +Run the scan +``` +nmap -O -oX /var/www/html/gutterbox/scans/scan.xml 192.168.1.0/24 +``` + +Feed the parser +``` +./parser.py -x scans/scan.xml +``` diff --git a/parser.py b/parser.py index 04f3b4b..b4cd099 100644 --- a/parser.py +++ b/parser.py @@ -73,7 +73,7 @@ def main(): id integer PRIMARY KEY, os text, hostname text, - address integer, + address text, ports text ); """ create_table(conn, targetTableCreate) @@ -98,7 +98,7 @@ def main(): for addr in host.iter('address'): if(addr.attrib['addrtype'] == 'ipv4'): - address = str(addr.attrib['addr']).split('.')[-1] + address = str(addr.attrib['addr']) for port in host.iter('port'): ports.append(str(port.attrib['portid'])) diff --git a/scanned.db b/scanned.db deleted file mode 100644 index 71920d730a212b18260f8e48a699135a7669b8e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeH~&2G~`5XW~zn$UplB2_905zVlQg0 zMTp1X$^&rb!jThC!E>;)c2uYWMqIeeD)H=k{yQJP$tBy5M~R5pi!46~1>*Gvf3+N>Wsk$nQa>-=wo=X1zYILforDJUw;Ya=0uLYCdkBZ9`wjN0oF78i0(x z|8v%|JqMbDb{$Xl=LYiVaZg6FJ*k#Y$>4;<%+lbpq%`GHo@5#AU(0y-U&^@JQbP~a z(C^rm$!yug$&}ro*Sj>QG&hyT27fu9@|UpERNi&vT?VfWgR@|SmW(IKn=AluLEv`J pDDjFCFHX~`aF(^$P|nNB*?~xq{UU|I&R^R+jMKsP+BCi6@E;mt*@*xE