Skip to content

Harish6174/Port_scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

🔍 Python Port Scanner

A lightweight, multithreaded port scanner built in Python — inspired by Nmap. Built as part of a cybersecurity learning portfolio.

Features

  • ⚡ Multithreaded TCP Connect Scan (100 threads by default)
  • 🏷️ Service & Banner Detection
  • 🖥️ OS Fingerprinting via ICMP TTL
  • 📁 Export results to JSON or CSV

Usage

# Scan common ports
python port_scanner.py scanme.nmap.org

# Scan port range
python port_scanner.py 192.168.1.1 -p 1-1024

# Export to JSON
python port_scanner.py scanme.nmap.org --export json

Options

Flag Description Default
-p Port range (1-1024, 80,443, common) common
-t Timeout per port (seconds) 1.0
--threads Number of parallel threads 100
--export Export format: json or csv None
--output Output filename scan_results.*

How It Works

  1. TCP Connect Scan — performs a full 3-way handshake to check if a port is open
  2. Banner Grabbing — reads the service's greeting message to identify version
  3. OS Fingerprinting — analyses ICMP TTL value to guess the operating system
  4. Threading — uses Python's ThreadPoolExecutor to scan ports in parallel

⚠️ Legal Disclaimer

Only scan systems you own or have explicit permission to scan. Unauthorized port scanning may be illegal in your jurisdiction.

Tech Stack

  • Python 3.x
  • socket — TCP connections and raw ICMP
  • concurrent.futures — multithreading
  • argparse — CLI interface
  • json / csv — result export

About

A multithreaded Python port scanner with banner grabbing and OS fingerprinting

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages