GitHunt
NA

navanil-das/Network_Scanner

Multithreaded Python network scanner for detecting open ports and identifying services using banner grabbing, with CLI support and JSON export.

๐Ÿ” Network Scanner

A multithreaded network scanner built in Python that detects open ports and identifies running services using banner grabbing. Designed as a lightweight, modular alternative to tools like Nmap.


๐Ÿš€ Features

  • โšก Multithreaded TCP port scanning
  • ๐ŸŽฏ Custom port range support
  • ๐Ÿ”Ž Service detection via banner grabbing
  • ๐Ÿ’ป Command-line interface (CLI)
  • ๐Ÿ“ JSON export of scan results
  • ๐Ÿง  Basic OS detection using TTL

๐Ÿ—๏ธ Project Structure

network-scanner/
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ scanner.py          # core scanning logic
โ”‚   โ”œโ”€โ”€ banner_grabber.py   # service detection
โ”‚   โ””โ”€โ”€ utils.py            # helpers (port parsing, OS detection)
โ”‚
โ”œโ”€โ”€ results/
โ”‚   โ””โ”€โ”€ scan_results.json   # saved outputs
โ”‚
โ”œโ”€โ”€ main.py                 # CLI entry point
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

โš™๏ธ Installation

git clone https://github.com/navanil-das/network-scanner.git
cd network-scanner
pip install -r requirements.txt

โ–ถ๏ธ Usage

python main.py --target 192.168.1.10 --ports 1-1000

Arguments

Argument Description
--target Target IP address
--ports Port range (default: 1-1024)

๐Ÿงช Example Output

Scanning 192.168.1.10...

OS Guess: Linux

[OPEN] 22 -> SSH-2.0-OpenSSH_8.2
[OPEN] 80 -> Apache/2.4.41
[OPEN] 443 -> Unknown

Results saved to results/scan_results.json

๐Ÿ“ฆ Output (JSON)

{
  "target": "192.168.1.10",
  "open_ports": [
    {"port": 22, "banner": "SSH-2.0-OpenSSH_8.2"},
    {"port": 80, "banner": "Apache/2.4.41"}
  ]
}

๐Ÿง  Concepts Used

  • TCP/IP & Port Scanning
  • Multithreading (I/O-bound optimization)
  • Banner Grabbing
  • CLI Tool Development
  • JSON Serialization

โš ๏ธ Disclaimer

This tool is intended for educational purposes only.
Do not scan networks without proper authorization.


โญ Future Improvements

  • UDP scanning
  • Service version fingerprinting
  • GUI interface
  • Integration with vulnerability scanning

๐Ÿ‘จโ€๐Ÿ’ป Author