GrooveXlabs/simple-port-scanner
GitHub: GrooveXlabs/simple-port-scanner
Stars: 0 | Forks: 0
## 🔍 Overview
**GrooveXlabs Simple Port Scanner** is a lightweight, educational TCP port scanner written in Python. It helps you understand network reconnaissance basics by scanning a range of ports on a target host to identify which services are listening.
## ✨ Features
- 🎯 **Single & Range Scanning** — Scan individual ports or full ranges (1–65535)
- ⚡ **Fast Timeouts** — 0.5s socket timeout for responsive feedback
- 🖥️ **Interactive CLI** — Simple prompts for host and port range
- 🛡️ **Input Validation** — Sanitizes port ranges and prevents invalid input
- 📋 **Clean Output** — Clearly lists all open ports found
## 🚀 Quick Start
# Clone the repo
git clone https://github.com/GrooveXlabs/simple-port-scanner.git
cd simple-port-scanner
# Run the scanner
python port_scanner.py
**Example:**
$ python port_scanner.py
=== Groovexlabs Simple Port Scanner ===
Enter host to scan (e.g. 127.0.0.1 or scanme.nmap.org): scanme.nmap.org
Enter start port (e.g. 1): 20
Enter end port (e.g. 1024): 25
Scanning scanme.nmap.org from port 20 to 25...
[+] Port 22 is OPEN
Scan complete. Open ports:
- 22
## 📁 File Structure
simple-port-scanner/
├── port_scanner.py # Main scanner logic
├── README.md # This file
└── LICENSE # MIT License
## 🛡️ How It Works
┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Input │────→│ TCP Socket │────→│ Timeout/Result │
│ Host + Port │ │ Connection │ │ Open / Closed │
└─────────────┘ └──────────────┘ └─────────────────┘
1. Creates a TCP socket (`socket.AF_INET`, `socket.SOCK_STREAM`)
2. Sets a 0.5-second timeout to avoid hanging
3. Attempts to connect to each port in the range
4. Prints open ports and summarizes results
## 🧠 Learning Path
1. **Run it locally** — Scan `127.0.0.1` to see your own services
2. **Try scanme.nmap.org** — A safe, authorized target for practice
3. **Read the code** — Understand sockets, timeouts, and exception handling
4. **Extend it** — Add banner grabbing, multithreading, or Nmap-style output
## ⚠️ Legal & Ethical Use
**GrooveXlabs is not responsible for misuse of this tool.**
## 🗺️ Related GrooveXlabs Projects
| Repository | Description |
|---|---|
| [GrooveXlabs](https://github.com/GrooveXlabs/GrooveXlabs) | Password Strength Analyzer |
| [security-notes](https://github.com/GrooveXlabs/security-notes) | Curated cybersecurity learning notes |
| [redtrack](https://github.com/GrooveXlabs/redtrack) | Red Team Recon & Attack Path Mapping |
## 📜 License
Distributed under the MIT License. See `LICENSE` for more information.
🔒 Built with security in mind. Open source by conviction.
Maintained by GrooveXlabs
🔒 Built with security in mind. Open source by conviction.
Maintained by GrooveXlabs