Introduction
Imagine using a standard network tool to transform a music video into a command-line animation. That's exactly what some hackers have set out to do with "Bad Apple!!", an iconic video often used as a benchmark to test and showcase technical skills. This article explores how enthusiasts managed to display this video via traceroute, a network diagnostic tool.
The Essence of Traceroute
Traceroute is a tool that allows you to trace the path a data packet takes on a network to reach its destination. It works by sending packets with increasing time-to-live (TTL) values and listening for "time exceeded" ICMP (Internet Control Message Protocol) messages returned by intermediate routers. This process maps the "hops" between the source and the destination.
The "Bad Apple" Concept
"Bad Apple!!" is a video that has become a cultural phenomenon due to its shadow art style. It is often used in technical demonstrations because it can be rendered on devices with limited display capabilities. The video can be reduced to a simple series of black and white images, allowing it to be displayed on unconventional "screens."
Transforming Traceroute into a Display
To transform traceroute into a graphic display tool, several technical steps are necessary. The idea is to inject fictitious hops into the traceroute output so that they correspond to the pixels of an image at a given time.
Generating Random Numbers with nftables
Using nftables, a packet filtering tool on Linux, you can dynamically generate IP addresses. The trick is to use the numgen function to create a monotonic counter that generates a different IPv6 address each time an ICMPv6 response is generated.
Bypassing Traffic Limits
By default, the Linux kernel imposes a rate limit on outgoing ICMPv6 packets. To ensure the experience is smooth, this limit must be disabled using sysctl net.ipv6.icmp.ratelimit=0.
Modifying mtr
mtr (My Traceroute) can show multiple addresses per hop, which is normally useful for diagnosing network path variability. However, for our purpose, this needs to be avoided. A small modification to the mtr source code ensures that only one address is displayed per hop.
Video Conversion with ffmpeg
To make the timing work, the original video is converted into a series of images at 8 frames per second, with each image reduced to a resolution of 30x11 pixels. A Python script reads these images and converts them into a set of nftables rules, which are then used to generate the corresponding ICMPv6 responses.
Implications and Applications
This demonstration is not just a fun technical feat. It highlights the flexibility and power of modern network tools when repurposed from their intended use. The implications extend beyond mere "hacking": they show how standard tools can be reinvented to serve creative or educational purposes.
Conclusion
The "Bad Apple but It's Traceroute" initiative illustrates how creativity can transform technical tools into platforms for artistic expression. If you're inspired by these types of technical innovations, let's discuss your project in 15 minutes.