Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ ZScan — Air-gap Safe Network Scanner v2.2.0

Full NSE-suite network scanner — 58 embedded scripts, zero installs, works completely offline


Changelog

v2.2.0

Area Improvement
Targets -iL FILE (Python) / -TargetFile, alias -iL (PowerShell) — scan a list of targets read one per line from a file, or from stdin with -iL -
Targets Target specs from the command line and the list file are merged and de-duplicated, so an overlapping CIDR and file never scan a host twice
Help -h / --help (Python) and -h / -Help (PowerShell) print full usage: every flag, the target forms, and examples. Running with no arguments prints the same help instead of a bare usage error
Help Get-Help .\zscan.ps1 -Full now works — the comment-based help block was never reachable, because Get-Help needs a blank line between it and #Requires/the script body
Help -V / --version (Python) prints the version and exits
Fix PowerShell: a ping sweep listed live hosts on the console but wrote "hosts": [] to every -Output* file — the sweep's early exit skipped recording them
Fix PowerShell: CSV and HTML reports skipped any live host with no open ports
Fix PowerShell: -ScanType Ping now reports how a host answered (icmp, tcp/445) instead of a bare up
Fix PowerShell: the script would not parse at all under Windows PowerShell 5.1 — a UTF-8 em dash read through the ANSI codepage closed a string early and cascaded into 50 bogus syntax errors. The file is now pure ASCII, and .gitattributes records why it must stay that way
Fix PowerShell: every CIDR target silently expanded to zero hosts ([uint32]0xFFFFFFFF overflows in 5.1, and the error was swallowed). /23 → 510 hosts again; /32 and /31 now expand per RFC 3021, and a bad prefix warns
Docs README script counts corrected, and four scripts that do not exist were dropped from the list

v2.1.0

Area Improvement
HTTP http-methods — OPTIONS-based risky method detection (PUT/DELETE/PATCH etc.)
HTTP http-webdav-scan — PROPFIND/MKCOL/LOCK/UNLOCK exposure with server date
HTTP http-open-proxy — CONNECT method detection
HTTP http-trace — TRACE XST vulnerability check
HTTP Non-standard ports now get full HTTP script suite (e.g. 33033, 45332, 45443)
SSL Cert check now uses raw SslStream — works on any port (e.g. 44330)
SSL Protocol version reported — TLS 1.0 / SSL3 flagged as weak
Service Banner-based name upgrade — unknown ports now show http/ftp/ssh etc.
Banner TLS handshake fallback probe for non-standard SSL ports
Banner HTTP GET probe sent on all non-raw-service ports
FTP Directory listing grouped into a single result (cleaner nmap-style output)

v2.0.0

Area Improvement
FTP Full anonymous login + PASV directory listing (mirrors nmap ftp-anon)
FTP SYST command, bounce check, vsftpd 2.3.4 backdoor (CVE-2011-2523)
FTP Non-standard port detection via banner (30021, 2121, etc.)
SSH Hostkey + SSHv1 weak version detection
SMB Improved EternalBlue / DoublePulsar detection
DNS Recursion check + zone transfer (AXFR) probe
SNMP Community string brute (public / private / community / manager / admin)
NTP Server info + monlist DDoS amplification check (CVE-2013-5211)
Rsync Unauthenticated module listing
Docker Unauthenticated remote API exposure check
Kubernetes API server + Kubelet unauthenticated access check
Modbus ICS/SCADA device exposure (port 502)
Output Vuln summary count in terminal output

Two versions, one tool

zscan.py zscan.ps1
Platform Linux + Windows Windows only
Requires Python 3.6+ (stdlib only) PowerShell 5.1+ (built-in on Win10+)
Install Nothing Nothing
SYN/FIN/NULL/XMAS scan ✅ root ❌ no raw sockets in PS
TCP Connect scan ✅ ✅
UDP scan ✅ root ✅ limited
Version detection ✅ ✅
OS detection (TTL) ✅ ✅
Embedded scripts ✅ 58 scripts ✅ 48 scripts
Output formats Terminal / JSON / XML / Grepable Terminal / JSON / HTML / CSV
Air-gap safe ✅ stdlib only ✅ .NET built-in only

Quick Start

Python — Linux / Windows

# Basic top-1000 scan
python3 zscan.py 192.168.1.1

# Ping sweep
python3 zscan.py 192.168.1.0/24 -sn -T4

