58
◾
Ethical Hacking and Penetration Testing Guide
A traceroute uses a TTL (time to live) field from the IP header, and it increments the IP
packet
in order to determine where the system is. The time to live value decreases
every time it reaches a
hop on the network (i.e. router to server is one hop).
There are three different types of traceroutes:
1. ICMP traceroute (which is used in Windows by default)
2. TCP traceroute
3. UDP traceroute
ICMP Traceroute
Microsoft Windows by default uses ICMP traceroute; however, after a few hops, you will get a
timeout, which indicates that there might be a device like IDS or firewall
that is blocking ICMP
echo requests.
From this image you can see that the ICMP echo requests are timed out after seven requests.
TCP Traceroute
Many devices are configured to block ICMP traceroutes. This is where we try TCP or UDP trac-
eroutes, also known as layer 4 traceroutes. TCP traceroute is by default available in BackTrack. If
you can’t find it, just use the following command:
apt-get install tcptraceroute
Usage
From
the command line, you would need to issue the following command:
tcptraceroute www.google.com
UDP Traceroute
Linux also has a traceroute utility, but unlike Windows, it uses UDP protocol for the traceroute.
In Windows, the command for traceroute is “tracrt”. In, Linux, it’s “tracroute”.
Usage
traceroute www.target.com