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.
- 📊 Internet Speed Testing - Measure your download/upload speeds and ping latency
- 📡 Ping & Traceroute - Test connectivity and trace network paths with visualizations
- 🔍 Ping Sweep - Discover active hosts on a network subnet
- 🔒 Port Scanning - Identify open ports and services on target hosts
- 💻 OS Detection - Determine the operating system of remote hosts
- 📈 Results Visualization - View traceroute paths with network graphs
- 📋 Logging & Reporting - Save all results to organized files for analysis
- Python 3.6 or higher
- Root/Administrator privileges (for some features)
-
Clone the repository:
git clone https://github.com/allenmonkey970/pynettools.git cd pynettools
-
Install the required packages:
pip install -r requirements.txt
Run the tool without any arguments to use the interactive menu:
python network_tool.py
This will present a menu with all available options:
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
python network_tool.py speedtest
python network_tool.py ping example.com -c 5 -t 2
-c, --count
: Number of packets to send (default: 4)-t, --timeout
: Timeout in seconds for each packet (default: 1)
python network_tool.py traceroute example.com -m 30 -t 1 -s
-m, --max-hops
: Maximum hops (default: 30)-t, --timeout
: Timeout in seconds for each probe (default: 1)-s, --save
: Save results to file
python network_tool.py sweep 192.168.1.0/24 -t 1 --threads 20
-t, --timeout
: Timeout in seconds (default: 1)--threads
: Number of threads (default: 10)
python network_tool.py portscan example.com -p 1-1024
-p, --ports
: Port range (e.g., 1-1024 or 22,80,443)
python network_tool.py osscan example.com
You can customize default settings by creating a config.json
file in the root directory:
{
"timeout": 1,
"max_hops": 30,
"threads": 10,
"default_ports": "1-1024"
}
All results are saved in the results
directory:
- Speed test results:
speedtest_results.json
- Traceroute results:
traceroute_[target].txt and traceroute_[target].png (visualization)
- Ping sweep results:
ping_sweep_[subnet].txt
- Port scan results:
portscan_[target].txt
- OS scan results:
osscan_[target].txt
- Log file:
network_tool.log
This tool is for network diagnostics and educational purposes only. Always ensure you have proper authorization before scanning networks that you don't own or have explicit permission to test.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request