REST API controlled network scanner - Lightweight, fast, built for edge devices
1.0K
Fast, lightweight network scanner with REST API. Automatically discovers devices on your network using intelligent hybrid scanning: ARP for physical networks, Nmap for VPN/tunnels.
docker run -d \
--name network-scanner \
--network host \
--cap-add NET_ADMIN \
--cap-add NET_RAW \
-e API_PORT=8080 \
c0de1ndex/netscan:latest
Test it:
curl -X POST http://localhost:8080/scan/network
curl http://localhost:8080/scan/results
services:
network-scanner:
image: c0de1ndex/netscan:latest
container_name: netscan
network_mode: host
cap_add:
- NET_ADMIN
- NET_RAW
restart: unless-stopped
environment:
- API_PORT=8080
- SCAN_COOLDOWN_SECONDS=10
| Endpoint | Method | Description |
|---|---|---|
/health | GET | Health check |
/interfaces | GET | List network interfaces |
/scan/status | GET | Current scan status |
/scan/results | GET | Latest scan results |
/scan/network | POST | Trigger scan |
| Variable | Default | Description |
|---|---|---|
API_PORT | 8080 | API server port |
LOG_LEVEL | INFO | Logging level (DEBUG, INFO, WARNING, ERROR) |
SCAN_COOLDOWN_SECONDS | 10 | Minimum time between scans |
INCLUDE_INTERFACES_ONLY | (empty) | Comma-separated list of interfaces to scan |
SKIP_DOCKER_RANGES | true | Skip Docker IP ranges (172.17.0.0/12) |
# Health check
curl http://localhost:8080/health
# List discovered interfaces
curl http://localhost:8080/interfaces
# Start scan
curl -X POST http://localhost:8080/scan/network
# Check scan progress
curl http://localhost:8080/scan/status
# Get results
curl http://localhost:8080/scan/results | jq
The scanner intelligently selects the best tool for each interface type:
Physical Networks (eth0, wlan0, en0):
VPN/Tunnel Networks (wg0, tun0, tap0):
The scanner needs direct access to host network interfaces for ARP scanning. This requires:
--network host - Access physical network interfaces--cap-add NET_ADMIN - Network administration capabilities--cap-add NET_RAW - Raw socket access for ARPlinux/amd64linux/arm64Automatically excludes:
docker0, br-*, veth*)virbr*, vmnet*, vboxnet*)lo)Automatically includes and scans:
eth*, wlan*, en*) - scanned with arp-scanwg*, tun*, tap*) - scanned with nmapScan specific interfaces only:
docker run -d \
--network host \
--cap-add NET_ADMIN \
--cap-add NET_RAW \
-e INCLUDE_INTERFACES_ONLY=eth0,wlan0,wg0 \
c0de1ndex/netscan:latest
{
"status": "success",
"data": {
"interfaces": {
"eth0": {
"name": "eth0",
"ipv4": [{"ip": "192.168.1.100", "network": "192.168.1.0/24"}],
"mac": "aa:bb:cc:dd:ee:ff"
}
},
"arp_scan": {
"192.168.1.0/24": {
"interface": "eth0",
"arp_scan": [
{
"ip": "192.168.1.1",
"mac": "00:11:22:33:44:55",
"vendor": "TP-Link Corporation Limited"
},
{
"ip": "192.168.1.10",
"mac": "aa:bb:cc:dd:ee:ff",
"vendor": "Dell Inc."
}
],
"nmap_scan": [],
"timestamp": "2026-01-09T15:30:00Z"
}
},
"last_scan": "2026-01-09T15:30:00Z",
"scan_duration": 5.2
}
}
No hosts found on VPN interface:
Missing MAC addresses on some hosts:
No built-in authentication - Intended for trusted networks.
For production:
Content type
Image
Digest
sha256:5a714772e…
Size
11.7 MB
Last updated
8 months ago
docker pull c0de1ndex/netscan