A minimal port scanner inspired by nmap, written in Python.
- 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
- Top 100 ports (
- Python 3
- Scapy
Clone the repository:
git clone https://github.com/losthread/pscan.git
cd pscanCreate a virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # WindowsInstall the dependencies:
pip install -r requirements.txt
pip install -e .Note: SYN and ACK scans require root/administrator privileges because they use raw packets.
Scan the top 1000 ports:
pscan <target>Scan specific ports:
pscan <target> -p 22,80,443Scan a port range:
pscan <target> -p 1-1024Scan all ports:
pscan <target> -aVerbose output: (shows all ports regardless of being open or closed or filtered)
pscan <target> -vFast mode (top 100 ports):
pscan <target> -FTCP SYN scan: (target device's firewall is less likely to log your IP)
sudo pscan <target> -sSUDP scan: (sends UDP packets)
pscan <target> -sUTCP ACK scan: (detects firewall by sending tcp ack)
sudo pscan <target> -sABanner grabbing: (tells about the service running on that port if any)
pscan <target> -APerforms a full TCP three-way handshake using Python sockets.
Performs a half-open scan by sending a SYN packet and analyzing the response without establishing a full TCP connection.
Sends an empty UDP datagram. A UDP reply indicates an open port, while no response is reported as OPEN|FILTERED.
Sends an ACK packet to determine whether a firewall is filtering the port. Reports UNFILTERED or FILTERED.
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.