A fast, cross-platform local network scanner written in TypeScript for Deno.
It discovers all active devices on your LAN by leveraging ARP, ICMP pings, and MAC address vendor lookups.
The scanner enriches device information with vendor names (from the official IEEE OUI database) and attempts to resolve device names using multiple protocols.
- Discovers all devices on your local subnet (using ARP and ICMP ping)
- Vendor identification via MAC address OUI (using a local
ouis.json
database) - Attempts device name resolution (NetBIOS, mDNS/Bonjour, UPnP, reverse DNS, DHCP leases)
- Works on Windows, Linux, and macOS
- Batch scanning for speed
- Thorough logging and pretty output
- Well-documented, type-safe code
-
Install Deno:
https://deno.com/manual/getting_started/installation -
Clone or download this repository.
-
Download the OUI database:
# Change to the data directory (dont forget /data at the end)
cd /path/to/your/repo/data
# Download the latest OUI database
curl -o ouis.json https://raw.githubusercontent.com/jfisbein/ouidb-json/master/ouidb.json
- Install the dependencies:
deno install
- Run the scanner:
deno run --watch --v8-flags="--max-old-space-size=4096" --allow-net --allow-run --allow-sys --allow-read src/main.ts
Or, if you use Deno tasks:
deno task dev
- On Windows, run your terminal as administrator for best results.
You can filter by interface name and set ping timeout:
import { NetworkScanner } from "./network-scanner.ts";
const devices = await NetworkScanner.scan({
interfaceFilter: "Ethernet", // Optional: only scan this interface
pingTimeout: 100, // Optional: ms per ping
});
devices.forEach(device => {
console.log(
[${device.interface.padEnd(9)}] ${device.ip.padEnd(15)} - ${device.mac.padEnd(17)} (${(device.vendor || "Unknown").padEnd(30)}) [${(device.name || "Unknown").padEnd(25)}]
);
});
Automated tests are provided using Deno’s built-in test runner.
To run all tests, use:
deno test --allow-read --allow-write --allow-net --allow-sys --allow-run
Or, if you use Deno tasks:
deno task test
-
Subnet Discovery:
The scanner determines your local subnet(s) using Deno’s network interface API. -
ICMP Ping Sweep:
It pings every possible host in the subnet to populate your OS’s ARP cache. -
ARP Table Parsing:
It reads the system ARP table (arp -a
) to find all responding devices and their MAC addresses. -
Vendor Lookup:
The scanner matches the MAC OUI (first 6 hex digits) against the localouis.json
database to identify the manufacturer. -
Device Name Resolution:
It attempts to resolve a human-friendly device name using:- NetBIOS (Windows)
- mDNS/Bonjour (Apple/Linux)
- UPnP (smart devices)
- Reverse DNS
- DHCP leases (Linux)
-
Output:
Results are logged in a neat, column-aligned table for easy reading.
-
src/network-scanner.ts
Main scanner logic with detailed JSDoc comments for all classes and methods. -
src/main.ts
Example usage and pretty output formatting. -
data/ouis.json
OUI vendor database. Download the latest from the official source.
-
No devices found?
- Run as administrator (especially on Windows)
- Ensure your firewall allows ICMP (ping) and ARP
- Make sure you have the correct interface name (see Deno.networkInterfaces())
-
Some devices show "Unknown" for vendor or name?
- The OUI database may not have every vendor (but covers 99%+ of consumer hardware)
- Many IoT devices do not advertise a name
MIT
Happy scanning!