Skip to content

Repository files navigation

PyNetTools

LicensePythonPlatform

A network analysis and diagnostics toolkit built with Python. PyNetTools provides a suite of utilities — ping, traceroute, ping sweep, port scanning, OS detection, and speed testing — via both an interactive menu and a full command-line interface.

PyNetTools Banner


Features

FeatureDescription
Speed TestMeasure download/upload speeds and ping latency
PingSend ICMP echo requests to any host
TracerouteTrace the network path with hop-by-hop details and a visual graph
Ping SweepDiscover active hosts across a subnet
Port ScanIdentify open ports and services via Nmap
OS DetectionFingerprint the operating system of a remote host

Requirements

  • Python 3.6+
  • Administrator / root privileges (required for raw socket features: ping, traceroute, sweep)
  • Windows:Npcap — required by Scapy for raw packet capture. During install, enable "WinPcap API-compatible mode".
  • Linux/macOS:libpcap (usually pre-installed; install via sudo apt install libpcap-dev or brew install libpcap if missing)

Installation

# 1. Clone the repository
git clone https://github.com/allenmonkey970/pynettools.git
cd pynettools
# 2. (Windows only) Install Npcap from https://npcap.com/#download# 3. Install Python dependencies
pip install -r requirements.txt

Usage

Interactive mode

python main.py
Network Tool Menu:
1. Perform Speed Test
2. Ping a Target
3. Traceroute to a Target
4. Ping Sweep
5. Port Scan
6. OS Scan
7. Exit

Command-line interface

Speed test

python main.py speedtest

Ping

python main.py ping <target> [-c COUNT] [-t TIMEOUT]
FlagDefaultDescription
-c, --count4Number of packets to send
-t, --timeout1Per-packet timeout (seconds)

Traceroute

python main.py traceroute <target> [-m MAX_HOPS] [-t TIMEOUT] [-s]
FlagDefaultDescription
-m, --max-hops30Maximum number of hops
-t, --timeout1Per-probe timeout (seconds)
-s, --saveSave results to results/

Ping sweep

python main.py sweep <subnet> [-t TIMEOUT] [--threads N]
FlagDefaultDescription
-t, --timeout1Per-host timeout (seconds)
--threads10Concurrent threads

Port scan

python main.py portscan <target> [-p PORTS]
FlagDefaultDescription
-p, --ports1-1024Port range (e.g. 1-1024 or 22,80,443)

OS detection

python main.py osscan <target>

Configuration

Create a config.json in the project root to override defaults:

{
"timeout": 1,
"max_hops": 30,
"threads": 10,
"default_ports": "1-1024"
}

Results

All output is saved to the results/ directory (created automatically, excluded from version control):

FileContents
speedtest_results.jsonDownload/upload speeds and latency
traceroute_<target>.txtHop-by-hop traceroute output
traceroute_<target>.pngTraceroute network graph
ping_sweep_<subnet>.txtList of live hosts
portscan_<target>.txtOpen ports and services
osscan_<target>.txtOS detection matches
network_tool.logFull session log

Screenshots

Speed Test

Speed Test

Traceroute

Traceroute

Traceroute Visualization

Traceroute Visualization


Project Structure

PyNetTools/
├── pynettools/
│ ├── __init__.py
│ ├── network_tool.py # NetworkTool class
│ └── subnets.py # Subnet utilities
├── screenshots/ # README screenshots
├── results/ # Runtime output (gitignored)
├── main.py # Entry point
├── config.json # Optional configuration
├── requirements.txt
└── LICENSE

Disclaimer

This tool is intended for network diagnostics and educational purposes only. Always ensure you have explicit authorization before scanning networks or hosts you do not own.


License

This project is licensed under the MIT License — see LICENSE for details.


Contributing

Contributions, issues, and feature requests are welcome. Check the issues page.

  1. Fork the project
  2. Create your feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m 'Add my feature'
  4. Push to the branch: git push origin feature/my-feature
  5. Open a Pull Request

About

A network analysis and diagnostics toolkit built with Python. PyNetTools offers a suite of networking utilities, including ping, traceroute, port scanning, OS detection, ping sweeping, and speed testing with both command-line and interactive interfaces.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages