![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lindsay van Eden May 17, 2001 Introduction: ICMP: Internet Control Message Protocol. "Jeah sure, add a rule to the firewall. It's only ICMP" -Famous last words perhaps? It never ceases to amaze me that there are so many individuals who seem to be under the impression that ICMP is a completely harmless protocol. That PING and ICMP are one of the same and the definitive test as to whether a host is alive. I must admit that I too used to believe it was a pretty harmless protocol. I knew that it carried a payload but had no idea as to the depth of information one could obtain from it. Things like, what services are running on the hosts, how those hosts are organized and what operating systems are they running. Scary stuff I know, but with this paper I hope to create an awareness of the true dangers of ICMP. What does ICMP do? ICMP normally contain control messages and is a vital part of IP. Although not designed to be 100% reliable, ICMP is how we receive information about routing difficulties, simple exchanges such as echo transactions and errors in datagram processing. Does everyone know what ping does? Ping uses timed IP/ICMP ECHO_REQUEST and ECHO_REPLY packets to probe the "distance" to the target machine. Now I'm pretty sure that no one has ever seen a PING that looks like this:
So where are these so called ICMP messages I've been talking about?. Well, ICMP messages are sent for a number of different reasons such as/including errors and information. ICMP is catagorised into 'types' and 'codes'. Each ICMP 'type' has a specific function, and the 'codes' within a given type offer a degree of specification or granularity to this 'type'. An ICMP header is 8-bytes (64-bits) long. It may contain more data depending upon the exact operation being performed. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ For example, Type 11 - Time Exceeded Type 11 Code 0 - Time to live exceeded in transit Type 11 Code 1 - Fragment reassembly time exceeded
In practice, while running a tcpdump or snoop (these are both UNIX based network packet sniffers) one may receive a Type 3 Code 3 message. From this one can ascertain that the IP module cannot deliver the datagram as the indicated protocol or process is not active. (Type 3 Code 3 = Destination port unreachable, normally associated with UDP sockets not listening) ICMP does have advantages. An ICMP type that should not be filtered is type 3 code 4 (Fragmentation needed and DF set). Let's say one has a particular host connected to an Ethernet segment which wanted to communicate to another host separated by a serial link. The default Ethernet MTU (Maximum Transmit Unit) is 1500bytes while the serial is 576bytes. The packets would have to be segmented due their size but the 'Do not Fragment' flag is set. (too large for the serial MTU) .One would never know that the packets are to big to transmit if it weren't for the icmp packet So ICMP serves it's purpose of providing feedback about problems in communication. How does ICMP become a problem? Take a look at your current organization. How many times have you seen users logging calls and complaining that the network is down just because they are unable to PING. A happy user is a user that can PING so companies often allow icmp to traverse their network and firewall. "My application is not working as I cannot ping the firewall" - hmm, that sounds familiar. This is when the system breaks down. Network administrators and such tend to turn a blind eye due to the pressure from users. You know they're going to complain to mangement who in turn will instruct it to be allowed. This is when it becomes vital that the risks are communicated to management as it could one day be the downfall of your network!! How is ICMP exploited? Firstly, there is no such thing as an ICMP port. Would be hackers use ICMP messages to obtain information about one's network and to even redirect traffic. Take an ICMP redirect message. What if the ICMP packet was generated by a host "acting" as a router. The router could than be tricked into using a false route. The attacker could than direct the traffic straight to their host where they could have an application waiting to receive and interpret the contents. Contents which they, under normal circumstances would and often should not have access to. There are lots of potential denial of service (DoS) threats available through ICMP). One of them being an ICMP bomb. An ICMP bomb often includes forged messages such as EOF (end of file), dead socket, redirect, information etc. They may also be used in a denial of service attack. This could be when a host is sent a route that loses it's connectivity or is sent an ICMP Network Unreachable packet The host thinks that it can no longer access a particular network. ICMP Sweeps are yet another form of attack. It's a way of querying multiple hosts using ICMP ECHO. However, with today's firewalls and routers, one can block this type of traffic. To get around it, one could use a more advanced ICMP scanning technique. Try making use of the non-ECHO ICMP protocols (types that are not protocols - ALL ICMP is IP protocol 1). These include support to request timestamp and netmask information. Many firewall and packet filter designers forget to block all ICMP traffic and only filter ECHO traffic. In this case, making non-ECHO requests is still a valid form of host identification. There are a number of programs that use ICMP as a basis for obtaining information. Nmap and Snort are perfect examples. In short, I've listed an explanation of each message and where applicable, a possible attack.
Conclusion: ICMP is a great hacking tool as it's versatile, mostly overlooked and let's not forget, commonly misunderstood. Engineers, administrators, security officers etc. need to be aware of the dangers. The amount of information carried within the message can be used by attackers to exploit known vulnerabilities. How are you going to explain to the board of directors that your network's been compromised because icmp was allowed through?? References: Graham, Robert "Firewall, FAQ: Firewall Forensics (What am I seeing?)" Copyright 1998-2000 http://secinf.net/info/fw/firewall-seen.html Arkin, Ofir "ICMP Usage in Scanning" July 2000 The Black2 Team: Ajay Kumar Gummmadi; Eric Daniel; Faisal
Karim; Ikram Ahmed Khan; Ralph Akram Gholmieh; Raul Gonzalez Barron; Rehan Ayyub Sheikh
'"Advanced Networking Security" CPSC689 - Summer '96 Postel, J "Internet Control Message Protocal Darpa
Internet Program Protocol Specification" - RFC 792 September 1981 Bontoft, Andy "Checkpoint Firewall-1 Rulebases*" April 2001 Dimension Data Security. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
to top of page | to Threats & Vulnerabilities | to Reading Room Home
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||