I've been
reading a bit about firewalk, a traceroute variant with knowledge of what a firewall might
do in order to stop traffic at its door. Here are some notes.
On using traceroute - Letting traceroute use UDP packet and watch it not being able to report on tells us that some filtering is happening on some hosts. For instance, if we see this in our traceroute output:
13 193.251.243.30 180.328 ms 183.666 ms 172.724 ms
14 * * *
15 * * *
We know that at 193.251.243.30 some UDP filtering is happening. If instead we force traceroute to send ICMP packets (-I option,) we might start to see what's behind the filtering host:
13 193.251.243.30 164.937 ms 169.354 ms 170.566 ms
14 193.251.251.54 175.550 ms 177.654 ms 173.038 ms
15 193.252.117.254 173.594 ms 170.467 ms 180.090 ms
- If the filtering host was blocking ICMP traffic as well, we could try to tickle it with some other UDP traffic it might accept such as DNS. The trick is then to reach the host with the right port number (since traceroute increment the port number for each attempt made) The computation is rather simple, based on the number of hops and the number of attempt. With the
-p option, traceroute traffic will reach the filtering host with the right port number. It's also easy to modify traceroute source code not to increment the port number, so that tracing can start at a static port number of your choice.
FirewalkFirewalk use a combination of all these methods and works once you've (1) discovered a gateway
(like 193.251.243.30 in the example above) and (2) discovered a host behind the gateway (like
193.251.251.54 in the example above.) It will send the IP traffic of your choice to ports, using the right TTL in an attempt to find out what's behind the filtering agent, hereby obtaining a map of interesting hosts behind a firewall.
While reading the firewalk paper, I wrote a unpretentious perl script that invokes traceroute and tries to report any host that will do UDP filtering (by comparing the invocation of traceroute with using UDP or ICMP.) Just for kicks, it'll try to add geo location information with the hosts it discovered.
Here. Here's an invocation sample:
$ geotraceroute.pl wanadoo.fr -geolocate -flag_gw
10.2.0.1: Marina Del Rey, California, United States.(lat=33.98, lon=-118.45)
10.10.72.254: Marina Del Rey, California, United States.(lat=33.98, lon=-118.45)
209.172.100.193: San Jose, California, United States.(lat=37.34, lon=-121.89)
209.172.121.229: San Jose, California, United States.(lat=37.34, lon=-121.89)
209.172.123.1: San Jose, California, United States.(lat=37.34, lon=-121.89)
140.174.37.61: Englewood, Colorado, United States.(lat=39.58, lon=-104.90)
129.250.26.38: Englewood, Colorado, United States.(lat=39.58, lon=-104.90)
193.251.250.41: Amsterdam, North Holland (province), Netherlands.(lat=52.35, lon=4.90)
193.251.240.2: Amsterdam, North Holland (province), Netherlands.(lat=52.35, lon=4.90)
193.251.241.133: Rue, Somme (department), Picardy (region), France.(lat=50.27, lon=1.67)
G 193.251.251.54: Rue, Somme (department), Picardy (region), France.(lat=50.27, lon=1.67)
193.252.117.254: Issy-les-moulineaux, Hauts-de-seine (department), Ile-de-france (region), France.(lat=48.82, lon=2.27)
193.252.122.2: Issy-les-moulineaux, Hauts-de-seine (department), Ile-de-france (region), France.(lat=48.82, lon=2.27)
193.252.122.18: Issy-les-moulineaux, Hauts-de-seine (department), Ile-de-france (region), France.(lat=48.82, lon=2.27)
193.252.122.103: Issy-les-moulineaux, Hauts-de-seine (department), Ile-de-france (region), France.(lat=48.82, lon=2.27)
Notice the entry marked with a leading
G. It indicates that this host filters UDP but not ICMP. It might just be a gateway. With
netpbm it should be possible to map all the entries on a world map. Supported flags are
-debug,
-resolve,
-flag_gw and
-help.
Labels: security