A professional, lightweight, and incredibly fast multi-threaded TCP Port Scanner written in Python. This tool not only discovers open ports but also performs banner grabbing and checks detected services against a mini Vulnerability Database (CVEs) on the fly.
Designed to be a rapid reconnaissance utility for penetration testing, server auditing, and general network diagnostics.
- 🚀 Insanely Fast Multi-Threading: Uses Python's
concurrent.futuresto scan hundreds of ports simultaneously. - 🎯 Banner Grabbing: Protocol-specific requests to extract software versions (HTTP, FTP, SSH, etc.).
- 🛡️ Vulnerability Detection: Compares grabbed banners against an internal CVE database for instant risk awareness.
- 🎨 Beautiful Terminal UI: Real-time port discovery and clean progress tracking using
colorama. - 📂 Export to JSON: Output structured JSON to the terminal or directly save it to a file for parsing in other tools.
- 🔌 Cross-Platform: Works completely flawlessly on both Linux and Windows.
- Python 3.8+
- The
coloramalibrary (for cross-platform colored terminal output).
-
Clone the repository:
git clone https://github.com/yourusername/python-port-scanner.git cd python-port-scanner -
Install the required dependencies:
pip install -r requirements.txt
You can use the built-in help menu to see all available options:
python scanner.py -hScans the default ports (1-1000) on the target IP:
python scanner.py -t 192.168.1.10You can specify a single range or multiple specific ports:
python scanner.py -t example.com -p 21,22,80,443,1-100Increase the number of concurrent worker threads (default is 100) for faster scanning across large ranges:
python scanner.py -t 192.168.1.1 -p 1-65535 -w 300Save the scan results into a structured .json file for future analysis:
python scanner.py -t 10.0.0.5 -p 1-1000 -s scan_results.jsonUseful for piping into jq or other command-line tools:
python scanner.py -t 10.0.0.5 -p 80,443 -o jsonTerminal Output:
[*] Starting scan on target 192.168.1.10 (192.168.1.10)
[*] Scanning 1000 ports with 100 threads...
PORT STATE SERVICE BANNER VULNERABILITIES
-------------------------------------------------------------------------------------
22 Open OpenSSH 7.2 SSH-2.0-OpenSSH_7.2p2 CVE-2016-0777 Information Leak
80 Open Apache 2.4.49 HTTP/1.1 400 Bad Request CVE-2021-41773 Path Traversal
-------------------------------------------------------------------------------------
[*] Scan completed. Found 2 open ports.
JSON Output:
{
"target": "192.168.1.10",
"hostname": "192.168.1.10",
"open_ports": [
{
"port": 22,
"state": "Open",
"service": "OpenSSH 7.2",
"banner": "SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1",
"vulnerabilities": [
"CVE-2016-0777 Information Leak"
]
}
]
}This tool is designed for educational and professional use only. You should only use this port scanner on systems, networks, and applications that you have explicit permission to audit. The authors take no responsibility and assume no liability for any misuse or damage caused by this program.
Distributed under the GNU General Public License v3.0 (GPLv3). See LICENSE for more information.