CLI Reference

Complete command-line reference for all NetScan options, flags, and arguments.

Synopsis

netscan [OPTIONS] [COMMAND]

Commands:
  (none)          Start interactive menu
  -l, --lookup    MAC address lookup
  -s, --scan      Quick network scan
  -f, --full      Full scan with ports
  -m, --monitor   Network monitoring
  -w, --web       Start web interface
  -b, --batch     Batch MAC lookup

Options:
  -t, --target    Target network/IP
  -i, --interface Network interface
  -o, --output    Output file
  -p, --port      Web server port
  --json          JSON output
  --csv           CSV output
  -v, --verbose   Verbose output
  -q, --quiet     Quiet mode
  -h, --help      Show help
  --version       Show version

Commands

-l, --lookup <MAC>

Look up vendor information for a MAC address.

# Basic lookup
netscan -l 00:50:56:C0:00:08
netscan --lookup 00:50:56:C0:00:08

# Different formats accepted
netscan -l 00-50-56-C0-00-08
netscan -l 005056C00008

# JSON output
netscan -l 00:50:56:C0:00:08 --json

Output:

MAC Address: 00:50:56:C0:00:08
Vendor: VMware, Inc.
OUI: 00:50:56

-s, --scan

Perform a quick network scan using ARP and ping.

# Auto-detect network
netscan -s

# Specific target
netscan -s -t 192.168.1.0/24

# Specific interface
netscan -s -i en0

# With JSON output
netscan -s --json

# Export to file
netscan -s -o results.json

-f, --full

Perform a full network scan including port detection.

# Full scan (all common ports)
netscan -f

# Full scan with specific target
netscan -f -t 10.0.0.0/24

# Export detailed report
netscan -f --report scan_report.html

-m, --monitor

Start continuous network monitoring.

# Start monitoring
netscan -m

# With desktop notifications
netscan -m --notify

# Custom scan interval (seconds)
netscan -m --interval 30

# Log to file
netscan -m --log monitor.log

-w, --web

Start the web interface.

# Default port 8080
netscan -w

# Custom port
netscan -w -p 9000
netscan --web --port 9000

# Bind to specific address
netscan -w --bind 0.0.0.0

-b, --batch <FILE>

Batch lookup of MAC addresses from a file.

# Lookup from file (one MAC per line)
netscan -b macs.txt

# With output file
netscan -b macs.txt -o results.json

Input file format:

00:50:56:C0:00:08
AC:DE:48:00:11:22
B8:27:EB:12:34:56

Options

-t, --target <TARGET>

Specify the target network or IP address.

Format Example Description
CIDR 192.168.1.0/24 Subnet in CIDR notation
Range 192.168.1.1-50 IP range
Single IP 192.168.1.100 Single host
Hostname router.local Hostname (resolved)

-i, --interface <IFACE>

Specify the network interface to use.

# macOS
netscan -s -i en0

# Linux
netscan -s -i eth0
netscan -s -i wlan0

-o, --output <FILE>

Save output to a file. Format is auto-detected from extension.

netscan -s -o results.json    # JSON format
netscan -s -o results.csv     # CSV format
netscan -s -o results.xml     # XML format
netscan -s -o results.txt     # Plain text

-p, --port <PORT>

Specify port for web interface (default: 8080).

netscan -w -p 3000

--json

Output results in JSON format.

netscan -s --json | jq '.devices[]'

--csv

Output results in CSV format.

netscan -s --csv > devices.csv

-v, --verbose

Enable verbose output with detailed progress.

netscan -s -v

-q, --quiet

Suppress all output except results.

netscan -s -q

-h, --help

Show help message and exit.

netscan --help
netscan -s --help   # Help for scan command

--version

Show version information.

netscan --version

Advanced Options

--timeout <SECONDS>

Set network timeout (default: 5 seconds).

netscan -s --timeout 10

--threads <NUM>

Number of concurrent scan threads (default: auto).

netscan -s --threads 50

--ports <PORTS>

Specify ports for full scan.

# Specific ports
netscan -f --ports 22,80,443,8080

# Port range
netscan -f --ports 1-1000

# Common ports (default)
netscan -f --ports common

--report <FILE>

Generate HTML report.

netscan -f --report network_audit.html

--update-oui

Download and update OUI database.

netscan --update-oui

--vendor <NAME>

Search for devices by vendor name.

netscan --vendor Apple
netscan --vendor "Raspberry Pi"

--no-cache

Disable lookup cache.

netscan -l 00:50:56:C0:00:08 --no-cache

Environment Variables

Variable Default Description
NETSCAN_HOME ~/.netscan NetScan home directory
NETSCAN_LOG_LEVEL INFO Log level (DEBUG, INFO, WARN, ERROR)
NETSCAN_CACHE_TTL 3600 Cache TTL in seconds
NETSCAN_TIMEOUT 5 Default network timeout
NETSCAN_THREADS auto Number of scan threads
NETSCAN_OUI_URL (IEEE) Custom OUI database URL
# Set environment variable
export NETSCAN_LOG_LEVEL=DEBUG
netscan -s

# Or inline
NETSCAN_TIMEOUT=10 netscan -s

Exit Codes

Code Description
0 Success
1 General error
2 Invalid arguments
3 Network error
4 Permission denied
5 File not found
# Check exit code
netscan -l 00:50:56:C0:00:08
echo $?  # 0 = success

Examples

MAC Lookup

# Single lookup
netscan -l 00:50:56:C0:00:08

# Batch lookup
netscan -b mac_list.txt -o results.json

# Search by vendor
netscan --vendor Apple

Network Scanning

# Quick scan local network
netscan -s

# Full scan specific subnet
netscan -f -t 10.0.0.0/24

# Scan and export
netscan -s -o scan_$(date +%Y%m%d).json

# Scan specific ports
netscan -f --ports 22,80,443,3389 -t 192.168.1.0/24

Monitoring

# Monitor with notifications
netscan -m --notify

# Log new devices
netscan -m --log /var/log/netscan.log

# Fast polling (every 15 seconds)
netscan -m --interval 15

Scripting

# JSON pipeline
netscan -s --json | jq '.devices[] | select(.vendor | contains("Apple"))'

# Count devices
netscan -s --json | jq '.devices | length'

# Get just IPs
netscan -s --json | jq -r '.devices[].ip'

# CSV for spreadsheet
netscan -s --csv > network_inventory.csv