This is a simple Python script that performs a traceroute to a given host using the scapy and the ipwhois libraries (IPv6 supported)
- Python 3.x
- scapy library
- ipwhois library
- Clone the repository:
git clone https://github.com/AIM1rage/Traceroute.git
- Install the required dependencies:
pip install scapy
pip install ipwhois
python traceroute.py [-h] [-src SRC] [-seq SEQ] [-ttl TTL] [-c C] [-d D] [-t T] [-s S] host
Perform a traceroute to a specified host.
host
- The IP address or domain name to trace the route to.
-h, --help
- Show the help message and exit.-src
- Source address (default: [your local address])-seq SEQ
- Additional sequence number (default: 42).-ttl TTL
- Maximum time-to-live value (default: 30).-c C
- Requests count (default: 3).-d D
- Delay between requests in seconds (default: 0).-t T
- Request timeout in seconds (default: 0.5).-s S
- Packet size (default: 40)
To trace the route to public Google DNS 8.8.8.8
with optional arguments: ttl = 10 and t = 2 (seconds):
python traceroute.py 8.8.8.8 -ttl 10 -t 0.3
In order to test my code, you can run the script using the following command (Windows only!)
python -m unittest -v traceroute_should.TracerouteTest