Explore the future of Web Scraping. Request a free invite to ScrapeCon 2024

Python Traceroute with a Visualization like in the ‘Hacker Movie Scene’

Traceroute is a tool for checking where is your packet/traffic is routed on the internet. This thing is a wonderful for troubleshooting the network. Honestly this article and python program made by…

image

Photo by NASA on Unsplash

Traceroute is a tool for checking where is your packet/traffic is routed on the internet. This thing is a wonderful for troubleshooting the network. Honestly this article and python program made by me but inspired by computerphile. Here is the video if you wanna watch after reading my article. Without Further Ado, let’s go deep to know how I made this python program..

Development

This project is divided into 5 python files.
1. trace.py → handle traceroute and return the IP List
2. getloc.py → handle get the location of the IP
3. plot.py → handle plot with maps
4. help.py → handle help print in the terminal
5. main.py → the main script that handles all the flow And how the main.py looks like? Here it is, Import the module image

picture from the author Get my location and the target location image

picture from the author

Run traceroute image

picture from the author

Prepare for the plot image

picture from the author

[End] The maps plot with plotly image

picture from the author

Installation

I know you guys, you are like me, a lazy person :) I have put this all my script into the github, so you can get this out for free. Download all the script in this github link, https://github.com/febimudiyanto/traceroute-maps. Or you can clone my repo with this command:

git clone <https://github.com/febimudiyanto/traceroute-maps.git>

Then install all packages in the requirement.txt.

pip install -r requirements.txt

after all installations complete, run the program:

python main.py [hostname/domain]

If you have a problem with running that script, just follow my record in the demo session.

Demo

Eventually, the demo session. How this thing works, here it is. image

Conclusion

I hope today you learn about how your connection delivered by the Internet with this tool, traceroute. If you know more deeply about something, you would know about the other side of that than other people. You can fix something and maybe hack something. Thanks for reading.




Continue Learning