A simple and efficient TCP port scanner implemented in Go. This tool allows users to scan all TCP ports on a specified hostname or IP address to identify open ports. This project can be an alternative to nmap. I don't like nmap very much because it is hard to run on Windows.
- Much faster and lighter than Nmap
- Scans all TCP ports (1-65535) on a specified hostname or IP address.
- Displays open ports in a nicely formatted ASCII table.
- Runnable on Windows and Linux
- Lightweight and fast scanner
To use this package, you need to have Go installed on your machine. If you don't have Go installed, you can download and install it from here.
- Clone the repository:
git clone https://github.com/mohammadhasanii/go-nmap.git
- Run the application
go run main.go
Just enter the IP address or hostname of your choice and see all the open TCP ports of that network.
- Go 1.16 or later
- tablewriter Go package (for table formatting)
_______ ______ .__ __. .___ ___. ___ .______
/ _____| / __ \ | \ | | | \/ | / \ | _ \
| | __ | | | | ______| \| | | \ / | / ^ \ | |_) |
| | |_ | | | | | |______| . ` | | |\/| | / /_\ \ | ___/
| |__| | | `--' | | |\ | | | | | / _____ \ | |
\______| \______/ |__| \__| |__| |__| /__/ \__\ | _|
Enter hostname or IP address (or type 'exit' to quit): google.com
Scanning ports on google.com...
Please wait \
We were able to find 1 open TCP ports
|------|----------|--------|
| PORT | PROTOCOL | STATUS |
|------|----------|--------|
| 80 | TCP | OPEN |
|------|----------|--------|
Port scanning completed in 12s.
Done! want to scan another IP address? (yes/no):
For Windows:
go build -o main.exe
For Linux:
GOOS=linux GOARCH=amd64 go build -o main
If you would like to contribute to this project, please fork the repository and submit a pull request.