# Version + default scripts
python3 zscan.py 192.168.1.1 -sT -sV --script default

# Non-standard ports — full service detection + all scripts
python3 zscan.py 192.168.1.1 -p 30021,33033,44330,45332 --script all -sV

# Full SYN + OS detection + all scripts
sudo python3 zscan.py 10.0.0.1 -sS -p 1-1024 -O --script all

# All 65535 ports + JSON output
sudo python3 zscan.py 10.0.0.1 -sS -p - --script all -oJ results.json

# Targets from a file, one per line
python3 zscan.py -iL hosts.txt -p 22,80,443 -sV

# Targets piped in on stdin
cat hosts.txt | python3 zscan.py -iL - -sn

# Full help: every flag, the target forms, examples
python3 zscan.py -h

PowerShell — Windows

# Basic scan
.\zscan.ps1 -Target 192.168.1.1

# Ping sweep
.\zscan.ps1 -Target 192.168.1.0/24 -ScanType Ping

# Non-standard ports — full scripts
.\zscan.ps1 -Target 192.168.1.1 -Ports "30021,33033,44330" -ServiceDetection -Scripts all

# Full scan with HTML report
.\zscan.ps1 -Target 10.0.0.1 -Ports "1-1024" -ServiceDetection -OSDetect -Scripts all -OutputHTML report.html

# All ports + JSON + CSV
.\zscan.ps1 -Target 10.0.0.0/24 -T 4 -Scripts all -OutputJSON scan.json -OutputCSV scan.csv

# Targets from a file, one per line
.\zscan.ps1 -iL hosts.txt -Ports "22,80,443" -ServiceDetection

# Targets piped in on stdin
Get-Content hosts.txt | .\zscan.ps1 -iL - -ScanType Ping

# Full help: every flag, the target forms, examples
.\zscan.ps1 -h

Target Specification

Form Example
Single IP 192.168.1.1
CIDR block 192.168.1.0/24
Last-octet range 192.168.1.1-20
Hostname host.example.lan (resolved with the local resolver)
Comma-separated list 192.168.1.1,10.0.0.0/30,host.example.lan
List from a file -iL hosts.txt (Python) · -iL hosts.txt / -TargetFile hosts.txt (PowerShell)
List from stdin -iL -

A list file holds one target per line — any of the forms above. Blank lines and everything after a # are ignored, and a line may still hold several specs separated by spaces or commas:

# perimeter
10.0.0.1          # gateway
10.0.0.16/28
192.168.1.1-20
host.example.lan

A command-line target and -iL can be combined; the two lists are merged and de-duplicated, and the banner and output files name the list source instead of echoing every host.


Scan Types

Python

Flag Type Root?
-sS TCP SYN (fast, stealthy) ✅
-sT TCP Connect (default) ❌
-sU UDP scan ✅
-sF FIN scan ✅
-sN NULL scan ✅
-sX XMAS scan ✅
-sn Ping sweep only ❌

PowerShell

-ScanType TCP (default) · -ScanType UDP · -ScanType Ping


Timing Templates

Level Workers Timeout Use case
-T0 paranoid 10 5s Maximum stealth
-T1 sneaky 50 3s IDS evasion
-T2 polite 100 2s Low bandwidth
-T3 normal 300 1.5s Default
-T4 aggressive 500 0.75s Fast LAN
-T5 insane 1000 0.3s Maximum speed

Embedded Scripts

Generic

Script Notes
banner First line of the service banner, on every port that returns one

FTP

Script Notes
ftp-anon Anonymous login + full PASV directory listing — works on any port via banner
ftp-syst OS fingerprint via SYST command
ftp-bounce PORT-command bounce test
ftp-vsftpd-backdoor vsftpd 2.3.4 backdoor — CVE-2011-2523

HTTP / HTTPS

