..

Fun trick with ping - hex values

Just found out that the ping command actually resolves hex values.

In the example below, we ping the hex equivalent of 127.0.0.1.

[benkyou@fedora Dev]$ ping 0x7f000001 -c 4
PING 0x7f000001 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.093 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.118 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.119 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.120 ms

--- 0x7f000001 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3095ms
rtt min/avg/max/mdev = 0.093/0.112/0.120/0.011 ms

Just another trick that may or may not bypass certain filters. 🤔