A fast and simple Rust-based port scanner inspired by Nmap for effortless network scanning.
author: Wiktor Zawadzki
github: https://github.com/wiktoz/rmap
- Multithreaded scanning for high performance and speed
- Supports multiple scan strategies
- Parses and scans various IP ranges and formats (single IPs, CIDR blocks, ranges)
In order to build a library use a script based on OS.
Windows
.\run\win.ps1
python ./python/test.pyUNIX
chmod +x ./run/linux.sh
source ./run/linux.sh
python ./python/test.pySimple file presenting library usage you can start using:
python ./python.test.pyrmap.scan(ip_range: str, scan_type: Optional[str] = "T", ports: Optional[List[int]] = [22, 80, 443 ...], threads: Optional[int] = 256) -> ScanResultsArguments
-
ip_range: The IP range to scan, supports single IPs, CIDR notation, or ranges (e.g. "192.168.1.0/24", "10.0.0.1-10.0.0.255").
-
scan_type: (Optional) Specify scan strategy. Possible scan strategies:
T- TCP Connect,U- UDP Scan.
-
ports: (Optional) List of ports to scan. Defaults to common ports if not specified.
-
threads: (Optional) Number of worker threads to use. Defaults to 256.
Return value
- ScanResults object.
ScanResults
-
.results— dict mapping IP string to list of PortScanResult -
.active_hosts— number of hosts with at least one open port -
.scanned_hosts— total number of hosts scanned -
.duration_secs— scan duration in seconds -
.ips()— method returning list of scanned IPs as strings
PortScanResult
-
.port— port number (int) -
.state— port state (PortStatus) — e.g. Open, Closed, Filtered -
.service— recognized service name (str), or "Unknown"
PortStatus
Enum of possible port states:
-
Open -
Closed -
Filtered -
Unknown