Script Notes
http-title Page title
http-server-header Server header fingerprint
http-methods OPTIONS-based method detection — flags PUT/DELETE/PATCH/TRACE/WebDAV as risky
http-webdav-scan WebDAV exposure — PROPFIND/MKCOL/LOCK/UNLOCK with server date
http-open-proxy CONNECT method → open proxy
http-trace TRACE method → XST vulnerability
http-security-headers Missing CSP / HSTS / X-Frame-Options etc.
http-cors Wildcard CORS misconfiguration
http-waf-detect Cloudflare / AWS WAF / ModSecurity / F5 detection
http-auth 401 auth type fingerprint
http-robots.txt Disallowed paths
http-git Exposed .git/HEAD
http-passwd Directory traversal → /etc/passwd
http-shellshock CVE-2014-6271
http-internal-ip-disclosure Private IP leaked in HTTP response
http-php-version PHP version from X-Powered-By
http-generator Framework / version info headers
http-spring-boot-actuator Spring Boot /actuator exposure
http-wordpress-users WordPress user enumeration via REST API
http-enum Common sensitive path brute (admin / phpmyadmin / .env etc.)

SMB / NetBIOS

Script Notes
smb-protocols SMBv1 detection
smb-vuln-ms17-010 EternalBlue / WannaCry — CVE-2017-0144

SSH / SMTP

Script Notes
ssh-hostkey Banner + key fingerprint
ssh-auth-methods Accepted authentication methods
ssh-weak-version SSHv1 detection — CVE-2001-0553
smtp-commands EHLO capability list
smtp-open-relay Unauthenticated relay test
smtp-enum-users VRFY user enumeration

Database Services

Script Notes
mysql-info Version fingerprint from handshake
pgsql-empty-password Passwordless auth check
redis-info Unauthenticated access + version
mongodb-info Unauthenticated isMaster probe
elasticsearch-info Unauthenticated access + version
memcached-info Unauthenticated stats + version

Network Services

Script Notes
dns-recursion Open resolver check
dns-zone-transfer AXFR probe via TCP
ntp-info Version + stratum + timestamp
ntp-monlist DDoS amplification — CVE-2013-5211
snmp-info Community string brute (5 common strings)
ldap-rootdse Anonymous bind check
rsync-list-modules Unauthenticated module listing
telnet-ntlm-info Cleartext protocol banner
imap-capabilities CAPABILITY response
pop3-capabilities CAPA response

SSL / TLS

Script Notes
ssl-cert Subject / org / expiry / days remaining — works on any port
ssl-enum-ciphers Protocol version — TLS 1.0 / SSL3 flagged as weak

Remote Access

Script Notes
rdp-enum-encryption NLA / CredSSP enforcement check
vnc-info Protocol version banner
realvnc-auth-bypass Old RFB protocol auth bypass — CVE-2006-2369

ICS / SCADA

Script Notes
modbus-discover Port 502 Modbus device response — ICS/SCADA exposure

Infrastructure / DevOps

Script Notes
docker-version Unauthenticated Docker API (port 2375/2376)
kubernetes-api Unauthenticated K8s API server
kubernetes-kubelet Unauthenticated Kubelet (port 10250)

Output Formats

Python

-oJ output.json      JSON
-oX output.xml       XML (nmap-compatible style)
-oG output.gnmap     Grepable

PowerShell

-OutputJSON r.json
-OutputHTML r.html   Dark themed dashboard
-OutputCSV  r.csv

Help

python3 zscan.py -h          # full usage: flags, target forms, examples
python3 zscan.py --help
python3 zscan.py             # no arguments prints the same help
python3 zscan.py -V          # version
.\zscan.ps1 -h              # full usage: flags, target forms, examples
.\zscan.ps1 -Help
.\zscan.ps1                 # no arguments prints the same help
Get-Help .\zscan.ps1 -Full  # comment-based help, PowerShell style

Air-Gap Guarantee

Check Python PowerShell
External imports ✅ stdlib only ✅ System.Net only
Package manager calls ✅ None ✅ None
Auto-downloads ✅ None ✅ None
Outbound connections ✅ Only to your targets ✅ Only to your targets

Copy a single file to the target. Run. Done.


Install

# Linux — run from anywhere
sudo cp zscan.py /usr/local/bin/zscan
sudo chmod +x /usr/local/bin/zscan
zscan 192.168.1.1 --script all
# Windows — allow local scripts then run
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
.\zscan.ps1 -Target 192.168.1.1 -Scripts all

For authorised security testing only. Only scan systems you own or have explicit written permission to test.

MIT License

About

Single-file network scanner — 58 NSE-equivalent scripts, air-gap safe. TCP/SYN/UDP/FIN/NULL/XMAS scans, OS detection, version fingerprinting. Pure Python (Linux/Windows) + Pure PowerShell (Windows). Zero installs, works offline. JSON/XML/HTML output.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages