⚠️ Disclaimer: This tool is built strictly for educational and authorized security testing purposes only. Scanning targets without prior mutual consent is illegal. The author assumes no liability and is not responsible for any misuse or damage caused by this program.
PortScanner is a lightweight, Python-based network reconnaissance tool designed to scan target hosts, discover active ports, and identify running services in real time. Built using core networking fundamentals, it serves as a practical project for learning how socket connections and network reconnaissance operate under the hood.
- Hostname & IP Resolution: Seamlessly accepts both raw IP addresses (e.g.,
192.168.1.1) and domain names (e.g.,scanme.nmap.org). - Custom Port Range: Target specific standard ranges (e.g.,
1-1024) or full scan ranges (1-65535). - Real-Time Stream: Live terminal feedback as open ports are discovered.
- Service Mapping: Automatically resolves common standard port numbers to their associated protocols (e.g., HTTP, SSH, FTP, HTTPS).
- Result Export: Option to save scan results into a file for further analysis.
PortScanner/
├── portscanner.py # Main application script
├── req.txt # Project dependencies
├── LICENSE # MIT License
└── README.md # Project documentation
- Python 3.8 or higher installed on your system.
-
Clone the repository:
git clone https://github.com/ShehanSulakshana/PortScanner.git cd PortScanner -
Install dependencies:
pip install -r req.txt
-
Run the scanner:
python portscanner.py
Understanding port scanning techniques is critical for several core cybersecurity domains:
- Penetration Testing: Initial discovery phase to map out an organization's exposed attack surface.
- Network Administration: Auditing internal and perimeter firewalls to prevent unauthorized external services from being exposed.
- CTF & Lab Challenges: Essential skill for host discovery in controlled hacking environments.
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page if you want to contribute.
Distributed under the MIT License. See LICENSE for more details.
Shehan Sulakshana
Cybersecurity Undergraduate | Python & Network Security Enthusiast
- GitHub: @ShehanSulakshana
"You can't defend what you can't see."