Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Port Scanner

A simple Python-based TCP port scanner for discovering open ports on a target host.


๐ŸŒŸ Overview

Port Scanner is a lightweight Python application that scans a target host for open TCP ports within a specified range.

Built using Python's socket programming capabilities, the scanner supports both IPv4 and IPv6 addresses, offers interactive and command-line execution modes, and provides detailed scan results along with total scan duration.

This project is ideal for learning networking concepts, cybersecurity fundamentals, and port discovery techniques.


๐Ÿš€ Key Features

  • ๐Ÿ” Host Scanning โ€“ Scan hostnames, IPv4, and IPv6 addresses
  • ๐Ÿ“ถ Custom Port Range โ€“ Specify start and end ports
  • โšก Fast TCP Port Detection โ€“ Uses socket-based connections
  • ๐ŸŒ IPv4 & IPv6 Support
  • โŒจ๏ธ Command-Line Mode
  • ๐Ÿ–ฑ๏ธ Interactive Mode
  • ๐Ÿ›ก๏ธ Input Validation & Error Handling
  • โฑ๏ธ Scan Duration Reporting

๐Ÿ› ๏ธ Tech Stack

  • Python 3.x
  • Socket Programming
  • TCP Networking

๐Ÿ“ Project Structure

PORT-SCANNER/
โ”œโ”€โ”€ port_scanner.py                        # Main scanner application
โ””โ”€โ”€ README.md                              # Documentation

โš™๏ธ Installation & Usage

1๏ธโƒฃ Clone the Repository

git clone https://github.com/HimanshuKumarRout/PORT-SCANNER.git
cd port-scanner

2๏ธโƒฃ Run Using Command-Line Arguments

python port_scanner.py <target> <start_port> <end_port>

Example:

python port_scanner.py example.com 1 1024

3๏ธโƒฃ Run in Interactive Mode

python port_scanner.py

Then enter:

  • Target hostname or IP address
  • Starting port
  • Ending port

๐Ÿ–ฅ๏ธ Sample Output

Scanning host: example.com

Port 80 is OPEN
Port 443 is OPEN

Scan completed in 2.146 seconds

โš ๏ธ Important Notes

  • Port numbers must be between 1 and 65535
  • Starting port must be less than or equal to the ending port
  • Large port ranges may take additional time to scan
  • Results depend on network accessibility and firewall configurations

๐Ÿ”ฎ Future Enhancements

  • ๐Ÿš€ Multi-threaded scanning
  • ๐Ÿ“Š Export results to CSV or JSON
  • ๐ŸŽจ GUI-based scanner interface
  • ๐Ÿ”” Service detection on open ports
  • ๐ŸŒ UDP port scanning support
  • ๐Ÿ“ก Banner grabbing functionality

๐Ÿค Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a branch (feature/new-feature)
  3. Commit your changes
  4. Push to your branch
  5. Open a Pull Request

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

Himanshu Kumar Rout


โญ Support

If you like this project, please star โญ the repository and share it!


Built with ๐Ÿ” using Python & Socket Programming

About

๐Ÿ” A Python-based port scanner that scans TCP ports on a target host to identify open services and enhance network security analysis.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages