Skip to content

losthread/pscan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pscan

A minimal port scanner inspired by nmap, written in Python.

Features

  • TCP Connect scan
  • TCP SYN (half-open) scan
  • UDP scan
  • TCP ACK scan
  • Banner grabbing (-A)
  • Scan:
    • Top 100 ports (-F)
    • Top 1000 ports (default)
    • Custom ports
    • Port ranges
    • All 65535 ports

Requirements

  • Python 3
  • Scapy

Installation

Clone the repository:

git clone https://github.com/losthread/pscan.git
cd pscan

Create a virtual environment (recommended):

python3 -m venv venv
source venv/bin/activate      # Linux/macOS
# venv\Scripts\activate       # Windows

Install the dependencies:

pip install -r requirements.txt
pip install -e .

Note: SYN and ACK scans require root/administrator privileges because they use raw packets.

Usage

Scan the top 1000 ports:

pscan <target>

Scan specific ports:

pscan <target> -p 22,80,443

Scan a port range:

pscan <target> -p 1-1024

Scan all ports:

pscan <target> -a

Verbose output: (shows all ports regardless of being open or closed or filtered)

pscan <target> -v

Fast mode (top 100 ports):

pscan <target> -F

TCP SYN scan: (target device's firewall is less likely to log your IP)

sudo pscan <target> -sS

UDP scan: (sends UDP packets)

pscan <target> -sU

TCP ACK scan: (detects firewall by sending tcp ack)

sudo pscan <target> -sA

Banner grabbing: (tells about the service running on that port if any)

pscan <target> -A

Scan Types

TCP Connect

Performs a full TCP three-way handshake using Python sockets.

TCP SYN

Performs a half-open scan by sending a SYN packet and analyzing the response without establishing a full TCP connection.

UDP

Sends an empty UDP datagram. A UDP reply indicates an open port, while no response is reported as OPEN|FILTERED.

TCP ACK

Sends an ACK packet to determine whether a firewall is filtering the port. Reports UNFILTERED or FILTERED.

Disclaimer

Disclaimer: Use this tool only on systems you own or are explicitly authorized to test. The author is not responsible for any misuse or damage caused by this software.

About

A network administration tool to scan ports like nmap

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages