Skip to content

eshwargit2/Port_Scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Port Scanner Tool

A powerful and modern network security tool for scanning open ports on target IP addresses or domain names. Built with Python and Flask, featuring both a beautiful web interface and a terminal-based mode with fast multi-threaded scanning.

Python Flask License

✨ Features

  • πŸš€ Fast Multi-threaded Scanning - Scans 1024 ports in seconds using 100 concurrent threads
  • 🌐 Dual Interface - Choose between Web UI or Terminal mode
  • 🎯 Flexible Input - Accepts IP addresses, domain names, or full URLs
  • πŸ”„ Auto DNS Resolution - Automatically resolves domain names to IP addresses
  • πŸ“Š Real-time Results - See open ports as they're discovered
  • πŸ’Ž Beautiful UI - Modern, responsive web interface with gradient design
  • ⚑ Service Detection - Identifies services running on open ports
  • πŸ“ˆ Version Detection - Attempts to grab service banners for version info
  • 🎨 Clean Terminal UI - Color-coded ASCII art interface for terminal mode

πŸ“‹ Requirements

  • Python 3.7 or higher
  • Flask
  • colorama
  • concurrent.futures (included in Python 3.2+)

πŸš€ Installation

  1. Clone or download this repository
git clone <repository-url>
cd python_tool
  1. Install required packages
pip install flask colorama

πŸ’» Usage

Running the Application

python portScanner_Web.py

Mode Selection

When you run the application, you'll be prompted to choose a mode:

╔══════════════════════════════════════╗
β•‘        PORT SCANNER TOOL         β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

  Select Mode:
    [1] Terminal Mode
    [2] Web UI Mode

  Enter your choice (1 or 2):

Terminal Mode

Perfect for quick scans and command-line enthusiasts

  1. Select option 1
  2. Enter target IP address or domain name:
    • IP: 192.168.1.1
    • Domain: google.com
    • URL: https://github.com
  3. Watch real-time scanning progress
  4. View results with scan duration

Example:

🎯 Enter target IP or website URL: google.com

⚑ Fast scanning ports on google.com...

  πŸ” Resolving google.com β†’ 142.250.185.46
  ⚑ Fast scanning 1024 ports...
  βœ“ Found open port: 80 (http)
  βœ“ Found open port: 443 (https)

╔══════════════════════════════════════════════════════════════╗
β•‘  Scan Complete! Found 2 open port(s)
β•‘  Scan Duration: 3.45 seconds
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Web UI Mode

Best for detailed analysis and visual experience

  1. Select option 2
  2. Open your browser and navigate to:
    • Local: http://127.0.0.1:5000/
    • Network: http://YOUR_LOCAL_IP:5000/
  3. Enter target IP or domain in the web form
  4. Click "πŸš€ Start Scanning"
  5. View beautifully formatted results

Features:

  • Responsive design (works on mobile!)
  • Gradient purple theme
  • Animated port results
  • Service and version information for each port
  • Total open ports summary
  • DNS resolution display

πŸ“Š Supported Input Formats

Format Example Description
IPv4 Address 192.168.1.1 Direct IP address
Domain Name google.com Will be resolved to IP
Subdomain mail.google.com Subdomains supported
Full URL https://github.com Protocol and path stripped automatically
Personal Domain soundharesh.me Any valid domain

πŸ”§ Configuration

Adjust Scanning Parameters

Edit portScanner_Web.py to customize:

Port Range:

ports_to_scan = range(1, 1025)  # Change to scan more/fewer ports

Thread Count:

with ThreadPoolExecutor(max_workers=100) as executor:  # Adjust worker count

Timeout:

sock.settimeout(0.2)  # Increase for slower networks

Web Server Port:

app.run(host="0.0.0.0", port=5000, debug=False)  # Change port number

πŸ“ Project Structure

python_tool/
β”œβ”€β”€ portScanner_Web.py          # Main application file
β”œβ”€β”€ templates/
β”‚   └── index.html              # Web UI template
└── README.md                   # This file

🎨 Web UI Screenshots

Main Interface:

  • Modern gradient background (purple to violet)
  • Clean input form with placeholder text
  • Info box showing scan mode details

Results Display:

  • Color-coded port items
  • Hover effects on port cards
  • Status badges for open ports
  • Summary card with total count

⚑ Performance

  • Sequential Scanning: ~8-10 minutes for 1024 ports
  • Multi-threaded Scanning: ~10-30 seconds for 1024 ports
  • Speed Improvement: ~50-100x faster!

πŸ›‘οΈ Legal & Ethical Considerations

⚠️ Important Notice:

This tool is designed for educational purposes and authorized security testing only.

You should only scan:

  • Your own systems and networks
  • Systems you have explicit written permission to test
  • Networks where you are the administrator

Unauthorized port scanning may be:

  • Illegal in your jurisdiction
  • Violation of computer fraud laws
  • Against terms of service of hosting providers

Use responsibly and ethically!

πŸ› Troubleshooting

Common Issues

Issue: "No module named 'flask'"

Solution: pip install flask

Issue: "No module named 'colorama'"

Solution: pip install colorama

Issue: Web UI not accessible from other devices

Solution: Check firewall settings and ensure port 5000 is open

Issue: Scanning is slow

Solution: Reduce port range or increase timeout value

Issue: DNS resolution fails

Solution: Check internet connection and DNS settings

πŸš€ Future Enhancements

  • Export results to CSV/JSON
  • Scan history and saved results
  • Custom port range selection in UI
  • OS detection
  • Vulnerability database integration
  • Multiple target scanning
  • Scheduled scans
  • Email notifications
  • API endpoint for automation

πŸ‘¨β€πŸ’» Developer

Developed by Eshwar

πŸ“„ License

This project is open source and available under the MIT License.

🀝 Contributing

Contributions, issues, and feature requests are welcome!

πŸ“ž Support

If you have any questions or need help, feel free to open an issue.


Happy Scanning! πŸ”βœ¨

About

A powerful and modern network security tool for scanning open ports on target IP addresses or domain names. Built with Python and Flask, featuring both a beautiful web interface and a terminal-based mode with fast multi-threaded scanning.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors