A simple command-line TCP port scanner built in Python. This tool allows you to scan the most common ports (1–1024) on a target IP address or hostname to identify open ports. It’s a great beginner-friendly project for anyone learning about networking or cybersecurity.
- Learn how to use Python’s built-in socketmodule for networking tasks.
- Understand the basics of TCP port scanning and how open ports are identified.
- Create a functional cybersecurity tool using basic Python skills.
- Demonstrate scripting and networking knowledge in a portfolio-ready project.
- Python 3.x
- Terminal or command line access
- Code editor (e.g., VS Code)
- Git and GitHub account
Install dependencies using:
pip install -r requirements.txt- Scans TCP ports from 1 to 1024
- Displays which ports are open
- Resolves hostnames to IP addresses
- Lightweight and beginner-friendly
- Easily extendable (threading, service detection, etc.)
- Clone the repository:
git clone https://github.com/taraddei/PortScanner.git- Navigate to the project directory:
cd PortScanner- Install required packages:
pip install -r requirements.txtpython port_scanner.py -t <targets> [-p <port-range>] [-T <timeout>] [-n <num-threads>] [-o <output>] [-v]| Option | Description | 
|---|---|
| -t,--targets | Specify the target IP addresses or domain names (required) | 
| -p,--port-range | Port range to scan (e.g., 1-100orall). Default:1-100 | 
| -T,--timeout | Timeout value in seconds. Default: 1.0 | 
| -n,--num-threads | Number of threads to use. Default: 10 | 
| -o,--output | Output file to save results (e.g., output.json) | 
| -v,--verbose | Enable verbose output | 
✅ Scan a single target for open ports (default range):
python port_scanner.py -t 192.168.1.1✅ Scan multiple targets and save results:
python port_scanner.py -t example.com 192.168.1.1 -p 1-65535 -o results.json✅ Enable verbose output:
python port_scanner.py -t 192.168.1.1 -vThe purpose of this project is to provide a simple yet effective TCP port scanning tool that allows users to scan one or more target IP addresses or domain names for open ports.
It is designed to be:
- 🧩 Versatile
- ⚡ Fast
- 📊 Informative
Whether you are:
- A network administrator
- A security professional
- Or a curious learner
This tool helps you identify open ports and gather insights into services running on them.
Contributions, suggestions, and improvements are welcome! Feel free to fork this repo, open issues, or submit pull requests.
This project is licensed under the MIT License.
Created by Angela T
🌐 GitHub Profile
💡 "Hackers don’t need names or proximity,just opportunity.” ― Robert Mueller, Former Director, FBI."