Port-Scanner is a tool to scan ports of any given host. Complies with all but the fourth iteration.
- Scans all ports and reports the ones open.
- Uses concurrency to scan the ports, you can customize the amount of threads to use, the default is 5.
Avoids getting detected by the firewall:
- Scans odd and even ports separately so it never scans consecutive ports (Waits 2 seconds between even and odds).
- Uses randomized timeout to avoid opening and closing at least 4 ports in a predictable timely manner.
- Dockerized
Go run command should install all necessary dependencies.
Build Docker image
Docker build -t port-scanner .
Flags | Description | Default |
---|---|---|
-host | HostName you want to scan. | google.com |
-t | Number of threads to use. | 5 |
-start | Start of port range to scan. | 0 |
-end | End of port range to scan. | 1024 |
-f | If true, is not wary of a firewall and may be detected. | False |
Run main.go using the command scan
go run main.go scan -host stackoverflow.com
Run the Docker image
docker run port-scanner:latest -host stackoverflow.com
docker run port-scanner:latest -host stackoverflow.com -t 10
or
go run main.go scan -host stackoverflow.com -t 10
docker run port-scanner:latest -host stackoverflow.com -start 60 -end 10000
or
go run main.go scan -host stackoverflow.com -start 60 -end 10000
docker run port-scanner:latest -host stackoverflow.com -f
or
go run main.go scan -host stackoverflow.com -f
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.