A powerful and efficient Python-based port scanner that supports concurrent scanning, service detection, and customizable scanning options.
git clone https://github.com/yourusername/port-scanner.git
cd port-scanner
pip install colorama
Basic usage:
python app.py -t <target_ip> -p <ports>
Argument | Description | Example |
---|---|---|
-t, --target |
Target IP address (required) | -t 192.168.1.1 |
-p, --ports |
Ports to scan (required) | -p common |
-v, --verbose |
Enable verbose output | -v |
-w, --workers |
Maximum number of concurrent workers (default: 100) | -w 200 |
-to, --timeout |
Connection timeout in seconds (default: 1.0) | -to 2.0 |
The -p
argument accepts several formats:
common
: Most commonly used ports (21, 22, 23, 25, 53, 80, 110, 143, 443, 445, 3306, 3389, 5432, 8080)web
: Web server ports (80, 443, 8080, 8443)database
: Database server ports (1433, 1521, 3306, 5432, 27017)mail
: Email server ports (25, 110, 143, 465, 587, 993, 995)remote
: Remote access ports (22, 23, 3389, 5900)start-end
: Scan ports from start to end (inclusive)-p 80-100
-p 80,443,8080
all
: Scan all ports (1-65535)python app.py -t 192.168.1.1 -p common
python app.py -t 192.168.1.1 -p web -v
python app.py -t 192.168.1.1 -p 80-100 -w 200 -to 2.0
python app.py -t 192.168.1.1 -p 80,443,8080
The scanner provides color-coded output:
Example output:
Scanning 192.168.1.1...
Total ports to scan: 14
Progress: 100.0% (14/14)
Open ports on 192.168.1.1:
[+] Port 80: OPEN - http
[+] Port 443: OPEN - https
The scanner includes comprehensive error handling for:
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
This tool is intended for legitimate network testing and security assessment purposes only. Always ensure you have proper authorization before scanning any network or system.