diff --git a/.gitignore b/.gitignore index 921d1fe..7d9e4ff 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ *.dll *.so *.dylib +config.json +zmaplist.txt # Test binary, built with `go test -c` *.test diff --git a/README.md b/README.md index fa688a8..edcb311 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,89 @@ # geoscan -a tool in Golang for scanning the world wide internet \ No newline at end of file +a tool in Golang for scanning the world wide internet + +## how to set up +disclaimer: this guide assumes you have a Linux/Unix capable host with the bash shell installed + +installing prequisities: +- zmap +- mySQL/mariaDB (optional, canner can use sqlite) +```Bash +sudo apt update +sudo apt install zmap +``` + +then compile the backend scanner +```Bash +go mod tidy +chmod +x release.sh +./release.sh +``` +this will compile the main.go scanner + +then make the configuration file in JSON + +example config for mySQL +```JSON +{ + "zmapfile": "zmaplist.txt", + "channelfeeders": 20, + "db": { + "dbdriver": "mysql", + "username": "root", + "password": "admin", + "dbname": "scannerdb" + }, + "web": { + "port": 9000, + "username": "admin", + "password": "admin" + } +} +``` +note to change the username and password to the mySQL/MariaDB database you have installed, to create the database for the scanner, run the following query +```SQL +CREATE DATABASE scannerdb; +CREATE USER 'Scanner'@'localhost' IDENTIFIED BY 'Scannerpass123'; +GRANT ALL PRIVILEGES ON scannerdb.* TO 'Scanner'@'localhost'; +FLUSH PRIVILEGES; +``` +config file for SQLite +```JSON +{ + "zmapfile": "zmaplist.txt", + "channelfeeders": 20, + "db": { + "dbdriver": "sqlite", + "username": "", + "password": "", + "dbname": "scanner.db" + }, + "web": { + "port": 9000, + "username": "admin", + "password": "admin" + } +} +``` +then to start scanning, run zmap that was installed earlier + +```Bash +sudo zmap -p 80 -o zmaplist.txt +``` +leave zmap running for some time, to evenutally build a list of active IPs +then run the scanner with the IP file you got from zmap +``` +./main +``` +make sure the database config is correct, otherwise an error will be seen of being unable to connect to the database *if using mySQL* + +then after we are done scanning, we wanna see our data + +## making and using the frontend + +- first, compile the frontend + ```Bash + go build -ldflags "-s -w" -trimpath frontend.go + ``` + a frontend binary will appear, run with ./frontend \ No newline at end of file