commit c957a948f4deea19740a97b37ba375dad33743f6 Author: cras Date: Mon Feb 18 01:29:38 2019 -0600 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..60a30a5 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# gutterbox diff --git a/greppy.sh b/greppy.sh new file mode 100644 index 0000000..e578bfa --- /dev/null +++ b/greppy.sh @@ -0,0 +1,6 @@ +NMAP_FILE="scant" + +egrep -v "^#|Status: Up" $NMAP_FILE | cut -d' ' -f2 -f4- | \ +sed -n -e 's/Ignored.*//p' | \ +awk -F, '{split($0,a," "); printf "Host: %-20s Ports Open: %d\n" , a[1], NF}' \ +| sort -k 5 -g diff --git a/index.php b/index.php new file mode 100644 index 0000000..4649eac --- /dev/null +++ b/index.php @@ -0,0 +1,33 @@ + + + GutterBox + + + + + + + + +query("SELECT os,hostname,address,ports FROM targets"); + foreach($targets as $tar) + { + echo ""; + if($tar['os'] == "windows"){ + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + } +?> + +
".$tar['hostname']."".$tar['address']."".$tar['ports']."
+ + \ No newline at end of file diff --git a/media/linux.png b/media/linux.png new file mode 100644 index 0000000..9c54e32 Binary files /dev/null and b/media/linux.png differ diff --git a/media/windows.png b/media/windows.png new file mode 100644 index 0000000..4169d9d Binary files /dev/null and b/media/windows.png differ diff --git a/parser.py b/parser.py new file mode 100644 index 0000000..4cc966c --- /dev/null +++ b/parser.py @@ -0,0 +1,59 @@ +from sqlite3 import Error +import sqlite3 +import sys +import re + +def create_connection(database): + """ Connects to the database file """ + try: + conn = sqlite3.connect(database) + return conn + except Error as e: + print(e) + + return None + +def create_table(conn, create_table_sql): + """ Create a table in the database """ + try: + c = conn.cursor() + c.execute(create_table_sql) + except Error as e: + print(e) + +def add_item(conn, os, hostname, address, ports): + """ Create a table in the database """ + values = (os,hostname,address,ports) + query = """ INSERT into targets (os,hostname,address,ports) + VALUES(?,?,?,?); """ + try: + c = conn.cursor() + c.execute(query, values) + except Error as e: + print(e) + +def main(): + """ Connect to the database file """ + database = 'scanned.db' + + conn = create_connection(database) + if conn is None: + raise("Could not connect to database") + + """ Create the table if it isn't there """ + targetTableCreate = """ CREATE TABLE IF NOT EXISTS targets ( + id integer PRIMARY KEY, + os text, + hostname text, + address integer, + ports text + ); """ + create_table(conn, targetTableCreate) + + add_item(conn, "windows", "localhost", 1, "80,69,8080") + + # Close the database connection + conn.close() + +if __name__ == '__main__': + main() diff --git a/sav.txt b/sav.txt new file mode 100644 index 0000000..ef6ab4a --- /dev/null +++ b/sav.txt @@ -0,0 +1,30 @@ +# Nmap 7.70 scan initiated Mon Feb 18 01:16:33 2019 as: nmap -O -oG scant 192.168.1.0/24 +Host: 192.168.1.1 () Status: Up +Host: 192.168.1.1 () Ports: 22/open/tcp//ssh///, 80/open/tcp//http///, 443/open/tcp//https/// Ignored State: filtered (997) Seq Index: 261 IP ID Seq: Randomized +Host: 192.168.1.10 () Status: Up +Host: 192.168.1.10 () Ports: 22/open/tcp//ssh///, 5900/open/tcp//vnc/// Ignored State: closed (998) OS: Linux 3.10 - 4.11 Seq Index: 259 IP ID Seq: All zeros +Host: 192.168.1.20 () Status: Up +Host: 192.168.1.20 () Ports: 21/open/tcp//ftp///, 22/open/tcp//ssh///, 80/open/tcp//http///, 111/open/tcp//rpcbind/// Ignored State: closed (996) OS: Linux 3.10 - 4.11 Seq Index: 256 IP ID Seq: All zeros +Host: 192.168.1.40 () Status: Up +Host: 192.168.1.40 () Ports: 22/open/tcp//ssh///, 25/open/tcp//smtp///, 110/open/tcp//pop3///, 111/open/tcp//rpcbind///, 143/open/tcp//imap///, 993/open/tcp//imaps///, 995/open/tcp//pop3s/// Ignored State: closed (993) OS: Linux 3.10 - 4.11 Seq Index: 262 IP ID Seq: All zeros +Host: 192.168.1.50 () Status: Up +Host: 192.168.1.50 () Ports: 22/open/tcp//ssh///, 80/open/tcp//http///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds/// Ignored State: closed (996) OS: Linux 3.10 - 4.11 Seq Index: 256 IP ID Seq: All zeros +Host: 192.168.1.60 () Status: Up +Host: 192.168.1.60 () Ports: 21/open/tcp//ftp///, 22/open/tcp//ssh///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 5900/open/tcp//vnc/// Ignored State: closed (995) OS: Linux 3.10 - 4.11 Seq Index: 259 IP ID Seq: All zeros +Host: 192.168.1.70 () Status: Up +Host: 192.168.1.70 () Ports: 53/open/tcp//domain///, 80/open/tcp//http///, 88/open/tcp//kerberos-sec///, 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 389/open/tcp//ldap///, 443/open/tcp//https///, 445/open/tcp//microsoft-ds///, 464/open/tcp//kpasswd5///, 593/open/tcp//http-rpc-epmap///, 636/open/tcp//ldapssl///, 3268/open/tcp//globalcatLDAP///, 3269/open/tcp//globalcatLDAPssl///, 3389/open/tcp//ms-wbt-server///, 49152/open/tcp//unknown///, 49153/open/tcp//unknown///, 49154/open/tcp//unknown///, 49155/open/tcp//unknown///, 49157/open/tcp//unknown///, 49158/open/tcp//unknown///, 49159/open/tcp//unknown/// Ignored State: closed (979) OS: Microsoft Windows Server 2012 R2 Seq Index: 258 IP ID Seq: Incremental +Host: 192.168.1.80 () Status: Up +Host: 192.168.1.80 () Ports: 53/open/tcp//domain///, 80/open/tcp//http///, 88/open/tcp//kerberos-sec///, 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 389/open/tcp//ldap///, 443/open/tcp//https///, 445/open/tcp//microsoft-ds///, 464/open/tcp//kpasswd5///, 593/open/tcp//http-rpc-epmap///, 636/open/tcp//ldapssl///, 3268/open/tcp//globalcatLDAP///, 3269/open/tcp//globalcatLDAPssl///, 3389/open/tcp//ms-wbt-server///, 49152/open/tcp//unknown///, 49153/open/tcp//unknown///, 49154/open/tcp//unknown///, 49155/open/tcp//unknown///, 49157/open/tcp//unknown///, 49158/open/tcp//unknown///, 49159/open/tcp//unknown/// Ignored State: closed (979) OS: Microsoft Windows Server 2012 R2 Seq Index: 259 IP ID Seq: Incremental +Host: 192.168.1.90 () Status: Up +Host: 192.168.1.90 () Ports: 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 1433/open/tcp//ms-sql-s///, 3389/open/tcp//ms-wbt-server/// Ignored State: closed (995) Seq Index: 252 IP ID Seq: Incremental +Host: 192.168.1.100 () Status: Up +Host: 192.168.1.100 () Ports: 80/open/tcp//http///, 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 3389/open/tcp//ms-wbt-server///, 49152/open/tcp//unknown///, 49153/open/tcp//unknown///, 49154/open/tcp//unknown///, 49157/open/tcp//unknown/// Ignored State: closed (991) OS: Microsoft Windows Vista Home Premium SP1, Windows 7, or Windows Server 2008 Seq Index: 255 IP ID Seq: Incremental +Host: 192.168.1.110 () Status: Up +Host: 192.168.1.110 () Ports: 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 3389/open/tcp//ms-wbt-server/// Ignored State: closed (996) Seq Index: 261 IP ID Seq: Incremental +Host: 192.168.1.114 () Status: Up +Host: 192.168.1.114 () Status: Up +Host: 192.168.1.120 () Status: Up +Host: 192.168.1.120 () Ports: 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 3389/open/tcp//ms-wbt-server///, 49153/open/tcp//unknown///, 49154/open/tcp//unknown///, 49157/open/tcp//unknown///, 49158/open/tcp//unknown/// Ignored State: filtered (992) OS: Microsoft Windows 7 Professional or Windows 8|Microsoft Windows Vista SP0 or SP1, Windows Server 2008 SP1, or Windows 7|Microsoft Windows Vista SP2, Windows 7 SP1, or Windows Server 2008 Seq Index: 255 IP ID Seq: Incremental +Host: 192.168.1.113 () Status: Up +Host: 192.168.1.113 () Status: Up +# Nmap done at Mon Feb 18 01:17:54 2019 -- 256 IP addresses (14 hosts up) scanned in 81.65 seconds diff --git a/scan.py b/scan.py new file mode 100644 index 0000000..2258391 --- /dev/null +++ b/scan.py @@ -0,0 +1,18 @@ +import sys +import nmap +# initialize the port scanner +nmScan = nmap.PortScanner() + +# scan localhost for ports in range 21-443 +nmScan.scan('127.0.0.1', '21-443') + +# run a loop to print all the found result about the ports +for host in nmScan.all_hosts(): + sys.stdout.write("{};{};{};".format(host, nmScan[host].hostname(), nmScan[host].state()) ) + for proto in nmScan[host].all_protocols(): + sys.stdout.write("{};".format(proto)) + lport = nmScan[host][proto].keys() + lport = sorted(lport) + for port in lport: + sys.stdout.write("{};{};".format(port, nmScan[host][proto][port]['state'])) + sys.stdout.write("\n") diff --git a/scant.txt b/scant.txt new file mode 100644 index 0000000..ef6ab4a --- /dev/null +++ b/scant.txt @@ -0,0 +1,30 @@ +# Nmap 7.70 scan initiated Mon Feb 18 01:16:33 2019 as: nmap -O -oG scant 192.168.1.0/24 +Host: 192.168.1.1 () Status: Up +Host: 192.168.1.1 () Ports: 22/open/tcp//ssh///, 80/open/tcp//http///, 443/open/tcp//https/// Ignored State: filtered (997) Seq Index: 261 IP ID Seq: Randomized +Host: 192.168.1.10 () Status: Up +Host: 192.168.1.10 () Ports: 22/open/tcp//ssh///, 5900/open/tcp//vnc/// Ignored State: closed (998) OS: Linux 3.10 - 4.11 Seq Index: 259 IP ID Seq: All zeros +Host: 192.168.1.20 () Status: Up +Host: 192.168.1.20 () Ports: 21/open/tcp//ftp///, 22/open/tcp//ssh///, 80/open/tcp//http///, 111/open/tcp//rpcbind/// Ignored State: closed (996) OS: Linux 3.10 - 4.11 Seq Index: 256 IP ID Seq: All zeros +Host: 192.168.1.40 () Status: Up +Host: 192.168.1.40 () Ports: 22/open/tcp//ssh///, 25/open/tcp//smtp///, 110/open/tcp//pop3///, 111/open/tcp//rpcbind///, 143/open/tcp//imap///, 993/open/tcp//imaps///, 995/open/tcp//pop3s/// Ignored State: closed (993) OS: Linux 3.10 - 4.11 Seq Index: 262 IP ID Seq: All zeros +Host: 192.168.1.50 () Status: Up +Host: 192.168.1.50 () Ports: 22/open/tcp//ssh///, 80/open/tcp//http///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds/// Ignored State: closed (996) OS: Linux 3.10 - 4.11 Seq Index: 256 IP ID Seq: All zeros +Host: 192.168.1.60 () Status: Up +Host: 192.168.1.60 () Ports: 21/open/tcp//ftp///, 22/open/tcp//ssh///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 5900/open/tcp//vnc/// Ignored State: closed (995) OS: Linux 3.10 - 4.11 Seq Index: 259 IP ID Seq: All zeros +Host: 192.168.1.70 () Status: Up +Host: 192.168.1.70 () Ports: 53/open/tcp//domain///, 80/open/tcp//http///, 88/open/tcp//kerberos-sec///, 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 389/open/tcp//ldap///, 443/open/tcp//https///, 445/open/tcp//microsoft-ds///, 464/open/tcp//kpasswd5///, 593/open/tcp//http-rpc-epmap///, 636/open/tcp//ldapssl///, 3268/open/tcp//globalcatLDAP///, 3269/open/tcp//globalcatLDAPssl///, 3389/open/tcp//ms-wbt-server///, 49152/open/tcp//unknown///, 49153/open/tcp//unknown///, 49154/open/tcp//unknown///, 49155/open/tcp//unknown///, 49157/open/tcp//unknown///, 49158/open/tcp//unknown///, 49159/open/tcp//unknown/// Ignored State: closed (979) OS: Microsoft Windows Server 2012 R2 Seq Index: 258 IP ID Seq: Incremental +Host: 192.168.1.80 () Status: Up +Host: 192.168.1.80 () Ports: 53/open/tcp//domain///, 80/open/tcp//http///, 88/open/tcp//kerberos-sec///, 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 389/open/tcp//ldap///, 443/open/tcp//https///, 445/open/tcp//microsoft-ds///, 464/open/tcp//kpasswd5///, 593/open/tcp//http-rpc-epmap///, 636/open/tcp//ldapssl///, 3268/open/tcp//globalcatLDAP///, 3269/open/tcp//globalcatLDAPssl///, 3389/open/tcp//ms-wbt-server///, 49152/open/tcp//unknown///, 49153/open/tcp//unknown///, 49154/open/tcp//unknown///, 49155/open/tcp//unknown///, 49157/open/tcp//unknown///, 49158/open/tcp//unknown///, 49159/open/tcp//unknown/// Ignored State: closed (979) OS: Microsoft Windows Server 2012 R2 Seq Index: 259 IP ID Seq: Incremental +Host: 192.168.1.90 () Status: Up +Host: 192.168.1.90 () Ports: 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 1433/open/tcp//ms-sql-s///, 3389/open/tcp//ms-wbt-server/// Ignored State: closed (995) Seq Index: 252 IP ID Seq: Incremental +Host: 192.168.1.100 () Status: Up +Host: 192.168.1.100 () Ports: 80/open/tcp//http///, 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 3389/open/tcp//ms-wbt-server///, 49152/open/tcp//unknown///, 49153/open/tcp//unknown///, 49154/open/tcp//unknown///, 49157/open/tcp//unknown/// Ignored State: closed (991) OS: Microsoft Windows Vista Home Premium SP1, Windows 7, or Windows Server 2008 Seq Index: 255 IP ID Seq: Incremental +Host: 192.168.1.110 () Status: Up +Host: 192.168.1.110 () Ports: 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 3389/open/tcp//ms-wbt-server/// Ignored State: closed (996) Seq Index: 261 IP ID Seq: Incremental +Host: 192.168.1.114 () Status: Up +Host: 192.168.1.114 () Status: Up +Host: 192.168.1.120 () Status: Up +Host: 192.168.1.120 () Ports: 135/open/tcp//msrpc///, 139/open/tcp//netbios-ssn///, 445/open/tcp//microsoft-ds///, 3389/open/tcp//ms-wbt-server///, 49153/open/tcp//unknown///, 49154/open/tcp//unknown///, 49157/open/tcp//unknown///, 49158/open/tcp//unknown/// Ignored State: filtered (992) OS: Microsoft Windows 7 Professional or Windows 8|Microsoft Windows Vista SP0 or SP1, Windows Server 2008 SP1, or Windows 7|Microsoft Windows Vista SP2, Windows 7 SP1, or Windows Server 2008 Seq Index: 255 IP ID Seq: Incremental +Host: 192.168.1.113 () Status: Up +Host: 192.168.1.113 () Status: Up +# Nmap done at Mon Feb 18 01:17:54 2019 -- 256 IP addresses (14 hosts up) scanned in 81.65 seconds diff --git a/style.css b/style.css new file mode 100644 index 0000000..3471cb9 --- /dev/null +++ b/style.css @@ -0,0 +1,27 @@ +*{ + background-color: white; + color: black; + font-family: Arial, Helvetica, sans-serif; +} + +body{ + width: 90%; +} + +#scan-table{ + width: 100%; + height: 100%; +} + +.table-header{ + background-color: B9C9FE; +} + +.table-row{ + border:1px solid white; + font-weight: bold; + background-color: E8EDFF; +} + +.windows{background-image: url('media/windows.png');} +.linux{background-image: url('media/linux.png');} \ No newline at end of file