Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

net-analyzer

Network Analysis CLI/TUI Tool — ping, traceroute, port scan, DNS resolution, whois lookups, and speed tests, all from the terminal.

Features

  • ping — ICMP echo request with statistics (raw ICMP or system ping fallback)
  • trace — Traceroute via UDP probes with TTL stepping (raw socket or system fallback)
  • scan — TCP connect port scan on 20 common ports (SSH, HTTP, HTTPS, MySQL, etc.)
  • dns — DNS resolution showing A, AAAA records and canonical names
  • whois — Domain whois lookup via raw TCP connection to whois servers
  • speedtest — Download speed test using test files from speedtest.tele2.net
  • all — Comprehensive run: DNS + ping + trace + scan + whois in one command
  • TUI mode — Interactive curses-based menu interface (--tui)

Installation

From source

# Clone or copy the project
cd net-analyzer

# Install in editable mode
pip install -e .

As a standalone script

python -m net_analyzer ping google.com

Usage

CLI Commands

# Ping a host (4 packets)
net-analyzer ping google.com

# Ping with custom count
net-analyzer ping google.com 10

# Traceroute
net-analyzer trace cloudflare.com

# Port scan (20 common ports)
net-analyzer scan localhost

# DNS resolution
net-analyzer dns github.com

# Whois lookup
net-analyzer whois example.com

# Speed test (download 10MB file)
net-analyzer speedtest

# Speed test with custom size (1MB, 10MB, 50MB, 100MB)
net-analyzer speedtest 50MB

# Run ALL network checks against a host
net-analyzer all example.com

# Show help
net-analyzer --help

TUI Mode

net-analyzer --tui

Navigate with arrow keys, press Enter to select, type target when prompted.

Examples

# Quick network diagnostics
$ net-analyzer all google.com

# Check if a web server is running
$ net-analyzer scan myserver.local

# Trace the route to a CDN
$ net-analyzer trace cloudflare.com

Requirements

  • Python 3.8+
  • No external dependencies (standard library only)
  • ping / traceroute system commands (optional — raw sockets used when available)

Performance Notes

  • Raw ICMP ping and raw traceroute require root/Administrator permissions. If unavailable, the tool falls back to calling the system ping/traceroute commands.
  • Port scanning uses TCP connect (SYN-ACK) — no elevated privileges needed.
  • Speedtest downloads a file from speedtest.tele2.net — internet connection required.

Project Structure

net-analyzer/
├── pyproject.toml
├── README.md
└── src/
    └── net_analyzer/
        ├── __init__.py
        ├── __main__.py      # Entry point
        ├── cli.py           # All CLI commands + dispatch
        └── tui.py           # Curses TUI interface

License

MIT