Skip to content

Tanmay-Bhatnagar22/Port-Scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Port Scanner

A modern, GUI-based network security tool for scanning open ports on target hosts. Built with Python and Tkinter, featuring multi-threaded scanning for fast and efficient network reconnaissance.

Python License Platform

Features

  • Modern GUI Interface: Clean, intuitive interface with a professional light color scheme
  • Multi-threaded Scanning: Concurrent port scanning using thread pools for faster results
  • Flexible Port Selection:
    • Scan top 100 most common ports
    • Custom port range (e.g., 1-1000)
    • Specific ports (e.g., 80,443,8080)
  • Service Detection: Automatic identification of common services running on open ports
  • Banner Grabbing: Attempts to capture service banners for better identification
  • Real-time Progress: Live progress bar and status updates during scanning
  • Configurable Settings: Adjustable timeout and thread count for optimal performance
  • Results Export: View scan results with color-coded open ports

Prerequisites

  • Python 3.7 or higher
  • No external dependencies required (uses only Python standard library)

Installation

  1. Clone the repository:
git clone https://github.com/Tanmay-Bhatnagar22/port-scanner.git
cd port-scanner
  1. Run the application:
python port_scanner.py

That's it! No pip installations needed.

Usage

Basic Usage

  1. Launch the application:

    python port_scanner.py
  2. Configure your scan:

    • Enter target IP address or hostname
    • Set timeout (default: 1 second)
    • Choose number of threads (1-200, default: 100)
    • Select scan type:
      • Top 100 Ports: Scans the most common ports
      • Custom Range: Specify your own ports
  3. Start scanning:

    • Click "START SCAN" button
    • Monitor progress in real-time
    • View results as ports are discovered

Example Configurations

Scanning localhost (common services):

Target: 127.0.0.1
Timeout: 1
Threads: 100
Scan Type: Top 100 Ports

Custom port range scan:

Target: example.com
Timeout: 2
Threads: 50
Scan Type: Custom Range
Custom Ports: 1-1000

Specific ports:

Target: 192.168.1.1
Timeout: 1
Threads: 10
Scan Type: Custom Range
Custom Ports: 80,443,8080,3000,8443

Common Ports Scanned

The tool includes scanning for the top 100 most common ports, including:

Port Service Port Service Port Service
21 FTP 80 HTTP 443 HTTPS
22 SSH 110 POP3 3306 MySQL
23 Telnet 143 IMAP 3389 RDP
25 SMTP 445 SMB 5900 VNC
53 DNS 1433 MSSQL 8080 HTTP-Proxy

And many more...

Technical Details

Architecture

  • Core Scanning: Socket-based TCP connection testing
  • Threading Model: ThreadPoolExecutor for concurrent port scanning
  • GUI Framework: Tkinter with custom styling for modern appearance
  • Service Detection: Port-based identification and banner grabbing

Performance

  • Multi-threading: Up to 200 concurrent threads supported
  • Optimized Scanning: Configurable timeout for network conditions
  • Efficient Results: Real-time display of discovered open ports
  • Resource Management: Proper socket cleanup and thread management

Configuration Options

Parameter Description Default Range
Target IP address or hostname 127.0.0.1 Any valid IP/hostname
Timeout Connection timeout in seconds 1 0.1 - 10
Threads Number of concurrent threads 100 1 - 200
Scan Type Port selection method Top 100 Top 100 / Custom

Security & Legal Notice

IMPORTANT: This tool is intended for educational purposes and authorized security testing only.

  • Only scan systems you own or have explicit permission to test
  • Unauthorized port scanning may be illegal in your jurisdiction
  • Use responsibly and ethically
  • The authors are not responsible for misuse of this tool

Troubleshooting

Common Issues

"Hostname could not be resolved"

  • Check if the target hostname is valid
  • Verify your DNS settings
  • Try using an IP address instead

Slow scanning

  • Increase timeout for slow networks
  • Reduce number of threads
  • Check your network connection

No ports found

  • Verify target is reachable (try ping)
  • Check firewall settings
  • Increase timeout value
  • Ensure target services are actually running

Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Developer

Developed by Tanmay Bhatnagar

Acknowledgments

  • Inspired by tools like Nmap and Zenmap
  • Built with Python's powerful standard library
  • Modern UI design principles for better user experience

Screenshots

Main Interface

Clean, modern interface with easy-to-use controls and real-time progress tracking.

image

Note: This tool is for educational and authorized security testing purposes only. Always obtain proper authorization before scanning any network or system you do not own.

About

A multi-threaded Python GUI port scanner built with Tkinter for fast network reconnaissance, service detection, and real-time security analysis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages