Loading repository data…
Loading repository data…
SaiSugeet / repository
A personal-use, dual-mode (GUI + CLI) network port scanner built in pure Python. Discover open ports, identify running services, grab version banners, and generate detailed reports — all from a single file with zero external dependencies.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A personal-use, dual-mode (GUI + CLI) network port scanner built in pure Python.
Discover open ports, identify running services, grab version banners, and generate detailed reports — all from a single file with zero dependencies.
NMAP Scanner is a personal Python-based network port scanning tool built for hands-on learning and home network administration. It probes a target host or subnet to detect which TCP/UDP ports are open, identifies the services running on them, and optionally retrieves live software version banners directly from the service.
It runs in two fully independent modes:
| Mode | How to Launch | Best For |
|---|---|---|
| GUI | python3 port_scanner.py (no args) | Interactive use, visual results, history browsing |
| CLI | python3 port_scanner.py --target <host> ... | Scripting, automation, headless/SSH environments |
Built entirely on the Python standard library — no pip install required.
OpenSSH_8.9p1, Apache/2.4.52)192.168.1.0/24Timeout, Refused, Unreachable, DNS Failureargparse-based interface — every scan option available as a flag--profile--output~/.port_scanner/logs/scan_YYYYMMDD.log~/.port_scanner/history.json (last 50 entries)NMAP-port-scanner/
│
├── port_scanner.py ← Entire application (engine + GUI + CLI)
└── README.md ← This file
# Auto-generated at first run (inside your home directory):
~/.port_scanner/
├── history.json ← Persistent scan history (last 50 scans)
└── logs/
├── scan_20250101.log
└── ... ← One log file per calendar day
The entire application is self-contained in
port_scanner.py— no packages, no virtual environments, no setup scripts.
Python 3.8 or higher
Check your version:
python3 --version
None. Every module used is part of the Python standard library.
| Module | Purpose |
|---|---|
socket | TCP/UDP connection probing and banner grabbing |
threading | Concurrent port scanning |
queue | Thread-safe result delivery to the GUI |
tkinter | Desktop GUI (GUI mode only — see install note below) |
argparse | CLI flag parsing |
ipaddress | CIDR/subnet expansion |
json | History persistence and JSON export |
csv | CSV export |
logging | Auto log file generation |
pathlib | Cross-platform file paths |
git clone https://github.com/SaiSugeet/NMAP-port-scanner.git
cd NMAP-port-scanner
python3 --version
# Expected: Python 3.8 or higher
Tkinter ships with Python on Windows and macOS automatically.
On Linux it requires a one-time install — see the Parrot OS / Kali Linux Setup section below.
# GUI mode (no arguments)
python3 port_scanner.py
# CLI mode
python3 port_scanner.py --target 192.168.1.1 --ports 1-1024
Security distros like Parrot OS and Kali Linux do not ship with tkinter by default. Follow these steps exactly.
sudo apt-get update --fix-missing
sudo apt-get install python3-tk -y --no-install-recommends --fix-missing
Note: If your mirrors return
404errors for unrelated packages (e.g.samba,libldb2), the--fix-missingflag tells apt to skip those and installpython3-tkanyway. This is a known Parrot OS mirror sync issue and does not affect the scanner.
python3 -c "import tkinter; print('tkinter OK:', tkinter.TkVersion)"
# Expected output: tkinter OK: 8.6
python3 port_scanner.py
Your system may have multiple Python versions. Match the install to the exact version you are running:
# Check which Python you're running
python3 --version
# Install for that specific version (e.g. 3.13)
sudo apt-get install python3.13-tk
# Verify
python3 -c "import tkinter; print('tkinter OK:', tkinter.TkVersion)"
┌─────────────────────────────────────────────────────────────────┐
│ ⬡ NETWORK PORT SCANNER [☀ Light] │
├─────────────────────────────────────────────────────────────────┤
│ ⚙ Scan Configuration │
│ Target: [192.168.1.1 ] Profile: [Quick ▼] │
│ Start: [1 ] End: [1024 ] Timeout: [0.3] Threads: [300]│
│ ☑ Banner Grab ☐ UDP Scan ☐ Stealth (slow) ☑ Ping Check │
│ [▶ Start Scan] [■ Stop] [🗑 Clear] │
├─────────────────────────────────────────────────────────────────┤
│ Scanning… 512/1024 (50%) Open: 3 Elapsed: 1.8s │
│ [████████████████░░░░░░░░░░░░░░░░░░░░░░] │
├─────────────────────────────────────────────────────────────────┤
│ 📡 Open Ports │
│ Port │ Proto │ Service │ State │ Banner / Version │
│ ───────┼───────┼────────────┼─────────┼──────────────────────── │
│ 22 │ TCP │ SSH │ ● Open │ OpenSSH 8.9p1 Ubuntu │
│ 80 │ TCP │ HTTP │ ● Open │ Apache/2.4.52 │
│ 443 │ TCP │ HTTPS │ ● Open │ │
├─────────────────────────────────────────────────────────────────┤
│ 📝 Scan Log │
│ [14:32:01] Target : 192.168.1.1 (192.168.1.1) │
│ [14:32:02] [+] TCP 22 SSH OpenSSH 8.9p1 Ubuntu │
├─────────────────────────────────────────────────────────────────┤
│ Export: [TXT] [CSV] [JSON] [HTML] │
└─────────────────────────────────────────────────────────────────┘
| Panel | Description |
|---|---|
| Configuration | All scan settings in one place. Choosing a profile auto-fills port range, timeout, and thread count |
| Status bar | Live progress %, open port count, elapsed timer — all update in real time |
| Progress bar | Fills as ports are probed |
| Treeview table | Each open port appears as a sortable row — click any column header to sort |
| Log console | Timestamped entries: 🟢 green = open port, 🔵 blue = info, 🟠 orange = warning |
| Export row | Four buttons save results instantly in your chosen format |
┌─────────────────────────────────────────────────────────────────┐
│ 📋 Recent Scans │
│ Timestamp │ Target │ Range │ Open │ Time │
│ ─────────────────────┼─────────────────┼──────────┼──────┼───── │
│ 2025-01-15 14:32:01 │ 192.168.1.1 │ 1-1024 │ 3 │ 3.2s │
│ 2025-01-14 09:10:44 │ 10.0.0.1 │ 1-10000 │ 12 │ 18s │
├─────────────────────────────────────────────────────────────────┤
│ [🗑 Clear History] [↩ Load Selected] │
└─────────────────────────────────────────────────────────────────┘
Lists the last 50 scans. Select any row and click ↩ Load Selected to restore those results into the Scanner tab.
┌─────────────────────────────────────────────────────────────────┐
│ Scan A: [2025-01-15 — 192.168.1.1 (3 open) ▼] │
│ Scan B: [2025-01-14 — 10.0.0.1 (12 open) ▼] │
│ [🔄 Compare] │
├─────────────────────────────────────────────────────────────────┤
│ Unchanged: 2 port(s) │
│ │
│ [+] NEW in B (2): ← shown in green │
│ Port 8080 (HTTP-Alt) │
│ Port 3306 (MySQL) │
│ │
│ [-] CLOSED in B (1): ← shown in red │
│ Port 443 (HTTPS) │
└─────────────────────────────────────────────────────────────────┘
Dropdowns are populated from scan history. Newly opened ports appear in green, closed ports in red.