A network scanner written in Praia that discovers hosts, NetBIOS names, MAC addresses, and reverse DNS hostnames on a local network. Requires Praia >= 0.4.5.
Requires Praia and the arp grain.
git clone https://github.com/praia-lang/prscan.git
cd prscan
sand install
chmod +x prscan./prscan <target> [options]./prscan 192.168.1.1 # single host
./prscan 192.168.1.1-50 # range (short form)
./prscan 192.168.1.1-192.168.1.50 # range (full form)
./prscan 192.168.1.0/24 # CIDR notation| Flag | Description |
|---|---|
-t, --timeout <ms> |
Timeout per host in milliseconds (default: 1500) |
-v, --verbose |
Show all hosts including down ones |
-q, --quiet |
Only print IP and hostname (for scripting) |
-o, --output <file> |
Save results to file (.json, .csv, or .txt) |
--no-progress |
Hide the progress bar |
Scan a subnet with a shorter timeout:
./prscan 192.168.1.0/24 -t 1000Export results as JSON:
./prscan 10.0.0.0/24 -o results.jsonExport as CSV for spreadsheets:
./prscan 192.168.1.0/24 -o hosts.csvQuiet mode for piping to other tools:
./prscan 192.168.1.0/24 -q | grep "server"For each IP in the target range, prscan:
- NetBIOS NBSTAT query (UDP 137) — retrieves the hostname, domain/workgroup, and MAC address from Windows/Samba hosts
- Reverse DNS — falls back to
hostordig -xfor hosts without NetBIOS - ARP lookup — pings the host then reads the ARP table to get the MAC address
Ctrl+C gracefully stops the scan and prints a summary of results so far.
prscan can also be used as a Praia grain in your own scripts:
sand install github.com/praia-lang/prscanuse "prscan"
// Scan a range
let results = prscan.scan("192.168.1.0/24", {timeout: 1000})
for (r in results) {
if (r.status == "up") {
print(r.ip + " " + r.hostname + " " + r.mac)
}
}
// Scan a single host
let host = prscan.scanHost("192.168.1.1", 1500)
if (host.status == "up") {
print(host.hostname)
}
Each result is a map with: ip, hostname, domain, mac, status ("up" or "down").
Works on macOS and Linux. Platform differences are handled automatically:
- ARP: uses
arp -aon macOS,/proc/net/arporip neighon Linux - Ping timeout:
-W 1000(ms) on macOS,-W 1(s) on Linux - Reverse DNS: tries
host, falls back todig
MIT