Network Audit & Diagnostics Toolkit
A practical CLI for network discovery, diagnostics and infrastructure visibility.
Features • Installation • Quick Start • Network Discovery • Commands • Development
NetAudit is a command-line network auditing and diagnostics toolkit written in Python.
It is designed for network engineers, system administrators, infrastructure engineers, cybersecurity students, IT support engineers and developers working with network infrastructure.
NetAudit provides practical network visibility directly from the terminal.
It can discover hosts, identify MAC addresses and vendors, resolve hostnames, inspect ports, test connectivity, query DNS, trace routes, inspect local interfaces, communicate with supported network devices and generate reports.
The project follows a simple principle:
Report what was actually observed. Never fabricate network information.
- CIDR network scanning
- Concurrent host discovery
- ICMP reachability detection
- Latency measurement
- MAC address discovery
- ARP table integration
- macOS
arpintegration - Linux neighbor-table integration
- Optional Scapy ARP fallback
- MAC address normalization
- Vendor identification
- OUI-based vendor fallback
manufdatabase vendor lookup- Reverse DNS hostname resolution
/etc/hostshostname resolution- macOS SMB / NetBIOS hostname discovery
- macOS Bonjour / mDNS support
- TCP service discovery
- Optional port scanning during network discovery
- ICMP ping
- Packet loss
- Latency
- TTL information
- Best-effort OS family hints
- DNS lookups
- Reverse DNS
- Route tracing
- Local interface inspection
- TCP port scanning
- HTTP/HTTPS checks
- Network health diagnostics
- Cisco IOS / IOS-XE
- Cisco NX-OS
- Cisco IOS-XR
- Juniper Junos
- Arista EOS
- Generic network devices
- SSH connectivity through Netmiko
- Read-only device commands
- Device snapshots
- Snapshot comparison
- Human-readable terminal tables
- JSON
- CSV
- Markdown
- HTML reports
- Pytest test suite
- Ruff linting
- Mypy support
- GitHub Actions
- Modular scanner architecture
The main network discovery command is:
netaudit scan 192.168.1.0/24The scanner combines several mechanisms rather than depending on one protocol.
A typical result can contain:
IP STATUS LATENCY HOSTNAME MAC VENDOR
10.0.0.1 UP 5.2 ms router 00:11:22:33:44:55 ExampleVendor
10.0.0.20 UP 0.8 ms workstation AA:BB:CC:DD:EE:FF Apple
10.0.0.30 UP 0.7 ms — 12:34:56:78:9A:BC —
The values above are synthetic examples and do not represent a real network.
Not every device will expose every field.
For example, a device may:
- respond to ICMP but not expose a hostname;
- have a MAC address but no recognizable vendor;
- expose a hostname through SMB but not reverse DNS;
- block ICMP while still exposing TCP services.
NetAudit keeps these results separate instead of treating missing information as failure.
On macOS, NetAudit first uses the system ARP table.
For example:
arp -anEntries such as:
? (10.0.0.1) at 00:11:22:33:44:55 on en0
are normalized to:
00:11:22:33:44:55
This is important because macOS may display some hexadecimal MAC octets using a single digit.
Scapy is available as a fallback for environments where raw ARP access is possible.
Raw packet access may require elevated privileges depending on the operating system.
NetAudit uses multiple methods to identify the manufacturer of a MAC address.
The preferred lookup uses the manuf database when available.
Example:
00:11:22:33:44:55 -> ExampleVendor
AA:BB:CC:DD:EE:FF -> ExampleVendor
12:34:56:78:9A:BC -> ExampleVendor
A built-in OUI fallback is also available for common vendors.
Vendor detection is best-effort.
A result of:
VENDOR: —
does not mean that the MAC address is invalid. It means that no matching vendor was available from the installed databases or fallback table.
Hostname resolution uses several mechanisms.
For devices exposing SMB, NetAudit can use:
smbutil status <IP>For example:
Using IP address of 10.0.0.20: 10.0.0.20
Workgroup: WORKGROUP
Server: EXAMPLE-WORKSTATION
NetAudit can extract:
EXAMPLE-WORKSTATION
as the hostname.
The scanner attempts:
socket.gethostbyaddr(ip)If a PTR record exists, the hostname is returned.
Local hostname mappings are checked as another fallback.
On macOS, NetAudit can use:
dns-sdfor local Bonjour-related discovery.
Bonjour resolution is intentionally best-effort because some dns-sd operations can remain active while waiting for network responses.
NetAudit applies strict timeouts and avoids blocking the entire network scan on a single Bonjour lookup.
- Python 3.11+
- macOS or Linux
- Windows support is best-effort
The project uses:
- Typer
- Rich
- Scapy
- Netmiko
- Pydantic
- Pydantic Settings
- PyYAML
- HTTPX
- dnspython
- psutil
- python-dotenv
Development dependencies include:
- pytest
- pytest-cov
- Ruff
- Mypy
git clone https://github.com/netforge201/netaudit.git
cd netaudit
./install.shThe installer can use pipx when available or create a local virtual environment.
pip install .For development:
pip install -e ".[dev]"netaudit scan 192.168.1.0/24Scan a smaller network:
netaudit scan 192.168.1.0/28Use more workers:
netaudit scan 192.168.1.0/24 --workers 100Change the timeout:
netaudit scan 192.168.1.0/24 --timeout 0.5Scan hosts and selected TCP ports:
netaudit scan 192.168.1.0/24 --ports 22,80,443,445Export JSON:
netaudit scan 192.168.1.0/24 --json > scan.jsonExport CSV:
netaudit scan 192.168.1.0/24 --csv > scan.csvDiscover hosts in a CIDR range.
netaudit scan 192.168.1.0/24With ports:
netaudit scan 192.168.1.0/24 --ports 22,80,443,445JSON:
netaudit scan 192.168.1.0/24 --jsonCSV:
netaudit scan 192.168.1.0/24 --csvCommon options:
| Option | Description |
|---|---|
--timeout |
Per-host timeout |
--workers |
Concurrent worker count |
--ports |
TCP ports to check |
--json |
JSON output |
--csv |
CSV output |
--quiet |
Reduce terminal output |
NetAudit limits CIDR scanning to 65,536 addresses to prevent accidental large-scale scans.
Inspect an individual host:
netaudit host 192.168.1.1Depending on the target, information can include:
- IP address
- Reachability
- Latency
- TTL
- OS family hint
- Hostname
- MAC address
- Vendor
- Open ports
- Services
Scan TCP ports:
netaudit ports 192.168.1.1Selected ports:
netaudit ports 192.168.1.1 --ports 22,80,443Port range:
netaudit ports 192.168.1.1 --range 1-1024NetAudit performs connectivity checks and service identification.
It does not attempt to exploit discovered services.
Test reachability and latency:
netaudit ping 8.8.8.8Multiple packets:
netaudit ping 8.8.8.8 --count 10Forward lookup:
netaudit dns example.comReverse lookup:
netaudit dns 8.8.8.8 --reverseSupported record types include:
A
AAAA
MX
NS
TXT
CNAME
PTR
Trace the route to a destination:
netaudit route 8.8.8.8Inspect local network interfaces:
netaudit interfacesDepending on the platform, output can include:
- Interface name
- Interface state
- MAC address
- IPv4 addresses
- IPv6 addresses
- MTU
- RX statistics
- TX statistics
Run network diagnostics:
netaudit doctor 192.168.1.1For a network device:
netaudit doctor 192.168.1.1 \
--device \
--device-type cisco_iosDepending on the target, diagnostics can include:
- ICMP
- Packet loss
- Latency
- DNS
- HTTP/HTTPS
- TCP services
- SSH
- Interface state
- Interface errors
- Uptime
- Default route
- ARP
- NTP
- BGP
- OSPF
Unavailable checks are reported as unavailable rather than guessed.
NetAudit supports read-only access to network infrastructure through Netmiko.
| Platform | Device type |
|---|---|
| Cisco IOS / IOS-XE | cisco_ios |
| Cisco NX-OS | cisco_nxos |
| Cisco IOS-XR | cisco_xr |
| Juniper Junos | juniper_junos |
| Arista EOS | arista_eos |
| Generic | generic |
Example:
netaudit device info 192.168.1.1 \
--device-type cisco_iosConnect:
netaudit device connect 192.168.1.1 \
--device-type cisco_iosDevice operations are intended to be read-only.
Create a device snapshot:
netaudit snapshot 192.168.1.1 \
--device-type cisco_iosList snapshots:
netaudit snapshot --listCompare snapshots:
netaudit diff 192.168.1.1Snapshots can be used to identify configuration or operational state changes over time.
Generate HTML:
netaudit report scan.json --format htmlGenerate Markdown:
netaudit report scan.json \
--format markdown \
--output report.mdSupported formats:
JSON
CSV
Markdown
HTML
Initialize configuration:
netaudit config initShow configuration:
netaudit config showDefault configuration:
~/.netaudit/config.yaml
Example:
defaults:
timeout: 2
workers: 50
scanner:
default_ports:
- 22
- 80
- 443
- 445
reports:
directory: ./reports
snapshots:
directory: ./snapshotsEnvironment variables can also be used for configuration.
Network-device credentials should never be committed to Git.
Credential sources can include:
- CLI options
- Environment variables
- Interactive hidden password input
Example:
export NETAUDIT_USERNAME="admin"
export NETAUDIT_PASSWORD="your-password"Do not commit real credentials to:
- Git repositories
- README files
- configuration files
- screenshots
- issue reports
- shell history
netaudit/
├── cli.py
├── commands/
│ ├── config.py
│ ├── device.py
│ ├── diff.py
│ ├── dns.py
│ ├── doctor.py
│ ├── host.py
│ ├── interfaces.py
│ ├── ping.py
│ ├── ports.py
│ ├── report.py
│ ├── route.py
│ ├── scan.py
│ └── snapshot.py
├── config/
├── devices/
├── diagnostics/
├── network/
├── reports/
├── scanner/
│ ├── arp.py
│ ├── discovery.py
│ ├── icmp.py
│ └── tcp.py
├── snapshots/
└── utils/
The LAN scanner roughly follows this flow:
┌──────────────┐
│ CIDR network │
└──────┬───────┘
│
▼
┌───────────────┐
│ ICMP discovery│
└───────┬───────┘
│
┌───────┴────────┐
│ │
▼ ▼
Reachable Unreachable
│
▼
┌───────────────┐
│ MAC discovery │
└───────┬───────┘
│
┌───────┴───────────┐
│ │
▼ ▼
System ARP Scapy fallback
│
▼
┌──────────────┐
│ Vendor lookup│
└──────┬───────┘
│
▼
┌──────────────────┐
│ Hostname lookup │
└────────┬─────────┘
│
┌──────┼───────────────┐
│ │ │
▼ ▼ ▼
SMB DNS /etc/hosts
+ Bonjour
│
▼
┌──────────────┐
│ TCP scanning │
└──────┬───────┘
│
▼
Final result
Each stage is best-effort.
Failure of one discovery method does not invalidate information obtained through another method.
macOS receives additional integration through native utilities:
ping
arp
smbutil
dns-sd
For example, MAC addresses can often be obtained from:
arp -anSMB hostnames can sometimes be obtained through:
smbutil status <IP>Bonjour services can be inspected manually with:
dns-sd -B _smb._tcp localSome macOS network information is intentionally unavailable through standard DNS.
NetAudit therefore does not assume that every local device must have a reverse-DNS hostname.
Some operations may require elevated privileges depending on the operating system.
In particular:
- Raw ARP packet transmission
- Scapy packet capture
- Access to
/dev/bpf*on macOS
If raw packet access is unavailable, NetAudit attempts to use safer system-level alternatives where possible.
A reachable host can still be reported as:
UP
even if Scapy cannot access:
/dev/bpf0
MAC discovery is optional metadata and must not turn a reachable host into DOWN.
NetAudit follows a safe-by-default approach.
The project is intended for authorized network auditing and diagnostics.
NetAudit:
- Does not exploit discovered services
- Does not attempt credential attacks
- Does not modify network devices
- Uses read-only device commands
- Does not intentionally fabricate discovery data
- Reports unavailable information explicitly
- Limits CIDR scanning
- Uses command timeouts to avoid indefinite blocking
- Treats MAC and hostname discovery as best-effort
Only scan networks and systems that you own or have explicit authorization to audit.
Like NetAudit?
Support the development of NetForge and future open-source network tools.
Every contribution helps fund development, testing, maintenance and new features.
|
TRC-20 |
TON Network |
USDT donations must be sent through TRC-20.
Using the wrong network may result in permanent loss of funds.
Thank you for supporting independent open-source development.
Clone the repository:
git clone https://github.com/netforge201/netaudit.git
cd netauditInstall development dependencies:
pip install -e ".[dev]"Run Ruff:
ruff check netaudit testsRun tests:
pytest -qRun Mypy:
mypy netauditRun coverage:
pytest --cov=netauditThe project includes automated tests covering:
- CLI behavior
- Configuration
- Device connectors
- Diagnostics
- DNS
- Health checks
- ICMP
- Interfaces
- Reports
- Routing
- Services
- Snapshots
- TCP scanning
- Input validation
Before pushing changes:
ruff check netaudit tests
pytest -qGitHub Actions is used for automated project checks.
Repository:
https://github.com/netforge201/netaudit
Planned improvements include:
- Better OUI/vendor database integration
- Extended Bonjour device discovery
- LLDP discovery
- CDP discovery
- SNMP support
- VLAN discovery
- Network topology mapping
- Device fingerprinting
- Improved service identification
- Historical network inventory
- SQLite storage
- Scheduled audits
- Prometheus metrics
- Webhook notifications
- Telegram notifications
- Slack notifications
- Plugin system
- Additional network vendors
- IPv6 discovery improvements
Roadmap items are not considered implemented until they are present in the actual codebase.
Contributions are welcome.
Before opening a pull request:
- Run the test suite.
- Run Ruff.
- Run Mypy when applicable.
- Add tests for new functionality.
- Do not commit credentials.
- Do not commit private network information.
- Keep network-device functionality read-only.
- Keep platform-specific behavior isolated where possible.
- Do not introduce fake or guessed network results.
Example:
ruff check netaudit tests
pytest -qNetAudit is released under the MIT License.
See:
LICENSE
for the full license text.
If NetAudit is useful to you, consider starring the repository and contributing improvements.
Repository:
https://github.com/netforge201/netaudit
Issues:
https://github.com/netforge201/netaudit/issues
NetAudit — консольный инструмент для аудита, диагностики и анализа компьютерных сетей.
Он предназначен для сетевых инженеров, системных администраторов, специалистов по инфраструктуре, IT-support и студентов, изучающих сети и кибербезопасность.
NetAudit позволяет обнаруживать хосты, проверять их доступность, измерять задержку, получать MAC-адреса и информацию о производителе, определять hostname, сканировать TCP-порты, выполнять DNS-запросы, трассировать маршруты, анализировать локальные интерфейсы и работать с поддерживаемыми сетевыми устройствами.
Главный принцип проекта:
NetAudit показывает только реально полученные данные и не подменяет отсутствующую информацию догадками.
- Сканирование CIDR-сетей.
- Параллельное обнаружение хостов.
- ICMP-проверка доступности.
- Измерение latency.
- Получение MAC-адресов.
- Использование системной ARP-таблицы.
- Поддержка macOS
arp. - Поддержка Linux neighbor table.
- Scapy как дополнительный механизм ARP.
- Нормализация MAC-адресов.
- Определение производителя по OUI.
- Определение производителя через
manuf. - Reverse DNS.
/etc/hosts.- SMB / NetBIOS на macOS.
- Bonjour / mDNS на macOS.
- TCP service discovery.
- Дополнительное сканирование портов.
- Ping.
- Packet loss.
- Latency.
- TTL.
- DNS.
- Reverse DNS.
- Traceroute.
- Анализ интерфейсов.
- TCP scanning.
- HTTP/HTTPS checks.
- Health diagnostics.
Поддерживается read-only работа с:
Cisco IOS / IOS-XE
Cisco NX-OS
Cisco IOS-XR
Juniper Junos
Arista EOS
Generic devices
Для подключения используется SSH/Netmiko.
git clone https://github.com/netforge201/netaudit.git
cd netaudit
./install.shИли:
pip install .Для разработки:
pip install -e ".[dev]"Сканирование сети:
netaudit scan 10.0.0.0/24Сканирование с TCP-портами:
netaudit scan 10.0.0.0/24 --ports 22,80,443,445JSON:
netaudit scan 10.0.0.0/24 --jsonИнформация о хосте:
netaudit host 10.0.0.1Проверка портов:
netaudit ports 10.0.0.1 --range 1-1024Ping:
netaudit ping 8.8.8.8DNS:
netaudit dns example.comReverse DNS:
netaudit dns 8.8.8.8 --reverseTraceroute:
netaudit route 8.8.8.8Интерфейсы:
netaudit interfacesДиагностика:
netaudit doctor 10.0.0.1Информация о Cisco:
netaudit device info 10.0.0.1 --device-type cisco_iosНа macOS NetAudit в первую очередь использует системную ARP-таблицу:
arp -anMAC-адреса macOS могут отображаться с однозначными hex-октетами. NetAudit нормализует их до стандартного шестнадцатеричного формата.
Например, синтетический пример:
10.0.0.1 -> 00:11:22:33:44:55
Vendor определяется через базу manuf и встроенный OUI fallback.
Если производитель неизвестен, NetAudit показывает:
VENDOR: —
Это означает только то, что соответствие не было найдено.
NetAudit использует несколько источников:
- Reverse DNS.
/etc/hosts.- SMB / NetBIOS.
- Bonjour / mDNS на macOS.
Hostname не всегда доступен. Это нормально для локальных сетей: устройство может отвечать на ICMP и иметь MAC-адрес, но не иметь PTR-записи или доступного имени.
Для macOS используются системные инструменты:
arp
smbutil
dns-sd
Некоторые Bonjour-запросы могут ждать ответ от сети. Поэтому NetAudit использует таймауты и не должен блокировать весь скан из-за одного устройства.
Основной конфигурационный файл:
~/.netaudit/config.yaml
Пример:
defaults:
timeout: 2
workers: 50
scanner:
default_ports:
- 22
- 80
- 443
- 445
reports:
directory: ./reports
snapshots:
directory: ./snapshotsТакже можно использовать переменные окружения с префиксом:
NETAUDIT_*
NetAudit предназначен для авторизованного аудита.
Инструмент:
- не пытается эксплуатировать найденные сервисы;
- не изменяет конфигурацию сетевых устройств;
- использует read-only команды;
- не должен сохранять credentials в отчётах;
- ограничивает размер CIDR-сканирования;
- сообщает об отсутствующих зависимостях и привилегиях;
- не выдумывает MAC, hostname или vendor.
Используйте NetAudit только в сетях и системах, на аудит которых у вас есть разрешение.
ruff check netaudit tests
pytest -qType checking:
mypy netauditCoverage:
pytest --cov=netauditЕсли NetAudit оказался полезен, можно поддержать разработку проекта криптодонатом.
TYtLvfgG9szPoRUcNpsz3paYzynFmLS5Go
UQDpx5wZ03QD5tCFT6fkhKGJ-LRFhAfn7hYohEUSNoJcv6JS
Перед отправкой обязательно проверьте сеть. Для USDT используется именно TRC-20.
Спасибо за поддержку независимой open-source разработки.