This project is a simple command-line tool written in Go that scans ports on a target domain or IP address. It can scan a range of ports, check which ports are open, and record the results to an output file. It also supports scanning a list of domains from a file.
- Port Scanning: Scan a specific range of ports on a target domain or IP address.
- Service Detection: Identifies common services running on open ports such as FTP, HTTP, SSH, etc.
- Domain List Scanning: Scan multiple domains from a list stored in a file.
- Output to File: Save results to a file in a readable format.
- Parallel Scanning: Uses goroutines to scan multiple ports concurrently for faster results.
- Custom Port Range: Specify custom port ranges for focused and efficient scans.
- Cross-Platform Compatibility: Compatible with Windows, Linux, and macOS.
- Timeout Handling: Configurable timeouts for slow or unresponsive networks.
- Go 1.18 or higher
- Clone the repository to your local machine:
git clone https://github.com/whitehatboy005/Port-Scanner.git
- Navigate to the project directory:
cd Port-Scanner
- Build the project:
go build -o portscan portscan.go
- Make it executable
sudo chmod +x portscan
- Move the binary to /usr/local/bin for global access
sudo mv portscan /usr/local/bin/
You can run the port scanner using the following command-line flags:
-t <target>
: Target domain or IP address to scan.-s <start port>
: Start port number (default: 1).-e <end port>
: End port number (default: 10000).-o <output file>
: Output file to save the results (default:results.txt
).-l <file>
: File with a list of domains to scan.-h
: Display help menu.
-
Scan a single target (example: google.com) from port 1 to 10000 and save the results to
results.txt
:portscan -t google.com -s 1 -e 10000 -o results.txt
-
Scan a list of domains from domains.txt file from port 1 to 10000 and save the results to results.txt:
portscan -l domains.txt -s 1 -e 10000 -o results.txt
This project is licensed under the terms of the MIT license.