Skip to content

dimxz/PortScan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Simple Python Port Scanner

A fast, threaded command-line port scanner written in Python.


Disclaimer

This tool is for educational purposes only. Only use it on networks and systems you own or have explicit written permission to scan. Unauthorized port scanning may be illegal in your jurisdiction and can violate terms of service. The author accepts no responsibility for any misuse of this tool.


Requirements

  • Python 3.10 or higher

Installation

  1. Clone or download this repository.
  2. Navigate into the port_scanner directory:
cd port_scanner
  1. (Recommended) Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate   # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

Run the scanner with:

python scanner.py

You will be prompted to enter:

Prompt Example
Target IP address 192.168.1.1
Number of threads 100
Port range 1-1024

After the scan completes, a clean table of all open ports and their associated services is printed.

Example session

==================================================
                  PortScan
==================================================

Enter target IP address: 192.168.1.1
Enter number of threads (1-500): 100
Enter port range (e.g. 1-1024): 1-1024

Scanning 192.168.1.1  ports 1-1024  (1024 ports)  threads: 100
--------------------------------------------------

Found 3 open port(s):

  PORT       SERVICE
  ---------- --------------------
  22         ssh
  80         http
  443        https

Scan complete.

Tips

  • More threads = faster scan, but very high counts can flood the target or trigger firewalls. 100–200 is a good balance for most local networks.
  • The scan uses a 0.5 second connection timeout per port. Decrease it in scanner.py (timeout variable in main()) for faster scans on reliable networks, or increase it for slow or remote targets.
  • To scan all ports, use the range 1-65535.

About

Simple and fast port scanner built in Python

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages