ICMP Scanning v3
ICMP Scanning v3
Version 3.0
Ofir Arkin
Founder
http://www.sys-security.com
[email protected]
Version 3.0
June 2001
Trust No One
Table of Contents
1.0 INTRODUCTION...................................................................................................... 11
4.4 Using UDP Scans (or why we wait for the ICMP Port Unreachable) ....................... 66
4.4.1 A Better Host Detection Using UDP Scan......................................................... 66
4.5 Using Packets bigger than the PMTU of internal routers to elicit an ICMP
Fragmentation Needed and Don’t Fragment Bit was Set (configuration problem).......... 68
5.1 Inverse Mapping Using ICMP Query Request(s), and ICMP Query Reply(s).......... 69
7.5 Other Possible Active Fingerprinting Methods and Techniques Using the ICMP
Protocol ......................................................................................................................... 159
8.2 The Quality of the Information Gathered (Location of the Sensor) ........................ 162
8.2.1 A Sensor Located Inside an Internal Segment................................................ 162
8.2.2 A Sensor Located in the DMZ ......................................................................... 163
8.2.3 A Sensor Located Outside A Targeted Network ............................................. 164
9.5 Other Problems – Why it is important to filter ICMP traffic in the Internal
segmentation................................................................................................................. 188
APPENDIX C: ICMP QUERY MESSAGE TYPES WITH CODE FIELD !=0 ................. 198
Figures List
Figure 1: ICMP Message Format 16
Figure 2: ICMP Error Message General Format 17
Figure 3: ICMP Fragmentation Needed but the Don’t Fragment Bit was set Message Format 20
Figure 4: ICMP Redirect Message Format 22
Figure 5: ICMP Parameter Problem Message Format 25
Figure 6: ICMP Query Message Format 25
Figure 7: ICMP ECHO Request & Reply message format 27
Figure 8: ICMP Time Stamp Request & Reply message format 28
Figure 9: ICMP Information Request & Reply message format 30
Figure 10: ICMP Address Mask Request & Reply message format 30
Figure 11: ICMP Fragmentation Required with Link MTU 34
Figure 12: ICMP ECHO Mechanism 36
Figure 13: ICMP ECHO Request & Reply message format 37
Figure 14: Broadcast ICMP 40
Figure 15: ICMP Time Stamp Request & Reply message format 42
Figure 16: ICMP Information Request & Reply message format 44
Figure 17: ICMP Address Mask Request & Reply message format 47
Figure 18: The IP Header 54
Figure 19: An Example: A TCP packet fragmented after only 12 bytes of TCP information 65
Figure 20: An Example with UDP. Slicing should occur in the Data portion 65
Figure 21: Using Packets bigger than the PMTU of internal routers to elicit an ICMP
Fragmentation Needed and Don’t Fragment Bit was Set 68
Figure 22: The Inverse Mapping Logic 69
Figure 23: Inverse Mapping Using ICMP Echo Replies 71
Figure 24: A Decoy Scan Example 73
Figure 25: ICMP Time Exceeded message format 74
Figure 26: The Type of Service Byte 102
Figure 27: ICMP ECHO Request & Reply message format 130
Figure 28: The Type of Service Byte 146
Figure 29: ICMP EHCO Request Message Format 172
Figure 30: Firewall ICMP Filtering Rules 188
Figure 31: Internal segmentation ICMP Filtering Example 189
Table List
Table 1: ICMP Types & Codes 15
Table 2: ICMP Error Messages Common Fields 17
Table 3: ICMP Error Messages 17
Table 4: Destination Unreachable Codes (Router) 18
Table 5: Redirect Codes 22
Table 6: Time Exceeded Codes 24
Table 7: Parameter Problem Codes 24
Table 8: ICMP Query Messages – Common Fields 26
Table 9: The ICMP Query Messages 26
Table 10: Which Operating Systems would answer to an ICMP ECHO Request aimed at the
Broadcast Address of the Network they reside on? 41
Table 11: non-ECHO ICMP Query of different Operating Systems and Networking Devices 50
Table 12: Operating Systems, which would answer to requests, aimed at the Broadcast address 51
Table 13: Networking Devices, which would answer to requests, aimed at the Broadcast address 51
Table 14: IP TTL Field Values in replies from Various Operating Systems 95
Table 15: IP TTL Field Values in requests from Various Operating Systems 97
Table 16: Further dividing the groups of operating systems according to IP TTL field value in
the ICMP ECHO Requests and in the ICMP ECHO Replies 99
Table 17: Precedence Field Values 103
Table 18: Type-of-Service Field Values 103
Table 19: ICMP Query Message Types with Precedence Bits ! = 0 118
Table 20: ICMP Query Message Types with TOS! = 0 118
9
Table 21: ICMP Query Message Types with the TOS Byte Unused Bit value ! = 0 121
Table 22: DF Bit Echoing 127
Table 23: ICMP Error Message Echoing Integrity 143
Table 24: Precedence Field Values 146
Table 25: ICMP ID information 174
Table 26: ICMP Sequence Number information 179
Table 27: Different ICMP data field size(s) and Total Datagram size(s) 181
Diagram List
Diagram 1: Finger Printing Using non-ECHO ICMP Query Types aimed at the Broadcast
Address of an Attacked Network 80
Diagram 2: Finger Printing Using ICMP Address Mask Requests 102
Diagram 3: An example for a way to fingerprint Microsoft Windows 2000, Ultrix, HPUX 11.0 &
10.30, OpenVMS, Microsoft Windows ME, and Microsoft Windows 98/98SE
based machines with ICMP Query messages with the Precedence Bits field !=0 112
Diagram 4: An example for a way to fingerprint Microsoft Windows 2000, Ultrix, Novell Netware,
Microsoft Windows ME, and Microsoft Windows 98/98SE based machines with
ICMP query messages with the TOS bits field !=0 118
Diagram 5: An example for a way to fingerprint operating systems using the unused bit in the
TOS Byte echoing method 121
Diagram 6: An example of fingerprinting using the DF Bit Echoing technique 128
Diagram 7: An Example of Finger Printing Using crafted ICMP Echo & Timestamp Request 132
Diagram 8: DF Bit Echoing with ICMP Error Messages 152
Diagram 9: A Sensor located inside the Internal Network 163
Diagram 10: A Sensor located in the DMZ 164
Diagram 11: A Sensor is located on the upstream/downstream link of the attacked network 164
10
1.0 Introduction
1.1 Introduction to Version 1.0
The ICMP Protocol may seem harmless at first glance. Its goals and features were outlined in
RFC 792 (and than later cleared in RFCs 1122, 1256, 1349, 1812), as a way to provide a means
to send error messages for non-transient error conditions, and to provide a way to probe the
network in order to determine general characteristics about the network. In terms of security,
ICMP is one of the most controversial protocols in the TCP/IP protocol suite. The risks involved in
implementing the ICMP protocol in a network, regarding scanning, are the subject of this research
paper.
Scanning will usually be the major stage of an information gathering process a malicious
computer attacker will launch against a targeted network. With this stage the malicious computer
attacker will try to determine what are the characteristics of the targeted network. He will use
several techniques, such as host detection, service detection, network topology mapping, and
operating system fingerprinting. The data collected will be used to identify those Hosts (if any)
that are running a network service, which may have a known vulnerability. This vulnerability may
allow the malicious computer attacker to execute a remote exploit in order to gain unauthorized
access to those systems. This unauthorized access may become his focal point to the whole
targeted network.
This research paper outlines the usage of the ICMP protocol in the scanning process. Step-by-
Step we will uncover each of the malicious computer attacker techniques using the ICMP
protocol. A few new scanning techniques will be unveiled in this research paper. I have reported
some of them to several security mailing lists, including Bugtraq, in the past.
The chapters in this research paper are divided according to the various scanning techniques:
I would like to take a stand in this controversial issue. ICMP protocol hazards are not widely
known. I hope this research paper will change this fact.
11
I have introduced a new section with this version dealing with “Passive Fingerprinting Using the
ICMP Protocol” (chapter 8).
Snort rules were written to deal with all of the examples and methods given in this paper.
Some new active operating system fingerprinting methods were explained with this version.
12
RFC 1122 (Requirements for Internet Hosts – Communication Layers), and RFC 1812
(Requirements for IP version 4 Routers) later clarified some of the ICMP protocol features.
In order to work reliably and consistently with other implementations of the ICMP protocol, we
need to incorporate RFC 792, RFC 1122, and RFC 1812.
Other RFCs have defined other functionalities for the ICMP protocol:
A more accurate definition of the Internet Control Message Protocol goals and features might be
that it is used for two types of operations:
When a router or a destination host need to inform the source host about errors in a
datagram processing, and
For probing the network with request & reply messages in order to determine general
characteristics about the network.
It is important to note that the ICMP protocol is used to provide feedback about some errors (non-
transient) in a datagram processing, not to make IP reliable. Datagrams may still be undelivered
without any report of their loss. If a higher level protocol that use IP need reliability he must
implement it.
RFC 792 defines the IP protocol ID for ICMP to be 1. It also states that the IP Type-of-Service
field value and the Precedence Bits value should be equal to zero. According to RFC 1812,
Routers will use the value of 6 or 7 as their IP Precedence bits value with ICMP Error messages.
1
Now being replaced by the DiffServ mechanism. For more information refer to RFC 2474
(http://www.ietf.org/rfc/rfc2474.txt).
13
No ICMP Error messages are sent in response to ICMP Error messages to avoid
infinite repetition2.
For fragmented IP datagrams ICMP messages are only sent for errors on fragment
zero (the first fragment).
ICMP Error messages are never sent in response to a datagram that is destined to a
broadcast or a multicast address.
ICMP Error messages are never sent in response to a datagram sent as a link layer
broadcast.
ICMP Error messages are never sent in response to a datagram whose source address
does not represents a unique host – the source IP address cannot be zero, a loopback
address, a broadcast address or a multicast address.
ICMP Error messages are never sent in response to an IGMP message of any kind.
When an ICMP message of unknown type is received, it must be silently discarded.
Routers will almost always generate ICMP messages but when it comes to a destination
host(s), the number of ICMP messages generated is implementation dependent.
From a closer look at the various rules, we can conclude that a thought about a “network storm”,
and extra network traffic were behind most of the ICMP protocol special conditions.
A number code, also known as the “message type”, is assigned to each ICMP message; it
specifies the type of the message.
Another number code represents a “code” for the specified ICMP type. It acts as a sub-type, and
its interpretation is dependent upon the message type.
The ICMP protocol has two types of operations; therefore its messages are also divided to two:
The Internet Assigned Numbers Authority (IANA) has a list defining the ICMP message types that
are currently registered. It also lists the RFC that defines the ICMP message. The list is available
at: http://www.isi.edu/in-notes/iana/assignments/icmp-parameters.
2
ICMP Error messages can be sent for ICMP Query messages, when generating a non-transient error condition.
14
3
RFC 972 defines codes 1-5. RFC 1122 defines codes 6-12. RFC 1812 defines codes 13-15.
4
Reserved for use by U.S. military agencies.
5
Reserved for use by U.S. military agencies.
6
Reserved for use by U.S. military agencies.
15
33 IPv6 Where-Are-You
34 IPv6 I-Am-Here
The ICMP messages differ in structure and formatting because of their different functionality. The
general ICMP message format is defined by the next figure:
0 4 8 16 31
4 bit
4 bit 8-bit type of service
Header 16-bit total length ( in bytes )
Version Length (TOS)=0
3 bit
16-bit identification 13-bit Fragment Offset
Flags
Options ( if any )
0 4 8 16 31
Unused 4 bytes
Some fields within the ICMP Error messages are always sent:
7
There might be more than 8 bytes of data from the offending packet.
8
There might be more than 8 bytes of data from the offending packet being quoted with the ICMP error message.
Therefore the datagram size will be bigger than the usual. I will demonstrate this later in the paper.
17
RFC 792 defines the IP protocol ID for ICMP to be 1. It also states that the IP Type-of-Service
field value and the Precedence Bits value should be equal to zero. According to RFC 1812,
Routers will use the value of 6 or 7 as their IP Precedence bits value with ICMP Error messages.
ICMP Error messages are never sent for another ICMP Error message to prevent infinite
loops.
ICMP error messages are never sent in response to a datagram that is destined to a
broadcast or a multicast address.
ICMP error messages are never sent in response to a datagram sent as a link layer
broadcast.
ICMP error messages are never sent in response to a datagram whose source address
does not represents a unique host – the source IP address cannot be zero, a loopback
address, a broadcast address or a multicast address.
ICMP Error messages are never sent in response to an IGMP massage of any kind.
The conditions for issuing error messages by Routers and Host(s) differ. Therefore I will outline
the conditions for issuing the error messages separately.
15 Precedence cutoff in effect The network operators have imposed a minimum level
of precedence required for operation, the datagram was
sent with precedence below this level.
* Routers may have a configuration option that causes code 13 messages not to be generated. When this option is
enabled, no ICMP error message is sent in response to a packet that is dropped because it’s forwarding is
administratively prohibited. Same is with type 14 & 15.
19
0 4 8 16 31
Figure 3: ICMP Fragmentation Needed but the Don’t Fragment Bit was set Message Format
The Unused field will be 16 bits in length, instead of 32 bits, with this type of message. The rest of
the 16 bits will be used to carry the MTU (Maximum Transfer Unit) used for the link that could not
deliver the datagram to the next hop (or destination) because the size of the datagram was too
big to carry. Since this datagram could not be fragmented (the DF Bit was set) an error message
has been sent to the sender indicating that a lower MTU should be used, hinting the size of the
next hops links.
The Error message indicates that the destination system is configured to reject datagrams from
the sending system. This error is used when datagrams based on some sort of criteria are being
filtered by a filtering device (firewall/router/other filtering devices) restrictions or other security
measures.
We can conclude that our Destination Host is up and running, but we cannot reach it, since the
filtering device is blocking our packets, and is instructing us to stop sending datagrams.
With the next example a router is configured to block all requests, coming from the Internet,
targeting port 53 on the destination machine it applies its ACL on:
20
RFC 1812 specify that a router should not generate Source Quench messages, but a router that
does originate Source Quench message must be able to limit the rate at which they are
generated (because it consumes bandwidth and it is an ineffective antidote to congestion).
With the next example an HPUX B.11.0 based machine issued an ICMP Source Quench error
message:
A routing loop is generated when the router IP address matches the source IP address in the
original datagram header.
Routers must not generate a Redirect Message unless all the following conditions are met:
The packet is being forwarded out the same physical interface that it was received from,
The IP source address in the packet is on the same Logical IP (Sub) network as the next-
hop IP address, and
21
0 4 8 16 31
Code Meaning
The Redirect message should be silently discarded with the following cases:
The new gateway address it specifies is not on the same connected (sub-) net through
which the Redirect arrived.
If the source of the Redirect is not the current first-hop gateway for the specified
destination.
9
A Router cannot differentiate between an ICMP Redirect coming from a Router, and between an ICMP Redirect coming
from a Host. This is infect a good example of relying upon OS implementation to be according to the RFC guideline.
22
The field value is decreased at each point that the Internet header (IP Header) is being
processed. RFC 791 states that this field decreasement reflects the time spent processing the
datagram. The field value is measured in units of seconds. The RFC also states that the
maximum time to live value can be set to 255 seconds, which equals 4.25 minutes. The datagram
must be discarded if this field value equals zero - before reaching its destination.
Relating to this field as a measure to assess time is a bit misleading. Some routers may process
the datagram faster than a second, and some may process the datagram longer than a second
(heavy load situations).
The real intention is to have an upper bound to the datagram’s lifetime, so infinite loops of
undelivered datagrams will not jam the Internet.
Having a bound to the datagram’s lifetime help us to prevent old duplicates to arrive after a
certain time elapsed. So when we retransmit a piece of information which was not previously
delivered we can be assured that the older duplicate is already discarded and will not interfere
with the process.
If a router discovers that the Time-To-Live field in an IP header of a datagram he process equals
zero he will discard the datagram and generate an ICMP Time Exceeded Code 0 – Time-To-Live
Exceeded in Transit (this can also be an indicator of a routing loop problem).
A router must generate an ICMP Time Exceeded message code 0 when it discards a packet due
to an expired TTL field. A router may have a per-interface option to disable origination of these
messages on that interface, but that option must default to allowing the messages to be
originated.
In the next example, after an attempt to ‘ping’ a certain IP (y.y.y.y), we received an ICMP Time-to-
Live Exceeded in transit error message from a Router in route to the destination IP address. The
Time-to-Live field value has been expired:
23
On the sending host - When an application or a transport layer protocol request to send
more data than a single IP datagram the underlying network can carry.
A Router along the path to the destination - When packets move from a network with a
higher MTU onto a network with a small MTU.
Each fragment is being transported by a different packet. Therefore each fragment will be routed
independently. All fragments will share a common IP identification value in the IP header (helping
the reassembly process). Each fragment will carry a unique byte offset value helping to place its
carried data in the correct order when reassembly occurs. Except for the last fragment, each
fragment will set the MF bit (more fragments) so the receiving host will understand that there are
more fragments coming.
The entire datagram must be completely reassembled by the receiving host before it will be
handed off to higher levels of the protocol stack.
If a host cannot reassemble a fragmented datagram due to missing fragments within its time limit
it will discard the datagram and generate an ICMP Time Exceeded Code 1 – Fragment
Reassembly Time Exceeded.
Code Meaning
The ICMP Parameter Problem error message is generated usually for any error in the IP header
not specifically covered by another ICMP message.
If code 0 is used, the pointer field will point to the exact byte in the original IP Header, which
caused the problem (see figure 5).
0 4 8 16 31
All ICMP Query messages share some characteristics that are summarized in the figure below:
0 4 8 16 31
The type, code and checksum fields are common to all ICMP message types.
25
The identifier field is used to differentiate between ICMP query messages sent to different hosts.
When initiating an ICMP query request each host receives its own identifier field value.
The sequence number field is used to differentiate between the ICMP query messages sent to
the same host.
The fields following are dependent upon the ICMP query message type.
Data / Additional Fields Variable The fields following are dependent upon the
ICMP query message type.
The Length of an ICMP query message type varies from one query message type to another. The
ICMP Header will be always 4 bytes. The size of the ICMP Identifier field and the size of the
ICMP Sequence Number field will always be the same as well. The only variable in our equation
is the additional field’s length (that will vary from one ICMP query message type to another).
RFC 792 defines the IP protocol ID for ICMP to be 1. RFC 1122 states that the IP Type-of-
Service field value and the Precedence Bits value should be equal to zero. It also states that if a
user wishes to set these fields to a different value, than the response (the reply) must use the
same IP Type-of-Service and Precedence Bits values, which were used with the ICMP query
message.
10
Router Solicitation (Type 10), and Router Advertisement (Type 9) is also considered to be an ICMP Query message
type.
26
The only ICMP query message type, which is common with all operating systems, is the ICMP
Echo request. RFC 1122 states that every host should implement an end-user-accessible
application interface for sending ICMP Echo request query messages to other hosts.
From a technical point of view: The sending side initializes the identifier (used to identify Echo
requests aimed at different destination hosts) and sequence number (if multiple Echo requests
are sent to the same destination host), adds some data (arbitrary) to the data field and sends the
ICMP Echo to the destination host. In the ICMP header the code equals zero. The recipient
should only change the type to Echo Reply, recalculate the ICMP header Checksum, and return
the datagram to the sender.
The data received in the Echo message must be returned in the Echo Reply message
unchanged.
This mechanism is used by the Ping utility to determine if a destination host is reachable.
0 4 8 16 31
Data...
The expected behavior from a router/host when handling an ICMP Echo type message is11:
A router should have a configuration option that, if enabled, causes the router to silently
ignore all ICMP Echo requests; if provided, this option must be default to allowing
responses.
Every host/router must implement an ICMP Echo server function that receives Echo
requests and sends corresponding Echo Replies.
11
RFC 1122 requirements for Internet Hosts (http://www.ietf.org/rfc/rfc1122.txt) -- Communication Layers. RFC 1812
Requirements for IP version 4 Routers (http://www.ietf.org/rfc/rfc1812.txt).
27
If a Record Route and/or Timestamp option is received in an ICMP Echo request, this
option (these options) should be updated to include to current router/destination host
and included in the IP header of the Echo Reply message, without truncation. Thus, the
record route will be for the entire round trip.
If a Source Route option is received in an ICMP Echo request, the return route must be
reversed and used as a source route option for the Echo Reply message. A router will
not perform this if it is aware of a policy that would prevent the delivery of the message.
The ‘ping’ utility with UNIX and UNIX-like operating systems will use an ICMP data field of 56
bytes, adding that to the 20 bytes of the IP header and to the ICMP header (8 bytes) will result in
a datagram size of 84 bytes.
The ‘ping’ utility with Microsoft Windows operating systems will build, by default, an ICMP Echo
request datagram with the size of 60 bytes. This is since the ‘ping’ utility is using a data field of 32
bytes only.
2.2.2.2 Timestamp Request (Type 13) and Timestamp Reply (Type 14)
The ICMP Time Stamp Request and Reply allows a node to query another for the current time.
This allows a sender to determine the amount of latency that a particular network is experiencing.
The sender initializes the identifier (used to identify Timestamp requests aimed at different
destination hosts) and sequence number (if multiple Timestamp requests are sent to the same
destination host), sets the originate time stamp and sends it to the recipient.
The receiving host fills in the receive and transmit time stamps, change the type of the message
to time stamp reply and returns it to the recipient. The time stamp is the number of milliseconds
elapsed since midnight UT (GMT).
The originate time stamp is the time the sender last touched the message before sending it, the
receive time stamp is the time the recipient first touched it on receipt, and the Transmit time
stamp is the time the receiver last touched the message on sending it.
0 4 8 16 31
Originate timestamp
Receive timestamp
Transmit timestamp
As RFC 1122 state, a host/router may implement Timestamp and Timestamp Reply. If they are
implemented a Host/Router must follow these rules:
The ICMP Timestamp message should be between 40 to 60 bytes long. Combined from the IP
header (20-40 bytes), the ICMP header (4 bytes), and the ICMP Timestamp related fields (16
bytes).
In the next example I have issued an ICMP Timestamp request from a host running Linux Kernel
2.4 (172.18.2.201), to another Linux based host running Linux Kernel 2.2.16 (172.18.2.200)12.
The sender (a host) fills in the request with the Destination IP address in the IP Header set to
zero (meaning this network). The request may be sent with both Source IP Address and
Destination IP Address set to zero. The sender initializes the identifier and the sequence number,
both used to match the replies with the requests, and sends out the request. The ICMP header
code field is zero.
If the request was issued with a non-zero Source IP Address the reply would only contain the
network address in the Source IP Address of the reply. If the request had both the Source IP
Address and the Destination IP Address set to zero, the reply will contain the network address in
both the source and destination fields of the IP header.
12
I was using the sing utility (http://www.sourceforge.net/projects/sing) to generate the ICMP Timestamp request.
29
From the description above one can understand that the ICMP Information request and reply
mechanism was intended to be used locally.
The RARP, BOOTP & DHCP protocols provide better mechanisms for hosts to discover its own
IP address.
0 4 8 16 31
The ICMP Information request & reply messages are combined from the IP header (20-40 bytes),
the ICMP header (4 bytes), and the ICMP Identifier and Sequence number fields (4 bytes).
Therefore an ICMP Information request or reply message should be between 28 to 48 bytes long.
The Information Request & Reply mechanism is now obsolete as stated in RFC 1122, and RFC
181213. A router should not originate or respond to these messages; a host should not implement
these messages.
2.2.2.4 ICMP Address Mask Request (Type 17) and Reply (Type 18)
The ICMP Address Mask Request (and Reply) is intended for diskless systems to obtain its
subnet mask in use on the local network at bootstrap time. Address Mask request is also used
when a node wants to know the address mask of an interface. The reply (if any) contains the
mask of that interface.
Once a host has obtained an IP address, it could than send an Address Mask request message
to the broadcast address of the network they reside on (255.255.255.255). Any host on the
network that has been configured to send address mask replies will fill in the subnet mask,
change the type of the message to address mask reply and return it to the sender.
RFC 1122 states that the Address Mask request & reply query messages are entirely optional.
0 4 8 16 31
Figure 10: ICMP Address Mask Request & Reply message format
13
RFC 1812: Requirements for IP Version 4 Routers, http://www.ietf.org/rfc/rfc1812.txt . As the RFC states this
mechanism is now obsolete - A router should not originate or respond to these messages; A host should not implement
these messages.
30
RFC 1122 also states that a system that has implemented ICMP Address Mask messages must
not send an Address Mask Reply unless it is an authoritative agent for address masks.
Usually an Address Mask request would be answered by a gateway (router or a host acting as a
router).
Please note that a Router must implement ICMP Address Mask messages. This will help identify
routers along the path to the targeted network (it can also reveal internal routers if this kind of
traffic is allowed to reach them).
If the Router is following RFC 1812 closely, it should not forward on an Address Mask Request to
another network.
An ICMP Address Mask request or reply message is combined from the IP header (20-40 bytes),
the ICMP header (4 bytes), and the address mask related fields (8 bytes). Therefore the ICMP
address mask request/reply message should be between 32 to 52 bytes long.
A router must implement support for receiving ICMP Address Mask Request messages
and responding with ICMP Address Mask Reply messages.
A router should have a configuration option for each logical interface specifying whether
the router is allowed to answer Address Mask Requests for that interface; this option
must default to allowing responses.
A router must not respond to an Address Mask Request before the router knows the
correct address mask.
A router must not respond to an Address Mask Request that has a source address of
0.0.0.0 and which arrives on a physical interface that has associated with it multiple
logical interfaces and the address masks for those interfaces are not all the same.
A router should examine all ICMP Address Mask Replies that it receives to determine
whether the information it contains matches the router's knowledge of the address mask.
If the ICMP Address Mask Reply appears to be in error, the router should log the
address mask the sender's IP address. A router must not use the contents of an ICMP
Address Mask Reply to determine the correct address mask.
Because hosts may not be able to learn the address mask if a router is down when the host boots
up, a router may broadcast a gratuitous ICMP Address Mask Reply on each of its logical
interfaces after it configured its own address masks. However, this feature can be dangerous in
environments that use variable length address masks. Therefore, if this feature is implemented,
gratuitous Address Mask Replies must not be broadcast over any logical interface(s) which either:
Are not configured to send gratuitous Address Mask Replies. Each logical interface must
have a configuration parameter controlling this, and that parameter must default to not
sending the gratuitous Address Mask Replies.
Share subsuming (but not identical) network prefixes and physical interface.
Obtaining the address mask(s) dynamically as a side effect of the system initialization
process; and
Sending ICMP Address Mask Request(s) and receiving ICMP Address Mask Reply(s).
When the last method (Sending ICMP Address Mask Request(s) and receiving ICMP Address
Mask Reply(s)), the use of Address Mask messages, is enabled, then:
When it initializes, the host must broadcast an Address Mask Request message on the
connected network corresponding to the IP address. It must retransmit this message a
small number of times if it does not receive an immediate Address Mask Reply.
Until it has received an Address Mask Reply, the host should assume a mask appropriate
for the address class of the IP address, i.e., assume that the connected network is not
subnetted.
The first Address Mask Reply message received must be used to set the address mask
corresponding to the particular local IP address. This is true even if the first Address
Mask Reply message is "unsolicited", in which case it will have been broadcast and may
arrive after the host has ceased to retransmit Address Mask Requests. Once the mask
has been set by an Address Mask Reply, later Address Mask Reply messages MUST be
(silently) ignored.
Conversely, if Address Mask messages are disabled, then no ICMP Address Mask Requests will
be sent, and any ICMP Address Mask Replies received for that local IP address must
be (silently) ignored.
A system must not send an Address Mask Reply unless it is an authoritative agent for address
masks. An authoritative agent may be a host or a gateway, but it must be explicitly as an address
mask agent. Receiving an address mask via an Address Mask Reply does not give the receiver
authority and must not be used as the basis for issuing Address Mask Replies.
With a statically configured address mask, there should be an additional configuration flag that
determines whether the host is to act as an authoritative agent for this mask, i.e., whether it will
answer Address Mask Request messages using this mask.
If it is configured as an agent, the host must broadcast an Address Mask Reply for the mask on
the appropriate interface when it initializes.
14
RFC 1191, http://www.ietf.org/rfc/rfc1191.txt, J. Mogul, S. Deering.
32
When one host needs to send data to another host, the data is transmitted in a series of IP
datagrams. We wish the datagrams be the largest size possible that does not require
fragmentation15 along the path from the source host to the destination host.
If one fragment from a packet is dropped, we need to retransmit the whole packet.
Load on the routers, which needs to do the fragmentation.
Some simpler firewalls would block all fragments because they do not contain the header
information for a higher layer protocol needed for filtering.
The Maximum Transfer Unit (MTU) is a link layer restriction on the maximum number of bytes of
data in a single transmission. The smallest MTU of any link on the current path between two
hosts is called the Path MTU.
The process can end when the estimated PMTU is low enough for the datagrams not to be
fragmented. The source host itself can stop the process if he is willing to have the datagrams
fragmented in some circumstances.
Usually the DF bit would be set in all datagrams, so if a route changes to the destination host,
and the PMTU is lowered, than we would discover it.
The PMTU of a path might be increased over time, again because of a change in the routing
topology. To detect it, a host should periodically increase its assumed PMTU for that link.
The link MTU field in the ICMP “Fragmentation Needed and DF set” error message, carries the
MTU of the constricting hop, enabling the source host to know the exact value he needs to set the
PMTU for that path to allow the voyage of the datagrams beyond that point (router) without
fragmentation.
The only required behavior is that a host must attempt to avoid sending more messages with the
same PMTU value in the near future. A host can either cease setting the Don’t Fragment bit in the
15
When we send a packet that it is too large to be sent across a link as a single unit, a router needs to slice/split the
packet into smaller parts, which contain enough information for the receiver to reassemble them. This is called
fragmentation.
33
IP header (and allow fragmentation by the routers in the way) or reduce the datagram size. The
better strategy would be to lower the message datagram size because fragmentation will cause
more traffic and consume more Internet resources.
A host using the PMTU Discovery process must detect decreases in Path MTU as fast as
possible. A host may detect increases in Path MTU, by sending datagrams larger than the current
estimated PMTU, which will usually be rejected by some router on the path to a destination since
the PMTU usually will not increase. Since this would generate traffic back to the host, the check
for the increases must be done at infrequent intervals. The RFC specify that an attempt for
detecting an increasment must not be done less than 10 minutes after a datagram “too big” has
been received for the given destination, or less than 2 minute after a previously successful
attempt to increase.
The sending host must know how to handle an ICMP “Fragmentation Needed and the DF bit was
set” error message that was sent by a device who does not know how to handle the PMTU
protocol and does not include the next-hop MTU in the error message. Several strategies are
available:
The PMTU should be set to the minimum between the currently assumed PMTU and
57616. The DF bit should not be set in future datagrams for that path.
Searching for the accurate value for the PMTU for a path. We keep sending datagrams
with the DF bit set with lowered PMTU until we do not receive ICMP errors.
A host must not reduce the estimation of a Path MTU value below 68 bytes.
A host must not increase its estimate of the Path MTU in response to the contents of a Datagram
Too Big message.
0 8 16 31
16
The usage of the lesser between 576 and the first-hop MTU as the PMTU for a destination, which is not connected to
the same network was the old implementation. The results were the use of smaller datagrams than necessary, waste of
Internet resources, and not being optimal.
34
The value of the next-hop MTU field should be set to the size in bytes of the largest datagram that
could be forwarded, along the path of the original datagram, without being fragmented by this
router. The size includes IP header plus IP data and no lower level headers should be included.
Because every router should be able to forward a datagram of 68 bytes without fragmenting it,
the link MTU field should not contain a value less than 68.
2.3.4 The TCP MSS (Maximum Segment Size) Option and PATH MTU
Discovery Process
The RFC specify that a host that is doing Path MTU Discovery must not send datagrams larger
than 576 bytes unless the receiving host grants him permission.
When we are establishing a TCP connection both sides announce the maximum amount of data
in one packet that should be sent by the remote system – The maximum segment size, MSS (if
one of the ends does not specify an MSS, it defaults to 536 – there is no permission from the
other end to send more than this amount). The packet generated would be, normally, 40 bytes
larger than the MSS; 20 bytes for the IP header and 20 bytes for the TCP header. Most systems
announce an MSS that is determined from the MTU on the interface that the traffic to the remote
system passes out from the system through.
Each side upon receiving the MSS of the other side should not send any segments larger than
the MSS received, regardless of the PMTU. After receiving the MSS value the Path MTU
Discovery process will start to take affect. We will send our IP packets with the DF bit set allowing
us to recognize points in the path to our destination that cannot process packets larger as the
MSS of the destination host plus 40 bytes. When such an ICMP error message arrives, we should
lower the PMTU to a path (according to the link MTU field, or if not used, to use the rules
regarding the old implementation) and retransmit. The value of the link MTU cannot be higher
than the MSS of the destination host. When retransmission occurs resulting from ICMP type 3
code 4 error message, the congestion windows should not change, but slow start should be
initiated. The process continues until we adjust the correct PMTU of a path (not receiving ICMP
error messages from the intermediate routers) which will allow us to fragment at the TCP layer
which is much more efficient than at the IP layer.
35
In this section I will go over basic Host Detection methods using the ICMP protocol. I will also
introduce you with several techniques in doing so.
There are no internal OS built tools to generate ICMP query request messages. We will use 3rd
party applications/utilities to do so. The OS Kernel implementation of the different ICMP query
mechanisms is usually being called by the OS and not triggered by a user. If the ICMP query and
reply mechanism is enabled than the OS Kernel will be the one to answer a query. We can
examine the Address Mask request and reply mechanism for a good example.
This mechanism is used by the ‘ping’ utility to determine if a destination host is reachable.
In the next example two Linux machines demonstrate the usage of ping. One is based on Kernel
2.4.2 (172.18.2.201), and one is based on Kernel 2.2.16 (172.18.2.200):
17
For more information about the ICMP Protocol please refer to Section 2.0: “The ICMP Protocol”.
18
From a technical point of view: The sending side initializes the identifier (used to identify Echo requests aimed at
different destination hosts) and sequence number (if multiple Echo requests are sent to the same destination host), adds
some data (arbitrary) to the data field and sends the ICMP Echo to the destination host. In the ICMP header the code
equals zero. The recipient should only change the type to Echo Reply and return the datagram to the sender.
36
0 4 8 16 31
Data...
Countermeasure: Block ICMP Echo requests coming from the Internet towards your network at
your border router and/or Firewall20. You can also configure your host(s) not to answer ICMP
Echo Requests.
19
Snort, written by Martin Roesch, can be found at http://www.snort.org.
20
It is better to filter unwanted traffic at your border router, reducing traffic rates for your firewall.
37
For a small to midsize network the ‘ping’ utility is an acceptable solution to this kind of host
detection, but with large networks (such as Class A, or a full Class B) this kind of scan is fairly
slow mainly because ‘ping’ waits for a reply (or a time out to be reached) from the questionable
IP address before proceeding to the next targeted IP address.
fping21 is a UNIX utility which sends parallel mass ICMP Echo requests in a round robin fashion
enabling it to be significantly faster than the usual ‘ping’ utility. It can also be fed with IP
addresses with its accompanied tool gping. gping is used to generate a list of IP addresses
which would be later fed into fping, directly or from a file, to perform the ICMP sweep. fping is
also able to resolve hostnames of the probed machines if using the –d option.
Another UNIX tool that is able of doing an ICMP sweep in parallel, resolve the hostnames of the
probed machines, save it to a file and a lot more is nmap22, written by Fyodor.
For the Microsoft Windows operating system a notable ICMP sweep tool is Pinger from
Rhino923, able of doing what fping and nmap do regarding this kind of scan.
Trying to resolve the names of the probed machines may discover the malicious computer
attacker’s IP address used for the probing, using the log of the authoritative DNS server of the
targeted network.
The next example demonstrates the usage of nmap to perform an ICMP sweep against a calss C
network. Our test lab contains several Microsoft Windows 2000 based machines, some Linux
based machines, and couple of networking devices.
The –sP option instructs nmap to perform a ‘ping scan’. The –PI option instructs nmap to send
only true ICMP Echo requests. The default behavior when using the –sP option is to include the
usage of TCP ACK host detection technique with ‘regular’ ICMP Echo requests.
15
ftp://ftp.tamu.edu/pub/Unix/src
22
http://www.insecure.org
23
The Rhino9 group no longer exists. Their tools are available from a number of sites on the Internet.
38
nmap will try to resolve host names by default. When it will fail we will see only the IP address in
the output. If nmap succeed to resolve the IP address to a name than we will see both the name
and the IP address of the target in the output.
We can see that the results where produced faster without resolving.
ICMP sweeps should be easily detected by an intrusion detection systems (IDS) whether
launched in the regular way, or if used in a parallel way.
Countermeasure: Block ICMP Echo requests coming from the Internet towards your network at
your border router and/or Firewall. You can also configure your host(s) not to answer ICMP Echo
Requests.
The request would be broadcasted to all hosts on the targeted network. The alive hosts will send
an ICMP Echo reply to the prober’s source IP address (additional conditions apply here).
The malicious computer attacker has to send only one packet to produce this behavior.
This technique of host detection is applicable only to some of the UNIX and UNIX-like operating
systems. Microsoft Windows based machines will not generate an answer (ICMP Echo reply) to
an ICMP Echo request aimed at the broadcast address or at the network address of the network
they reside on. They are configured not to answer those queries out-of-the box (This applies to all
Microsoft Windows operating systems accept for Microsoft Windows NT 4.0 with service pack
39
below SP4). This is not an abnormal behavior as RFC 112224 states that if we send an ICMP
Echo request to an IP Broadcast or IP Multicast addresses it may be silently discarded by a host.
The next example demonstrates the behavior expected from hosts when sending an ICMP Echo
request to the broadcast address of the network they reside on. The Linux based hosts on our
test lab answered the query (172.18.2.200, 172.18.2.201), as well as the networking devices
(172.18.2.29, 172.18.2.254). The Microsoft Windows 2000, and Microsoft Windows 2000 with
SP1, silently ignored the request:
In the next example I have sent an ICMP Echo request to the network address of the targeted
network. Here we can see that a slightly different behavioral pattern was produced. The Linux
machines, and the Cisco Catalyst 6500 switch (172.18.2.254) answered our query while the other
networking device did not produce an answer this time:
24
RFC 1122: Requirements for Internet Hosts - Communication Layers, http://www.ietf.org/rfc/rfc1122.txt.
40
Note: Broadcast ICMP may result in a Denial-Of-Service condition if a lot of machines will
respond to the query at once.
A more accurate table that lists which operating systems would answer to an ICMP Echo request
aimed at their Network / Broadcast address is given below:
Broadcast
FreeBSD 4.0 -
FreeBSD 3.4 -
OpenBSD 2.7 -
OpenBSD 2.6 -
NetBSD
Solaris 2.5.1 +
Solaris 2.6 +
Solaris 2.7 +
Solaris 2.8 +
HP-UX v10.20 +
Windows 95 -
Windows 98 -
Windows 98 SE -
Windows ME -
Windows NT 4 WRKS SP 3 -
Windows NT 4 WRKS SP 6a -
Windows NT 4 Server SP4 -
Windows Family (including SP1) -
Table 10: Which Operating Systems would answer to an ICMP ECHO Request aimed at the Broadcast
Address of the Network they reside on?
Countermeasure: Block the IP directed broadcast on your border router. You can also configure
your host(s) not to answer ICMP Echo Requests aimed at the Broadcast Address of the Network
they reside on.
41
Non-ECHO ICMP messages are being used for more advanced ICMP scanning techniques (not
only probing hosts, but network devices, such as a router, as well).
3.4.1 ICMP Time Stamp Request (Type 13) and Reply (Type 14)
The ICMP Time Stamp Request and Reply allows a node to query another for the current time.
This allows a sender to determine the amount of latency that a particular network is experiencing.
The sender initializes the identifier (used to identify Timestamp requests aimed at different
destination hosts) and sequence number (if multiple Timestamp requests are sent to the same
destination host), sets the originate time stamp and sends it to the recipient.
The receiving host fills in the receive and transmit time stamps, change the type of the message
to time stamp reply and returns it to the recipient. The time stamp is the number of milliseconds
elapsed since midnight UT (GMT).
The originate time stamp is the time the sender last touched the message before sending it, the
receive time stamp is the time the recipient first touched it on receipt, and the Transmit time
stamp is the time the receiver last touched the message on sending it.
0 4 8 16 31
Originate timestamp
Receive timestamp
Transmit timestamp
Figure 15: ICMP Time Stamp Request & Reply message format
As RFC 1122 state, a host may implement Timestamp and Timestamp Reply. If they are
implemented a host must follow this rules:
Receiving an ICMP Timestamp Reply would reveal an alive host (or a networking device) that has
implemented the ICMP Timestamp messages.
In the next example I have sent an ICMP Timestamp request, using the sing25 utility, from a
Linux host based on Kernel 2.4.2, to a host running Microsoft Windows 2000 professional. We
are using the –c option to instruct sing how many requests it should send.
Most of the operating systems have implemented the ICMP Timestamp request and reply
mechanism. When I have sent an ICMP Timestamp request to a Windows NT 4 SP6a based
machine, I got no reply. Again, this is not an abnormal behavior from the Microsoft Windows NT
machine, just an implementation choice as RFC 1122 states.
Countermeasure: Block ICMP Time Stamp Requests coming from the Internet on the border
Router and/or Firewall. If possible configure your host(s) to ignore ICMP Timestamp requests.
3.4.2 ICMP Information Request (Type 15) and Reply (Type 16)
The ICMP Information Request/Reply pair was intended to support self-configuring systems such
as diskless workstations at boot time, to allow them to discover their network address.
The sender fills in the request with the Destination IP address in the IP Header set to zero
(meaning this network). The request may be sent with both Source IP Address and Destination IP
25
Sing, written by Alfredo Andreas Omella, can be found at www.sourceforge.net/projects/sing.
43
Address set to zero. The sender initializes the identifier and the sequence number, both used to
match the replies with the requests, and sends out the request. The ICMP header code field is
zero.
If the request was issued with a non-zero Source IP Address the reply would only contain the
network address in the Source IP Address of the reply. If the request had both the Source IP
Address and the Destination IP Address set to zero, the reply will contain the network address in
both the source and destination fields of the IP header.
From the description above one can understand that the ICMP Information request and reply
mechanism was intended to be used locally.
The RARP, BOOTP & DHCP protocols provide better mechanisms for hosts to discover its own
IP address.
0 4 8 16 31
The Information Request & Reply mechanism is now obsolete as stated in RFC 1122, and RFC
181226. A router should not originate or respond to these messages; A host should not implement
these messages.
RFC 792 specifies that the Destination IP address should be set to zero, this mean that hosts that
do not reside on the same network cannot send these ICMP query type.
But what would happen if we would send an ICMP Information Request with the Destination IP
address set to a specific IP address of a host out in the void?
The next example illustrates that some operating systems would answer these queries even if not
issued from the same network. The ICMP Information Request queries we are sending are not
really RFC compliant because of the difference in the Destination IP address.
Those operating systems that answer our queries work in contrast to the RFC guidelines as well.
We would see in the next example why.
In the next example I have sent an ICMP Information Request, using the sing utility, to an IBM
AIX machine:
26
RFC 1812: Requirements for IP Version 4 Routers, http://www.ietf.org/rfc/rfc1812.txt . As the RFC states this
mechanism is now obsolete - A router should not originate or respond to these messages; A host should not implement
these messages.
27
Since I have queried a production system for this test, with a permission of the owners, I do not wish to identify it.
44
45
Instead of having the network address in the Source IP Address we are getting the IP address of
the host.
Does the reply compliant with RFC 792 regarding this issue? Basically yes, because the RFC
does not specify an accurate behavior.
The RFC states: “To form a information reply message, the source and destination addresses are
simply reversed, the type code changes to 16, and the checksum recomputed”.
This means that if the ICMP Information Request is coming from outside (Destination is not zero)
of the network in question, the network address would not be revealed. But still a host could be
revealed if he answers the request.
The request is not compliant with the RFC in my opinion because it does not fulfill its job – getting
the network address.
Countermeasure: Block ICMP Information Requests coming from the Internet on the border
Router and/or Firewall.
3.4.3 ICMP Address Mask Request (Type 17) and Reply (Type 18)
The ICMP Address Mask Request (and Reply) is intended for diskless systems to obtain its
subnet mask in use on the local network at bootstrap time. Address Mask request is also used
when a node wants to know the address mask of an interface. The reply (if any) contains the
mask of that interface.
Once a host has obtained an IP address, it could than send an Address Mask request message
to the broadcast address of the network they reside on (255.255.255.255). Any host on the
network that has been configured to send address mask replies will fill in the subnet mask,
change the type of the message to address mask reply and return it to the sender28.
RFC 1122 states that the Address Mask request & reply query messages are entirely optional.
28
The usage of ICMP Address Mask request and reply mechanism was intended to be used on the local network the
querying host resides on, only.
46
0 4 8 16 31
Figure 17: ICMP Address Mask Request & Reply message format
RFC 1122 also states that a system that has implemented ICMP Address Mask messages must
not send an Address Mask Reply unless it is an authoritative agent for address masks.
Receiving an Address Mask reply from a host would reveal an alive host that is an authoritative
agent for address masks. It will also allow a malicious computer attacker to gain knowledge about
your network’s configuration. This information can assist the malicious computer attacker in
determining your internal network structure, as well as the routing scheme.
Please note that a Router must implement ICMP Address Mask messages. This will help identify
routers along the path to the targeted network (it can also reveal internal routers if this kind of
traffic is allowed to reach them).
If a Router is following RFC 1812 closely, it should not forward on an Address Mask request to
another network.
When I have tried to map which operating systems would answer (if at all) to an ICMP Address
Mask requests, I have discovered that Sun Solaris is very cooperative with this kind of query:
47
We get another piece of information, not just the fact the host is reachable, but the address mask
of the network the host resides on. Looking at the last example, we can conclude that the IP
range of the network the host resides on is 172.18.1.1-255. Other reachable hosts might be out
there…
Our last two examples are ICMP Address Mask requests aimed at a switch and at a router (which
must implement ICMP Address Mask messages).
The following is an ICMP Address Mask request targeting a Cisco Catalyst 5505 with OSS v4.5:
The last example is an ICMP Address Mask request sent to an Intel 8100 ISDN Router on
another test network:
48
Countermeasure: Block ICMP Address Mask Requests coming from the Internet on the border
Router and/or Firewall. If possible configure your host(s) to ignore ICMP Address Mask requests.
Given the conditions above, which host(s) would answer our queries?
Operating System Info. Request Time Stamp Request Address Mask Request
FreeBSD 4.0 - + -
FreeBSD 3.4 - + -
OpenBSD - + -
NetBSD
49
Operating System Info. Request Time Stamp Request Address Mask Request
Solaris 2.5.1 - + +
Solaris 2.6 - + +
Solaris 2.7 - + +
Solaris 2.8 - + +
HP-UX v10.20 + + -
AIX v4.x + + -
ULTRIX 4.2 – 4.5 + + +
Windows 95 - - +
Windows 98 - + +
Windows 98 SE - + +
Windows ME - + -
Windows NT 4 WRKS SP 3 - - +
Windows NT 4 WRKS SP 6a -
Windows NT 4 Server SP 4 - - -
Windows 2000 Professional - + -
Windows 2000 Server - + -
Networking Devices Info. Request Time Stamp Request Address Mask Request
Table 11: non-ECHO ICMP Query of different Operating Systems and Networking Devices
Countermeasure: Block ICMP Information Requests, ICMP Address Mask Requests & ICMP
Time Stamp Requests coming from the Internet on the border Router and/or Firewall.
The request would be broadcasted to all listening hosts on the targeted network.
50
Given the conditions above, the answering hosts would almost always be UNIX and UNIX-like
operating systems. Sun Solaris, HPUX, and Linux are the only operating systems, from the group
of operating systems I have tested, that will answer to an ICMP Timestamp request aimed at the
broadcast address of a network. HPUX would answer Information requests aimed at the
broadcast address of a network. Non will answer to an ICMP Address Mask request aimed at the
broadcast address of a network.
Operating System Info. Request Time Stamp Request Address Mask Request
FreeBSD 4.0 - - -
FreeBSD 3.4
OpenBSD 2.7 - - -
OpenBSD 2.6 - - -
NetBSD
Solaris 2.5.1 - + -
Solaris 2.6 - + -
Solaris 2.7 - + -
Solaris 2.8 - + -
HP-UX v10.20 + + -
AIX 4.x
Windows 95
Windows 98 - - -
Windows 98 SE - - -
Windows ME - - -
Windows NT 4 WRKS SP 3 - - -
Windows NT 4 WRKS SP 6a
Windows NT 4 Server SP 4 - - -
Windows 2000 Professional (& SP1) - - -
Windows 2000 Server (& SP1) - - -
Table 12: Operating Systems, which would answer to requests, aimed at the Broadcast address
Networking Devices Info. Request Time Stamp Request Address Mask Request
Table 13: Networking Devices, which would answer to requests, aimed at the Broadcast address
51
Countermeasure: Block the IP directed broadcast on the border router. Block ICMP Information
Requests, ICMP Address Mask Requests & ICMP Time Stamp Requests coming from the
Internet on the border Router and/or Firewall.
Sometimes the information with the ICMP error message, or the type of problem it represents will
be more valuable information to the malicious computer attacker than with a usual ICMP query
message reply.
For example receiving an ICMP Host Unreachable error message from a router will educate the
malicious computer attacker that the IP address he tried to reach is either temporary down or not
being used.
Another example might be with an ICMP Destination Unreachable port unreachable error
message sent by the targeted IP address educating the malicious computer attacker that his
attempt to reach a certain UDP port failed – the port is closed (and the targeted IP address is
alive and reachable).
52
The ICMP error message advice the malicious computer attacker that a filtering device is present
and filtering the destination system’s network traffic. The filtering device is configured to block
incoming TCP packets destined for port 53 on the targeted IP address.
It may help the malicious computer attacker to determine the type of the filtering device being
used (whether this is a router/security device/another networking device), and to choose its
tactics accordingly.
We can conclude that our destination host is up and running, but we cannot reach it, since the
filtering device is blocking our packets, and instruct us to stop sending packets.
The ICMP error messages are not being intentionally triggered. They report non-transient error
conditions for network traffic the malicious computer attacker has initiated.
In the next chapter I will discuss some advanced host detection methods based on attempts of
the malicious computer attacker to trigger ICMP Error messages back from targeted IP
addresses.
53
We will force the target to generate an ICMP error message by mangling a certain field value in
our query. We have several field values that we can choose from in order to generate several
different ICMP error messages.
All conditions forced by the query host on the targeted IP address, will force the underlying OS
kernel to issue an ICMP error message. With only one exception, all the error conditions will
always trigger an ICMP error message.
This also lead us to use the advanced host detection methods in order to detect if a filtering
device is present and forcing its filtering rules on the network traffic going to our targeted IP
address (and probably on network traffic targeting the IP range of the network in question). The
targeted host itself can force the filtering (host based firewall, for example), or it can be done by a
networking device, or by another type of security device.
We can use the advanced host detection methods to detect access control lists (ACLs) forced by
a filtering device on the protected network as well.
0 4 8 16 31
4 bit
4 bit 8-bit type of service
Header 16-bit total length ( in bytes )
Version Length
(TOS)=0
3 bit
16-bit identification 13-bit Fragment Offset
Flags
Options ( if any )
To use this method we need to analyze the IP header and to decide what are the field values that
can be mangled in our queries to trigger an ICMP parameter problem error message back from
the targeted IP address (host).
We need to remember that from the list of fields that can be mangled, we need to choose only the
fields, which do not have any other ICMP error message associated with.
54
This will force the targeted IP address to send back an ICMP parameter problem error message
and to reveal its existence. We can receive two types of ICMP parameter problem error
messages:
Code 0 - The pointer field will point to the exact byte in the original IP Header, which
caused the problem, or
Code 2 - is sent when the header length or the total packet length values of the IP
datagram do not appear to be accurate.
RFC 1812 requires a router to validate the following fields when processing a packet29:
Checksum – a router must verify the IP checksum of any packet it received, and must
discard messages containing invalid checksums.
According to RFC 1122 a host should check for validity of the following fields when processing a
packet30:
It is possible to send an IP datagram with mangled IP header field values and still to get routed
without getting dropped in the way to the probed machine. It should be noted that different routers
perform different checks regarding the IP header field values (different implementation and
interpretation of RFC 1812). When a router, because of a bad IP header field value, drops an IP
packet and sends an ICMP parameter problem error message, it may be possible to identify the
manufacture of the router, and to adjust the wrong IP header field value according to a field,
which is not checked by the manufacture of that particular router.
A router may be more forgiving than a host regarding an IP header field value. This may result
from the fact that a router is a vehicle for delivering the IP datagram and a host is the destination
and the place where more processing on the datagram is being done.
The restrictions leave us with a number of fields only; some, which are crucial for our packet to
arrive to its destination, will not be listed here:
The conditions outlined eliminate the usage of this method to a limited number of fields only.
Practically to the header length, total datagram length, and to the IP option field values.
29
RFC 1812 – Requirements for IPv4 Routers, http://www.ietf.org/rfc/rfc1812.txt.
30
RFC 1122 – Requirements for Internet Host, http://www.ietf.org/rfc/rfc1122.txt.
55
Since we are locating the mangled field value in the IP header portion of the packet, we can carry
any protocol with the triggering IP datagram.
This method is very powerful in detecting host(s) on the probed network with direct access from
the Internet, since a host should generate this error message facing the conditions outlined.
Routers must generate the ICMP parameter problem error message as well, this if they are the
target of the probe.
The downside for this method is the detection. Intrusion Detection Systems should alert you
about abnormalities in the attacked network traffic. It is not usual to see coming packets with bad
IP headers field values, or to see ICMP parameter problem error messages leaving your network
as response.
We can use this type of Host Detection method to sweep through the entire IP range of an
organization and get back results, which will map all the hosts (and networking devices) on the
probed network with direct access from the Internet.
Even if a filtering device is protecting the targeted network (or the targeted IP), we can still try to
send these forged packets. This time we will use more logic. We will use an underlying protocol
and port that are likely to be allowed through by the filtering device ACL scheme. We can use for
example TCP with ports 21,25,80; UDP port 53.
This will work because most of the firewalls in the market today will not validate if some field
values are correct. One good example is the total IP datagram length field value. If the firewall
can match its rule base with the query parameters, and its rule base allow the query, than the
query will be allowed, and an error message will be produced31.
An example is given here using the isic utility written by Mike Frantzen32. isic sends randomly
generated packets to a target computer. Its primary uses are to stress test an IP stack, to find
leaks in a firewall, and to test the implementation of Intrusion Detection Systems and firewalls.
The user can specify how often the packets will be fragmented; have IP options, TCP options, an
urgent pointer, etc.
In the next example I have sent 20 packets from a Linux based machine to a Microsoft Windows
NT WRKS 4 SP4 based machine (the –p option with isic). The datagrams were not fragmented
(the -F 0 option with isic) nor bad IP version numbers were sent (the -V 0 option with isic). The
only weird thing sent inside the IP headers was random IP Header length values (the –I 100
option with isic), which have produced ICMP parameter problem Code 2 error message as I
have anticipated.
31
In my opinion Firewalls/Filtering Devices should check the validity of those fields used to elicit the ICMP Parameter
Problem error message and disallow this kind of traffic.
32
http://expert.cc.purdue.edu/~frantzen/
56
An incorrect usage of the IP option field values will almost always trigger an ICMP Parameter
Problem error message.
With this type of query any protocol can be embedded inside the offending packet. We can use all
available combinations of protocols and type of messages (ports for UDP and TCP, type and
code with ICMP), on the entire IP range of a targeted network.
If we will send a bad IP header length value, than most of the firewall in the market today, will
drop the query when they examine it. They will not be able to match their rule base with the
query. This is because some of the parameters the firewall will look for could not be matched, or
they reside beyond the IP header borders. I can name the destination port and source port with
UDP and TCP, or the type and code fields with ICMP for example (if a longer false value is
given).
So IP header length is out of the question. We are left we two IP header field values:
Total Length
IP Options
Some firewalls in the market today, will drop any packet that has an IP option value carried with it.
The reason is that some firewalls will not intelligently parse the IP options.
57
We are left only with the total length field value. The mangled value we should send in this field
should trigger the host to send back an ICMP parameter problem error message. It is also
required that the firewall will be able to access the information it needs to match the packet
against its rule base. This means that a mangled total length field value can be operating only on
the data portion (and beyond) of the underlying protocol used.
If we will claim that the packet is smaller than it really is, than in nearly all cases nothing will
happen. For example we can take an ICMP Echo request query with no data carried with it. It is
still regarded as legitimate traffic (this is the way some tools act, like nmap and hping2).
We can only send a total IP datagram field value that will claim that our packet is bigger than it
really is. The host will try to grab the data from the area, which is not there, and will issue an
ICMP Parameter Problem Code 2 error message back to the querying IP address.
It will pass the firewall (if the ACL allows it), hit the host, and generate the error message back to
the querying IP address.
If we probe the entire IP range of a targeted network with all possible combinations of protocols
and services (ports/types and codes), it would draw us the targeted network topology map, and
will allow us to determine the access list (ACL) a filtering device (if present, and not blocking
outgoing ICMP Parameter Problem error messages) is forcing on the targeted network.
If we will receive a reply from a certain IP address in the targeted network IP range, it will educate
us that we have a host that is reachable from the Internet, with a certain type of ICMP query
message that was embedded inside the offending packet (we get this information back in the
ICMP error message).
It will indicate that the ICMP query message type is allowed through the access control list (ACL)
rules to that certain IP address, and that ICMP parameter problem error messages are allowed to
be sent from the queried IP address to the Internet.
We might have several reasons not to receive an ICMP parameter problem error message back
from the targeted IP address:
The Filtering Device validates the ‘total length’ field value against the actual number
of bytes it receives for that packet.
The Filtering Device is filtering the type of the ICMP message we are using.
The Filtering Device blocks ICMP Parameter Problem error messages initiated from
the protected network destined to the Internet.
58
If we will receive a reply from a certain IP address in the targeted network IP range, it will educate
us that we have a host that is reachable from the Internet, with the TCP/UDP protocol using port z
(the port that was used for that probe) that was embedded inside the offending packet (we get
this information back in the ICMP error message).
It will indicate that the TCP/UDP protocol using port z is allowed through the access control list
(ACL) rules to that certain IP address, and that ICMP Parameter Problem error messages are
allowed to be sent from the queried IP address to the Internet.
We might have several reasons not to receive an ICMP parameter problem error message back
from the targeted IP address:
The Filtering Device validates the ‘total length’ field value against the actual number
of bytes it receives for that packet.
The Filtering Device filters the Protocol used.
The Filtering Device is filtering the specific port we are using for the probe.
The Filtering Device blocks ICMP Parameter Problem error messages initiated from
the protected network destined to the Internet. In our case, the filtering device may be
blocking the specific host we are probing for outgoing ICMP Parameter Problem
datagrams.
Countermeasure: Block outgoing ICMP Parameter Problem error messages coming from a
protected network targeting hosts on the Internet on the Firewall & on the border Router.
Check with the manufacture of your filtering device which fields it really validates on the IP header
when processing a datagram.
33
Note that some hosts (AIX, HP-UX, Digital UNIX) may not send ICMP Protocol Unreachable error messages.
59
By sending crafted packets of this kind to all IP addresses within the IP address range of a
targeted network we can map the hosts and networking devices that are reachable from the
Internet (assuming no filtering device is present, or filtering the specific traffic).
IANA, the Internet Assign Number Authority, maintain the protocol values. The full list is available
from: http://www.isi.edu/in-notes/iana/assignments/protocol-numbers.
We will use all of the combinations available for the IP protocol field value, and since the IP
protocol field has only 8 bits in length, there could be 256 combinations available.
If we will not receive an ICMP protocol unreachable error message back from the targeted host,
for the field value we were using in our query it will educate us that this field value represents a
valid protocol, which is being used on the targeted machine.
If we will receive an ICMP protocol unreachable error message back from the targeted host, for
the field value we were using in our query it will educate us that this field value is not being used
on the targeted machine.
From the answers/no-answers we have received we could than combine a list of available
protocols on the targeted machine.
nmap 2.54 beta 1 has integrated this method of scanning and Fyodor has named it “IP Protocol
scan”. nmap sends raw IP packets without any further protocol header (no payload) to each
specified protocol on the target machine. If an ICMP Protocol Unreachable error message is
received, the protocol is not in use. Otherwise it is assumed it is opened (or a filtering device is
dropping our packets).
If our goal was Host Detection only, than using the nmap implementation would be a bit of an
overkill.
If we wish to use this scan type for other purposes, such as ACL scheme detection, than we
would need the payload data as well.
Not having any payload with our query using nmap will turn this type of scan quite easily.
A firewall might block the queries initiated with nmap since there is no protocol header (even for
TCP/UDP/ICMP/IGMP) carried with the queries and the firewall cannot match the query with the
60
firewall’s rule base. In this circumstance we will have all 256 possible protocol values seems as
being used on the targeted machine.
In the next example I have used nmap 2.54 beta 22 in order to scan a Microsoft Windows 2000
SP1 Professional based machine:
Our query, using the unused protocol number, should elicit an ICMP Protocol Unreachable error
message back from the targeted IP address, unless the targeted IP address is AIX, HPUX, or
Digital Unix. If no ICMP Protocol Unreachable error message is received than a firewall is present
and filtering the traffic going to the targeted IP address, or our target IP address is either AIX,
HPUX or Digital Unix.
In the next example I have tried to scan a Sun Solaris 2.7 based machine sitting behind a Check
Point FW-1 v4.1 SP3, using nmap 2.54 beta 22:
62
Since nmap produce the packets for this type of scan without any payload, we would expect any
firewall product, which is configured correctly, to drop any packet. This is since the firewall will not
be able to match all the parameters it needs to verify the traffic against its rule base.
All operating systems use the icmp, udp, and tcp protocols. If we wish to query for another
protocol availability on a targeted IP address, we can use the ‘protocol scan’ and than use
another method to check what is valid with this type of protocol.
Another aspect is that we have at least three operating systems which do not produce ICMP
protocol unreachable error messages.
Countermeasure: Block outgoing ICMP Protocol Unreachable error messages coming from the
protected network to the Internet on your Firewall and/or Border Router.
If you are using a firewall check that your firewall block protocols, which are not supported
according to IANA (deny all stance).
We can use this behavior as a Host Detection method, by sending fragmented datagrams with
missing fragment(s) to a targeted host, and wait for an ICMP Fragment Reassembly Time
Exceeded error message to be received from a targeted host(s), if any.
When we are using this method against the IP range of a targeted network, we will be able to
discover the network topology of that targeted network.
In the next example I have sent a TCP fragment from my Linux based machine to a Microsoft
Windows ME based machine. I was using the hping234 utility to generate the query (-x option to
generate a fragment):
34
HPING2 written by antirez, http://www.kyuzz.org/antirez/hping/ .
63
The behavioral pattern, when not receiving some fragments of the original datagram in a certain
time frame, will always be the same on each and every operating system. This means that all will
issue an ICMP fragment reassembly time exceeded error message back to the querying host.
If we will send one or few fragments of a datagram only to a targeted IP address, and not receive
any reply back it will educate us that there is a filtering device present which prevents our query
to reach the targeted IP address, or prevents the ICMP error message from reaching the Internet.
There is always the possibility where the targeted IP address is not available as well.
We will have to query the entire IP range of a targeted network with all combinations possible for
transport protocols (UDP and TCP) and ports, and for ICMP and codes. The query will be sent
fragmented, where only some of the fragments will be sent, but not all.
With this method we need to slice our offending packet(s) wisely, since firewalls (and other
filtering devices) might block fragmentation occurring in the first packet of communication if the
fragmentation occurs ‘too early’. For example, if we will fragment the first TCP packet starting the
TCP handshake, and will not include the TCP flags section inside the fragmented packet, than
most of the firewalls in the market today will drop the connection attempt. Some of them will do so
instantly, while other firewalls will store the fragment we have just sent until we will send the
missing pieces or a time limit will be reached. This might happen with any fragmentation of the
initiating TCP handshake.
64
0 4 8 16 31
4 bit
4 bit
Header 8-bit type of service 16-bit total length ( in bytes )
Version Length
3 bit
16-bit identification 13-bit Fragment Offset
Flags
Options ( if any )
IP Data
32-bit Sequence Number
Field 12 bytes
4-bit Data U A P R S F
6-bit Reserved R C S S Y I 16-bit Window
Offser G K H T N N
Figure 19: An Example: A TCP packet fragmented after only 12 bytes of TCP information
We might have better luck if we will be using the UDP transport protocol, since it is a stateless
protocol. If we will ‘slice’ the UDP datagram after the relevant information to be matched by the
firewall to its rule base, than we might succeed.
0 4 8 16 31
4 bit
4 bit
Header 8-bit type of service 16-bit total length ( in bytes )
Version Length
3 bit
16-bit identification 13-bit Fragment Offset
Flags
Options ( if any )
Data ( if any )
Figure 20: An Example with UDP. Slicing should occur in the Data portion
We can use the same ‘slicing’ method with ICMP and slice the query in the ICMP data portion.
But please bare in mind that there are ISPs, which do not route ICMP fragmented datagrams.
65
When we will receive a reply from one of the targeted IP addresses it will educate us that we
have a host, which is reachable via the Internet with the protocol and port used, and an ACL
scheme which allows this type of communication (as well as the ICMP Fragment Reassembly
Time Exceeded error message to be sent from the protected network to the Internet).
If we will not get any reply from a targeted IP address we have queried we might conclude that:
Countermeasure: Block outgoing ICMP Fragment Reassembly Time Exceeded Error messages
from your protected network to the Internet.
4.4 Using UDP Scans (or why we wait for the ICMP Port
Unreachable)
With this method we are abusing UDP to perform a scan. When we try to communicate with a
closed UDP port we will receive an ICMP Port Unreachable error message back from the
targeted host. If the port we were trying to connect to is in listening state than no reply will be
generated, since UDP is a stateless protocol.
If we will query a large number of UDP ports on the same host and will not receive a reply from a
large number of ports, it will look like a large number of queried UDP ports are opened, while a
filtering device is probably blocking the traffic and nearly all of the ports are closed.
Fyodor has implemented a threshold with nmap 2.3 beta 13, so when performing a UDP scan
and not receiving an ICMP protocol unreachable error message back from a certain number of
ports, it would assume a filtering device is monitoring the traffic, rather than reporting those ports
as opened.
Based on the fact that sending a UDP datagram to a closed port should elicit an ICMP Port
Unreachable, we would send one datagram to the port we have chosen, than:
66
Instead of using port 0 we can choose a number of closed UDP ports according to IANA’s port
list. In each query we will be using another port so detection will be harder.
In the next example, using the hping2 utility, I have tried to connect to a closed UDP port (port
50) on the host 172.18.2.131:
We can use the not used UDP port number we have chosen, or a list of UDP ports that are likely
not being used, and query all the IP range of an attacked network. Getting a reply back would
reveal a live host. No reply would mean a filtering device is covering those hosts UDP traffic, and
probably other protocols and hosts as well.
67
Internal Network
The Internet
Border Router
Figure 21: Using Packets bigger than the PMTU of internal routers to elicit an ICMP
Fragmentation Needed and Don’t Fragment Bit was Set
68
We send a number of packets to different IP’s we suspect are in the IP range of a network we are
targeting. When a router, either an exterior or interior, gets these packets for further processing, it
looks at the IP address and makes decisions of routing based on it solely. When a router gets a
packet with an IP address which is not used in the IP space / network segment of the part of the
targeted network he serves, the router will elicit an ICMP Host Unreachable (generated by a
router if a route to the destination host on a directly connected network is not available – the
destination host does not respond to ARP request) or ICMP Time Exceeded error message(s)
(because processing time took too long, and in the mean time the TTL has reached zero) back to
the offending packet’s source IP address. If we do not get an answer about a certain IP address
(or the targeted IP address answered our query) we can assume this IP exist inside the probed
network36.
With the next example I have sent an ICMP Echo request to an IP address, which is part of the IP
address range of a ‘targeted network’:
35
Usually it will be a Router with an Access Control List.
36
There is also a possibility that a filtering device is blocking our probes, or the replies.
37
The real IP’s of the targeted host and the Router were replaced because of legal problems that might arise when the
ISP’s personal that was used would understand it was one of their Routers used for this experiment.
69
The last hop router has issued an ICMP time to leave exceeded in transit error message. The
router has failed to deliver the query to its destination since the processing time limit has been
reached while waiting for an answer to its arp request looking for the physical address of the
interface that represents the targeted IP address.
If a filtering device is protecting a targeted network, and configured correctly, than ICMP Echo
replies will be blocked and dropped. Since many firewalls do not have the ability of dynamic filter /
statefull inspection with ICMP, and the functionality of the ‘ping’ utility initiated from a protected
network destined the Internet is required for troubleshooting purposes, for example, than ICMP
Echo reply will be allowed to enter the protected network from the Internet. This will enable ICMP
echo replies to reach the protected network even if no ICMP echo request was initiated from the
protected network.
Therefore we can use ICMP echo replies, and hope they will get routed through the firewall,
inside the protected network. The last hop router, in many cases an internal router, will issue an
ICMP host unreachable error message for each IP address it cannot deliver the ICMP echo reply
to.
It will not only reveal the non-existence of the targeted IP address, but the presence of an internal
router.
70
Using ICMP as the underlying protocol might be more beneficial, especially ICMP echo replies,
when a filtering device is present and protecting a targeted network.
71
The same host is being used to scan an entire IP range of a targeted network. Some of the Hosts
the malicious computer attacker has tried to reach were not reachable. Still, the malicious
computer attacker gets an idea about what is not reachable. Sometimes these results are the
only indication that the malicious computer attacker will have about the presence of Hosts in a
targeted network.
With this example different Hosts fail to reach the x.x.x.12 IP address. The last hop router is
sending them all an ICMP Host Unreachable error message.
How come different IP addresses are seeking the same host on such a short notice?
Probably what we are seeing here is a decoy scan. A decoy scan is a type of scan, which
involves multiple IP addresses, which are fed to the network-scanning tool as decoys. The real IP
address of the malicious computer attacker (or a machine he controls) will be among those.
The defending side will have difficulties in realizing what was the real IP address the malicious
computer attacker was using among all the IP addresses probing the network.
With our example the IP address is reported, to all seeking IP addresses, to be unreachable. The
last hop router is trying to deliver the packets but fails to get an answer for his arp requests.
72
Internal Network
192.168.1.1 192.168.1.20
Countermeasure: Block outgoing ICMP Time Exceeded in Transit and ICMP Host Unreachable
error messages from your protected network to the Internet. Use a real dynamic/statefull
inspection firewall.
73
The *NIX version of the program sends UDP (by default) or ICMP Echo Request38 datagrams in
sets of three, to a certain destination host. The first three datagram’s to be sent have an IP Time-
to-Live field value equal to one. The program relies on the fact that the IP Time to Live field value
is decreased at each point that the IP header is being processed. A router should decrement the
TTL field value just before forwarding the datagram to another router/gateway. If a router
discovers that the Time-To-Live field value in an IP header of a datagram he process equals zero
(or less) he would discard the datagram and generate an ICMP Time Exceeded in transit error
message back to the offending packet’s source IP address.
This is when a successful round is completed and another set of three datagrams is sent, this
time with a Time-to-Live field value greater by one than the last set.
The originating host would know at which router the datagram triggered the ICMP error message
since it receives this information with the ICMP Time to Live Exceeded in Transit error message
(Source IP address of the ICMP error message would be the IP address of the router/gateway;
With the offending packets data carried with the error message we will have additional
information that will bound this ICMP error message to our issued traceroute command).
0 8 16 31
Unused ( zero )
We increase the IP Time to Live field value, starting from one, for each successful round (a round
is finished when an ICMP Time Exceeded in Transit error message is received) until we receive
an ICMP Port Unreachable error message (or ICMP Echo Reply if we are using ICMP Echo
request datagrams) from the destined machine. This way we map every router/gateway/host
along the path to our destination.
By default, when sending UDP datagrams we use a destination port, which is probably, not used
by the destination host so the UDP datagrams will trigger ICMP Port Unreachable error
messages back from the destined machine, when reaching it. The destination port will be
increased with each probe sent.
We get ICMP responses provided there is no prohibitive filtering or any packet loss.
38
Microsoft Windows NT and Microsoft Windows 2000 are using the ‘tracert’ utility, which uses ICMP Echo Request
datagrams as its default.
74
The output we see with the traceroute utility is a line showing the Time-To-Live field value, the IP
address of the host/gateway, and the round trip time of each probe. If we do not get a response
back within 5 seconds an asterisk (“*”) is printed, which represents no answer.
The next example was produced with the ‘tracert’ utility with Microsoft Windows 2000:
C:\>tracert www.sys-security.com
Tracing route to www.sys-security.com [216.230.199.48]
over a maximum of 16 hops:
1 100 ms 100 ms 120 ms Haifa-mng-1 [213.8.12.7]
2 90 ms 90 ms 90 ms ge037.herndon1.us.telia.net [205.164.141.1]
3 120 ms 151 ms 200 ms 213.8.8.5
4 441 ms 450 ms 451 ms 500.Serial3-5.GW3.NYC6.ALTER.NET [157.130.253.69]
5 440 ms 451 ms 451 ms 521.ATM2-0.XR2.NYC4.ALTER.NET [152.63.24.38]
6 912 ms 460 ms 461 ms 188.ATM3-0.TR2.NYC1.ALTER.NET [146.188.179.38]
7 471 ms 480 ms 471 ms 104.at-5-1-0.TR2.CHI4.ALTER.NET [146.188.136.153]
8 470 ms 471 ms 471 ms 198.at-2-0-0.XR2.CHI2.ALTER.NET [152.63.64.229]
9 480 ms 471 ms 471 ms 0.so-2-1-0.XL2.CHI2.ALTER.NET [152.63.67.133]
10 471 ms 471 ms 470 ms POS6/0.GW2.CHI2.ALTER.NET [152.63.64.145]
11 471 ms 481 ms 470 ms siteprotect.customer.alter.net [157.130.119.50]
12 481 ms 490 ms 481 ms 216.230.199.48
Trace complete.
C:\>
With this scenario, performing a regular traceroute aimed at the DNS machine’s IP address will
result with traces stopped at the entrance point to the network, hence the Firewall. This is since
the destination UDP port used in the queries is being blocked by the Firewall39.
zuul:~>traceroute 10.0.0.10
traceroute to 10.0.0.10 (10.0.0.10), 30 hops max, 40 byte
packets
1 10.0.0.1 (10.0.0.1) 0.540 ms 0.394 ms 0.397 ms
2 10.0.0.2 (10.0.0.2) 2.455 ms 2.479 ms 2.512 ms
3 10.0.0.3 (10.0.0.3) 4.812 ms 4.780 ms 4.747 ms
4 10.0.0.4 (10.0.0.4) 5.010 ms 4.903 ms 4.980 ms
5 10.0.0.5 (10.0.0.5) 5.520 ms 5.809 ms 6.061 ms
6 10.0.0.6 (10.0.0.6) 9.584 ms 21.754 ms 20.530 ms
7 10.0.0.7 (10.0.0.7) 89.889 ms 79.719 ms 85.918 ms
8 10.0.0.8 (10.0.0.8) 92.605 ms 80.361 ms 94.336 ms
9 * * *
10 * * *
If we wish to reach the DNS server we need to set the UDP port number with our probes to 53.
The traceroute utility increases the port number each time it sends a UDP datagram, therefore we
need to calculate the port number to start with, so when a datagram will be processed by the
Firewall40 and will be examined, it will have the appropriate port and relevant information needed
to comply with the Access Control List which the Firewall enforces on the targeted network. We
can use a simple equation to calculate the starting port:
39
All examples taken from “A Traceroute-Like Analysis of IP Packet Responses to Determine Gateway Access Control
Lists” by David Goldsmith and Michael Shiffman. No real examples were provided because of legal issues.
40
A firewall should not elicit any reply or ICMP error messages for any traffic destined directly at the Firewall.
75
The number of hops (gateways) from the probing host to the firewall is taken from our earlier
traceroute. We use three probes for every query with the same IP Time-to-Live field value; each
one of them uses a different destination port number.
After the datagram that have used UDP port 53 passed the ACL of the firewall and listed the
outer leg of the firewall itself as the next hop, the next UDP datagram sent would be with a
different port number - Than again it would be blocked by the firewall’s rule base.
A modification to the traceroute utility has been made by Michael Shiffman41 in order to stop the
port increasement. A side effect from using the traceroute utility with a fixed port number will be
not receiving an ICMP Port Unreachable error message back from a destination host. This is due
to the fact that the port we will use with our queries might be in listening state on the targeted
host.
Countermeasure
You need to configure your firewall and border routers correctly:
Configure your border routers not to generate ICMP Time to Live exceeded in transit
error messages.
Configure your border routers not to answer any traffic aimed directly at the routers,
unless the traffic is about routing information.
41
http://www.packetfactory.net
76
77
This piece of information is one of few pieces of information a malicious computer attacker will try
to have in deciding if to lunch an attack attempt on a targeted host.
Combining the information will allow the malicious computer attacker to identify if the targeted
host is vulnerable to a certain exploit aimed at a certain service version running on a certain
operating system.
In this section I have outlined the active operating system fingerprinting methods using the ICMP
protocol. Nearly all methods were discovered during this research.
What makes the Active Fingerprinting methods, which are using the ICMP
protocol unique comparing to other Active OS Fingerprinting methods?
As we will learn, using active OS fingerprinting methods with the ICMP protocol requires less
traffic initiation from the malicious computer attacker’s machine to a target host, in order to
determine its underlying operating system.
With some methods only one datagram is required to determine the underlying operating system.
For example, Linux and *BSD based operating systems with default out-of-the-box installation
answer for ICMP Echo requests and for ICMP Timestamp Requests. Until Microsoft Windows
2000 family of operating systems has been released it was a unique combination for these two
groups of operating systems. Since the Microsoft Windows 2000 operating system family mimics
the same behavior (yes mimic), it is no longer feasible to make this particular distinction.
Microsoft might have been thinking that this way of behavior might hide Microsoft windows 2000
machines in the haze. As we will see with the examples given in this research paper they have
much more to learn.
78
The thing is there is no clear distinction between one operating system to another based on this
method. We can only group operating systems together and try other methodologies in order to
divide those groups a bit more42.
For the complete mapping of the operating systems I have queried for this research please see
“Appendix B: Mapping Operating Systems for answering/ discarding ICMP query message types”,
and “Appendix D: ICMP Query Message Types aimed at a Broadcast Address”.
The first step will be sending an ICMP Timestamp request aimed at the broadcast address of a
targeted network. The operating systems that will answer will include Sun Solaris, HP-UX 10.20,
and Linux based on Kernel version 2.2.x. We can further identify these operating systems by
sending an ICMP Information request aimed at the broadcast address of the targeted network.
HP-UX 10.20 will answer the query while Sun Solaris and Linux will not. To distinguish between
these two we will send an ICMP Address Mask request to the IP addresses that did not answer in
the previous step. Sun Solaris will reply to the query while Linux machines based on Kernel 2.2.x
will not.
42
Note: If the PMTU Discovery process using ICMP Echo requests is enables with HP-UX 10.30 & 11.0x operating
systems than our simple query will trigger a “retaliation” from those machines, enabling us to identify them very easily.
79
Reply No Reply
Sun Solaris
HPUX 10.20 Other OSs
Linux Kernel 2.2.x
Reply No Reply
Reply No Reply
Diagram 1: Finger Printing Using non-ECHO ICMP Query Types aimed at the Broadcast Address of an
Attacked Network
The identification field value is used to uniquely identify the fragments of a particular datagram.
Fragments of a particular datagram are assembled if they have the same source, destination,
protocol, and Identifier. The identifier is being chosen to be unique for this "this source,
destination pair and protocol for the time the datagram (or any fragment of it) could be alive in the
internet"43.
43
RFC 791: Internet Protocol. http://www.ietf.org/rfc/rfc0791.txt.
80
The IP identifier field can have 65,536 different values. It is important for an operating system to
have some sort of a mechanism in order to control the identification numbers correctly.
Since every operating system should have its own mechanism in order to deal with this field
numbering we might find some patterns different from one operating system to another.
In the next example the IP address 192.168.1.1 is a Linux machine running Kernel 2.2.14, the IP
address 192.168.1.10 is a Linux machine running Kernel 2.4.2. We are using the ‘ping’ utility to
generate ICMP Echo requests:
The IP ID field value with the ICMP Echo replies, generated by the Kernel 2.4.x based machine,
is zero (0) and not changing.
81
I have examined this behavior with the ICMP Timestamp mechanism as well. This time I have
used the ‘sing’ utility to generate the ICMP Timestamp requests (this is why the IP ID field value
in the requests equal to 13170):
Again the IP ID field value with the ICMP Timestamp replies equals to zero (0) and not changing.
Even when sending ICMP Echo requests from the machine running Linux Kernel 2.4.2 the IP ID
field value is fixed and equal to zero (0):
I have downloaded and compiled Kernel 2.4.4 (the latest in the 2.4.x series as of this writing), and
observed the same behavior.
This operating system fingerprinting method can be used passively and actively.
However, there are operating systems that will increase the value of the IP ID field value with a
value different than 1, from one packet to the next.
In the next example I have sent two ICMP Echo requests from a Windows NT 4 Server SP6a
based machine targeting a Linux machine based on Kernel 2.2.14:
71 72 73 74 75 76 77 61 62 63 64 65 66 67 68 69 qrstuvwabcdefghi
The first ICMP Echo request sent from the Microsoft NT 4 based machine was sent with IP ID
field value of 28416. The second ICMP Echo request was sent with IP ID field value of 28672.
Simple calculation will show a gap of 256 between the IP ID field values.
Looking at the replies the Linux based machine produced, we see a gap of 1 between one IP ID
to the next.
With newer versions of their operating systems (MS Windows ME, MS Windows 2000 family),
Microsoft has changed this behavior, and now acts as most operating systems do.
One example might be when we need another parameter to differentiate between a Windows NT
4 based machine to a Windows 2000 based machine.
With the operating systems that use a gap of 1 between one IP ID field value to the next, we
might have a gap a bit higher than 1, usually between 2-8 (but it can be more than that as well).
In the next example a Microsoft ME based machine sent two ICMP Echo requests targeting a
Linux based on kernel 2.2.14 machine. The gap between the first IP ID field value to the next is 5
with the Linux machine:
71 72 73 74 75 76 77 61 62 63 64 65 66 67 68 69 qrstuvwabcdefghi
Bit 1, is called the Don’t Fragment flag, and can have two values. A value of zero (not set) is
equivalent to May Fragment, and a value of one is equivalent to Don't Fragment. If this flag is set
than the fragmentation of this packet at the IP level is not permitted, otherwise it is.
Bit 2, is called the More Fragments bit. It can have two values. A value of zero is equivalent to
(this is the) Last Fragment, and a value of 1 is equivalent to More Fragments (are coming).
The next field in the IP header is the Fragment Offset field, which identifies the fragment location
relative to the beginning of the original un-fragmented datagram (RFC 791, bottom of page 23).
A close examination of the ICMP Query replies would reveal that some operating systems will set
the DF bit with their replies.
In the next example I have sent an ICMP Echo request to www.openbsd.org. The web site is run
on a Sun Solaris platform, since it is being hosted:
CD D1 07 3B 00 27 02 00 ...;.'..
The DF bit is not only set with ICMP Echo replies, it is also being set on all other types of ICMP
Query replies the underlying operating system is supporting.
Other operating systems, which set the DF bit with their ICMP Query replies by default, are Linux
based on Kernel 2.4.x, HPUX 10.30 & 11.0x, and AIX 4.3.x.
As we have seen with Linux in the previous section, the IP ID field value with the ICMP Query
replies will be equal to zero. This will enable us to differentiate between Linux Kernel 2.4.x based
machines to the rest of the operating systems producing this behavior.
With HPUX 10.30 & 11.0x and with AIX 4.3.x we will sometimes encounter a slightly different
behavioral pattern.
7.1.4.1 HP-UX 10.30 / 11.x & AIX 4.3.x Path MTU Discovery Proccess Using
ICMP Echo Requests
HP claims to have a proprietary method in order to determine the Path MTU with HP-UX v10.30,
and HP-UX v11.0x using ICMP Echo requests. This method is enabled be default. AIX 4.3.x does
exactly the same.
86
The next trace will help to understand the process taken by HPUX 10.30 & 11.0x and AIX 4.3.x.
With this example I have sent an ICMP Echo request targeting an HP-UX 11.0 based machine.
My IP address is represented by y.y.y.y, the target’s IP address is represented by x.x.x.x:
00:27:56.884147 ppp0 > y.y.y.y > x.x.x.x: icmp: echo request (ttl 255,
id 13170)
4500 0024 3372 0000 ff01 7c51 yyyy yyyy
xxxx xxxx 0800 5238 6d04 0000 dce5 c339
8b7d 0d00
00:27:57.165620 ppp0 < x.x.x.x > y.y.y.y : icmp: echo reply (ttl 236,
id 41986)
4500 0024 a402 0000 ec01 1ec1 xxxx xxxx
yyyy yyyy 0000 5a38 6d04 0000 dce5 c339
8b7d 0d00
The first pair of ICMP Echo request and ICMP Echo reply was pretty usual. My Linux based
machine sent an ICMP Echo request and received an ICMP Echo reply from the targeted HPUX
11.0 based machine. One notable detail – the DF bit was not set in the ICMP Echo reply.
00:27:57.435620 ppp0 < x.x.x.x > y.y.y.y : icmp: echo request (DF) (ttl
236, id 41985)
4500 05dc a401 4000 ec01 d909 xxxx xxxx
yyyy yyyy 0800 7e52 9abc def0 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
87
00:27:57.435672 ppp0 > y.y.y.y > x.x.x.x: icmp: echo reply (ttl 255, id
53)
4500 05dc 0035 0000 ff01 a9d6 yyyy yyyy
xxxx xxxx 0000 8652 9abc def0 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
89
The ICMP Echo request datagram size was 1500 bytes long. It was the maximum transfer unit
my Internet Connection was allowed to process (dialup using PPP). The request was sent with
the DF bit set.
90
The process will begin when a host will query an HPUX 11.x based machine. The HPUX based
machine will send an ICMP Echo request to the querying host with a datagram size that equal to
its physical layer’s MTU. The data field with the request will be all zeroes. Any router along the
way, trying to fragment the request because the MTU of a destined network is smaller than the
datagram’s size, will fail. The router will send an ICMP Fragmentation Needed but the DF bit was
set error message back to the offending packet’s source IP address (in this case the HPUX 11.x
based machine). It will trigger the HPUX’s PMTU discovery algorithm to send a smaller sized
ICMP Echo request datagram this time. The process will end when the HPUX 11.x based
machine will receive an ICMP Echo reply for one of the ICMP Echo requests initiated by the
PMTU discovery algorithm to the querying host. Than the Path MTU between the two ends is
discovered, and the process will end.
The following ICMP Echo request was sent from my machine to the targeted HP-UX 11.0x based
machine just milliseconds after my reply to the HP-UX’s query was sent. This time the DF bit was
set with the ICMP Echo reply I have received.
00:27:57.885662 ppp0 > y.y.y.y > x.x.x.x : icmp: echo request (ttl 255,
id 13170)
4500 0024 3372 0000 ff01 7c51 yyyy yyyy
xxxx xxxx 0800 5832 6d04 0100 dde5 c339
8383 0d00
00:27:58.155627 ppp0 < x.x.x.x > y.y.y.y : icmp: echo reply (DF) (ttl
236, id 41987)
4500 0024 a403 4000 ec01 debf xxxx xxxx
yyyy yyyy 0000 6032 6d04 0100 dde5 c339
8383 0d00
Rather than sending future datagrams from the HPUX 11.x based machine to my machine that
will have to be fragmented somewhere along the way, it is more beneficial from performance
perspective, to fragment the future datagrams on sending.
Setting the DF bit on the following ICMP query replies will help to maintain the PMTU between
the two hosts. If for any reason, the PMTU will be decreased. One of the reasons might be that
datagrams may take different routes to the destoinsation.
Sending immediately another ICMP query message type to the HP-UX 11.x operating system
based machine, will not result in the PMTU discovery process to be repeated. The DF Bit will be
set with the ICMP query reply. Expect a threshold to be maintained by the HP-UX 11.x operating
systems based machines. When reached, the next time we query this host with any type of
communication, the process of determining the PMTU using ICMP Echo requests will be initiated
again.
Some operating systems will be configured not to reply for an ICMP Echo requests.
This ability can be used for a denial-of-service attack using HPUX 10.30, and/or
HPUX 11.x based machines as an amplifier for these attacks. Infact, HP has
released a security bulletin dated February 13, 2000 about some issues regarding
this PMTU discovery capability with ICMP. The bulletin states that “Depending upon
the amount and nature of the inbound traffic, an HP-UX 10.30/11.00/11.04 system
91
can be used to flood a target system with IP packets which could result in a denial of
service”44.
Easy identification of HP-UX 10.30, 11.x, and AIX 4.3.x based machines.
This unique behavior, when experienced, help us to distinguish between Sun Solaris based
machines, HP-UX 11.0x/10.30 based machines, and AIX 4.3.x based machines.
Sun Solaris sets the DF bit with the ICMP query replies the operating system answers for, in
order to support its global PMTU discovery process. If a Sun Solaris based machine will receive
an ICMP fragmentation needed but the DF bit was set error message for an ICMP query reply it
had issued, than the size of the MTU used will be lowered. Since ICMP datagrams are small in
size, I do not expect this scenario to happen. There is no active measures with Sun Solaris as far
as I know.
The following operating systems where queried and checked for this kind of behavior:
Linux Kernel 2.4 test 2,4,5,6; Linux Kernel 2.2.x; Linux Kernel 2.4.x; FreeBSD 4.0, 3.4; OpenBSD
2.7,2.6; NetBSD 1.4.1,1.4.2; BSDI BSD/OS 4.0,3.1; Solaris 2.6,2.7,2.8; HP-UX 10.20, 11.0x;
Compaq Tru64 5.0; Aix 4.1,3.2; Irix 6.5.3, 6.5.8; Ultrix 4.2 – 4.5; OpenVMS v7.1-2; Novel Netware
5.1 SP1, 5.0, 3.12; Microsoft Windows 98/98SE/ME, Microsoft Windows NT WRKS SP6a,
Microsoft Windows NT Server SP4, Microsoft Windows 2000 Family.
This will prevent us from using the fingerprinting method I have introduced.
Please pay attention to the details. Turning off this ability might break some other things with your
TCP/IP communications, especially with Sun Solaris based machines.
7.1.4.2.1 HPUX
With HPUX 10.30 and 11.x we will have to turn off the Path MTU Discovery process using ICMP
query requests.
With HP-UX 10.30, & 11.046, one of the ndd command options is the ip_pmtu_strategy. The
variable settings for this option are either 1 or 2. If this bit value is 2, than the Path MTU
Discovery Process is used with ICMP Echo Requests. This is the default value. If this bit value
equals 1, than the HPUX based machines will not use the ICMP echo request PMTU discovery
strategy, and will not set the DF bit after determining the accurate PMTU.
44
HP Security Bulletin - “Security Vulnerability with PMTU strategy (revised)”, February 13. 2000.
45
I do not have any information regarding AIX.
46
Building a Bastion Host Using HP UX 11, Kevin Stevens, http://people.hp.se/stevesk/bastion11.html.
92
When an ICMP Echo reply is received from the Sun Solaris queried host the DF bit will not be set:
Beware - With Sun Solaris turning this option off, will turn off the PMTU discovery process with
other protocols as well. This is not recommended because of performance issues.
The field value is decreased at each point that the Internet header is being processed. RFC 791
states that this field decreasement reflects the time spent processing the datagram. The field
value is measured in units of seconds. The RFC also states that the maximum time to live value
can be set to 255 seconds, which equals to 4.25 minutes. The datagram must be discarded if this
field value equals zero - before reaching its destination.
93
Relating to this field as a measure to assess time is a bit misleading. Some routers may process
the datagram faster than a second, and some may process the datagram longer than a second.
The real intention is to have an upper bound to the datagrams lifetime, so infinite loops of
undelivered datagrams will not jam the Internet.
Having a bound to the datagram’s lifetime help us to prevent old duplicates to arrive after a
certain time elapsed. So when we retransmit a piece of information which was not previously
delivered we can be assured that the older duplicate is already discarded and will not interfere
with the process.
The IP TTL field value with ICMP has two separate values, one for ICMP query messages and
one for ICMP query replies.
The IP TTL field value helps us identify certain operating systems and groups of operating
systems. It also provides us with the simplest means to add another check criteria when we are
querying other host(s) or listening to traffic (sniffing).
The IP Time-To-Live field value received will not be the original value assigned to this field. The
reason is that each router along the path from the targeted host to the prober decreased this field
value by one.
We can use two ways to approach this. The first approach will be looking at the IP TTL field
values that are ususaly used by operating systems and networking devices. They are 255, 128,
64, 60, and 32. We will use the most close to value, as the original value assigned to the IP TTL
field.
The second approach is less accurate than the first one. Since we have already queried the
targeted host, querying it again will not be that harmful (well we hope at least). We can use the
traceroute program in order to reveal the number of hops between our machine to the targeted
host. Adding the number we calculated to the IP TTL field value should give us a good guess
about the original IP TTL value assigned to this field.
Because the routes taken from the target host to our host and from our host to the target host
may be different routes.
The next example demonstrates this behavior. I was using the ping and tracert utilities with
Microsoft Windows 2000:
C:\>ping -n 1 www.sys-security.com
Pinging www.sys-security.com [216.230.199.48] with 32 bytes of data:
Reply from 216.230.199.48: bytes=32 time=481ms TTL=238
Ping statistics for 216.230.199.48:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
94
C:\>tracert -h 16 www.sys-security.com
Tracing route to www.sys-security.com [216.230.199.48]
over a maximum of 16 hops:
1 100 ms 100 ms 120 ms Haifa-mng-1 [213.8.12.7]
2 90 ms 90 ms 90 ms ge037.herndon1.us.telia.net [205.164.141.1]
3 120 ms 151 ms 200 ms 213.8.8.5
4 441 ms 450 ms 451 ms 500.Serial3-5.GW3.NYC6.ALTER.NET [157.130.253.69]
5 440 ms 451 ms 451 ms 521.ATM2-0.XR2.NYC4.ALTER.NET [152.63.24.38]
6 912 ms 460 ms 461 ms 188.ATM3-0.TR2.NYC1.ALTER.NET [146.188.179.38]
7 471 ms 480 ms 471 ms 104.at-5-1-0.TR2.CHI4.ALTER.NET [146.188.136.153]
8 470 ms 471 ms 471 ms 198.at-2-0-0.XR2.CHI2.ALTER.NET [152.63.64.229]
9 480 ms 471 ms 471 ms 0.so-2-1-0.XL2.CHI2.ALTER.NET [152.63.67.133]
10 471 ms 471 ms 470 ms POS6/0.GW2.CHI2.ALTER.NET [152.63.64.145]
11 471 ms 481 ms 470 ms siteprotect.customer.alter.net [157.130.119.50]
12 481 ms 490 ms 481 ms 216.230.199.48
Trace complete.
C:\>
With the example above, the IP TTL field value of the ICMP Echo reply was equal to 238. Using
the –h option I have specified that I wish to use only 16 hops with the queries initiated by the
tracert utility. The actual number of hops in the path between my machine to the target was
only 12 hops.
The ICMP Echo requests sent from my Microsoft Windows 2000 had to travel 12 hops before
reaching my web site, while replies from my web site had to go through 17 hops before reaching
my machine.
Again, we will have a number close enough to one of the common values used to make a good
guess about the original IP TTL field value.
The next table describes the IP TTL field values with ICMP Echo replies for various operating
systems. According to the table we can distinguish between certain operating systems:
- In Reply -
Linux Kernel 2.4 255
LinuxKernel 2.2.14 255
47 64
Linux Kernel 2.0.x
FreeBSD 4.0 255
FreeBSD 3.4 255
OpenBSD 2.7 255
OpenBSD 2.6 255
NetBSD 255
BSDI BSD/OS 4.0 255
BSDI BSD/OS 3.1 255
47
Stephane Omnes provided information about Linux Kernel 2.0.x.
95
- In Reply -
Solaris 2.8 255
Windows 95 32
Windows 98 128
Windows 98 SE 128
Windows ME 128
Windows NT 4 WRKS SP 3 128
Windows NT 4 WRKS SP 6a 128
Windows NT 4 Server SP4 128
Windows 2000 Family 128
Table 14: IP TTL Field Values in replies from Various Operating Systems
If we would look at the ICMP Echo replies IP TTL field values than we can identify few patterns:
Nearly all UNIX and UNIX-like operating systems use 255 as their IP TTL field value
with ICMP query replies.
Compaq Tru64 v5.0 and Linux 2.0.x are the exception, using 64 as its IP TTL field
value with ICMP query replies.
Microsoft Windows operating system based machines will be using the value of 128.
Microsoft Windows 95 is the only Microsoft based operating system to use 32 as its
IP TTL field value with ICMP query messages. It makes it unique among all other
operating systems.
With the ICMP query replies we have an operating system that is clearly distinguished from the
other - Windows 95. Other operating systems are grouped into the ” 64 group” (Linux based
Kernel 2.0.x machines & Compaq Tru64 5.0), the “255 group” (UNIX and UNIX-like), and into the
“128 group” (Microsoft operating systems).
We are not limited to ICMP Echo replies only. We can use the other ICMP query message types
as well, and the results should be the same.
In the next example an I have sent an ICMP Timestamp request to a Linux Kernel 2.2.14 based
machine:
We can use this information with other tests to provide us extra criteria with zero effort.
The IP Time-To-Live field value received will not be the original value assigned to this field. The
reason is that each router along the path from the querying host to our host(s) will decrease this
field value by one.
We will be looking at the IP TTL field values usually used by operating systems and networking
devices. They are 255, 128, 64, 60, and 32. We will use the most close to value, as the original
value assigned to the IP TTL field.
Using techniques, which will trace the querying host path until his gateway may not work, and
may alert the prober that we are aware of his activities48.
The following table summarizes some operating system’s default IP TTL field values with an
ICMP query requests:
- In Reply - - In Req. -
Debian GNU/ LINUX 2.2, Kernel 2.4 test 2 255 64
Redhat LINUX 6.2 Kernel 2.2.14 255 64
LINUX Kernel 2.0.x 64 64
48
See example in the previous section.
97
- In Reply - - In Req. -
OpenBSD 2.7 255 255
OpenBSD 2.6 255 255
NetBSD 255
BSDI BSD/OS 4.0 255
BSDI BSD/OS 3.1 255
Windows 95 32 32
Windows 98 128 32
Windows 98 SE 128 32
Windows ME 128 32
Windows NT 4 WRKS SP 3 128 32
Windows NT 4 WRKS SP 6a 128 32
Windows NT 4 Server SP4 128 32
Windows 2000 Professional 128 128
Windows 2000 Server 128 128
Table 15: IP TTL Field Values in requests from Various Operating Systems
The ICMP query message type used was ICMP Echo request, which is common on all operating
systems tested using the ping utility.
The Linux version of ping will use 64 as its IP TTL field value with ICMP Echo
Requests.
The ping utility with FreeBSD 4.1, 4.0, 3.4; Sun Solaris 2.5.1, 2.6, 2.7, 2.8;
OpenBSD 2.6, 2.7, NetBSD and HP UX 10.20 will use 255 as its IP TTL field value
with ICMP Echo requests.
With the ping utility with Microsoft Windows 95/98/98SE/ME/NT4 with any service
pack, 32 will be used as the IP TTL field value with ICMP Echo requests.
A Microsoft window 2000 ping utility will be using 128 as its IP TTL field value with
ICMP Echo requests.
We can distinguish between Linux, Microsoft Windows 2000, the other Microsoft operating
systems group, and the “255 group” using this method.
98
Operating System IP TTL value with Echo requests IP TTL value with Echo replies
Table 16: Further dividing the groups of operating systems according to IP TTL field value in the ICMP
ECHO Requests and in the ICMP ECHO Replies
One would expect that the IP TTL field value would be the same with both ICMP query requests
and ICMP query replies. Apparently this is not true and providing us with valuable information
about the operating system querying / being queried.
Using the IP TTL field value as the sole parameter to distinguish between oprating systems is not
enough. It can be used as another criteria when using other methods, but not as a sole criterion.
This is a regular ICMP Address Mask request sent with the sing utility to a Sun Solaris 2.7
machine:
49
The Solaris portion was also discovered by Alfredo Andres Omella.
99
All operating systems that will answer with ICMP Address Mask reply will reply with the Address
Mask of the network they reside on.
What will happen if we will introduce a little twist? Lets say we would send those queries
fragmented?
In the next example, I have sent an ICMP Address Mask request to the same Sun Solaris 2.7
host, this time fragmented to pieces of 8 bytes of IP data. As we can see the answer I got was
unusual:
The same Sun Solaris 2.7 based host now replies with 0.0.0.0 as the Address Mask for the
network it resides on. The same behavioral patterns were produced against an HPUX 11.0x
operating system based machine50. In the next example I have tested this behavior against an
HPUX B.11.0 based machine:
50
When I have published this information in Bugtraq (August 5, 2000) Peter J. Holzer notified me that HP-UX 11.00
produce the same behavior as the SUN Solaris boxes. Darren Reed also noted that because Sun Solaris and HP-UX 11.0
share the same third party (Mentat) implementation for some of their TCP/IP stacks this behavior is produced by both.
100
What will happen with the other operating systems, how will they reply?
They all will respond with the real Address Mask in their replies.
Here we got a distinction between SUN Solaris & HP-UX 11.x based machines to the other
operating systems that will answer for ICMP Address Mask request.
Important notice: When I have tested this method I have encountered some problems replicating
the results with different ISPs. As it seems from analyzing the information I got, certain ISPs
would block fragmented ICMP datagrams. This behavior would not enable this method to
succeed. One way of testing this is to send a regular ICMP Echo request. We should watch for a
response from the probed machine. If received, than we should send ICMP Echo request, this
time fragmented. If no reply is received than your ISP is blocking ICMP fragments probably.
101
1
ICMP Address Mask Request
Reply No Reply
Sun Solaris
Other OS's
HP-UX 11.0x
Ultrix
OpenVMS
Windows 95/98/98 SE/NT Below SP 4
2
ICMP Address Mask Request Fragmented
Ultrix
Sun Solaris
OpenVMS
HPUX 11.x
Windows 95/98/98 SE/NT Below SP 4
No Yes
Sun Solaris
HPUX 11.x
HPUX 11.x
0 1 2 3 4 5 6 7
The “Precedence field”, which is 3-bit long, is intended to prioritize the IP Datagram. It has eight
levels of prioritization51:
Precedence Definition
0 Routine (Normal)
1 Priority
2 Immediate
3 Flash
4 Flash Override
5 Critical
6 Internetwork Control
7 Network control
The second field, 4 bits long, is the “Type-of-Service” field. It is intended to describe how the
network should make tradeoffs between throughput, delay, reliability, and cost in routing an IP
Datagram.
RFC 134952 has defined the “Type-of-Service” field as a single enumerated value, thus
interpreted as a numeric value rather than independent flags (with RFC 791 the 4 bits were
distinct options, allowing combinations as well). The 4 bits represents a maximum of 16 possible
values.
0 0 0000 Normal
1 1 1000 Minimize Delay
2 2 0100 Maximize Throughput
4 4 0010 Maximize Reliability
8 8 0001 Minimize Cost
53
F 15 1111 Maximize Security
RFC 1349 refer to this issue and states that “although the semantics of values other than the five
listed above are not defined by this memo, they are perfectly legal TOS values, and hosts and
routers must not preclude their use in any way”…”A host or a router need not make any
51
RFC 791 – Internet Protocol, http://www.ietf.org/rfc/rfc791.txt.
52
RFC 1349 - Type of Service in the Internet Protocol Suite, http://www.ietf.org/rfc/rfc1349.txt.
53
RFC 1455 - Physical Link Security Type of Service, http://www.ietf.org/rfc/rfc1455.txt.
103
distinction between TOS values who’s semantics are defined by this memo and those that are
not”.
The last field, the “MBZ” (must be zero), is unused and must be zero. Routers and hosts ignore
this last field. This field is 1 bit long.
Combining Type-of-Service flags with the different prioritization values, dictates very explicit types
of behavior with certain types of data.
Please note that not all TCP/IP implementations will use these values (nor offer a mechanism for
setting these values), and some will not handle datagrams which have Type-of-Service and/or
Precedence values other than the defaults, differently.
“The Precedence field is intended for Department of Defense applications of the Internet
protocols. The use of non-zero values in this field is outside the scope of this document
and the IP standard specification. Vendors should consult the Defense Communication
Agency (DCA) for guidance on the IP Precedence field and its implications for other
protocol layers. However, vendors should note that the use of precedence will most likely
require that its value be passed between protocol layers in just the same way as the TOS
field is passed“.
“An ICMP reply message MUST have its IP Precedence field set to the value as the IP
Precedence field in the ICMP request that provoked the reply”.
Echoing back the Precedence field value has its logic, because the TOS field should be echoed
back with an ICMP query replies, and both the Precedence field and the TOS field were to dictate
very explicit types of behavior with certain types of data.
As you can understand we do not have a clear ruling about this issue. I was thinking it might be a
ground for an operating system fingerprinting method.
Most of the operating systems I have checked will behave as the next behavioral example with
AIX 4.3. With the next example an ICMP Echo request is sent with one of the precedence bits
set:
21:02:53.241666 ppp0 > x.x.x.x > y.y.y.y: icmp: echo request [tos 0x80]
(ttl 255, id 13170)
4580 0024 3372 0000 ff01 619c xxxx xxxx
yyyy yyyy 0800 c278 6f05 0000 dd97 0d3a
d8af 0300
21:02:59.134297 ppp0 < y.y.y.y > x.x.x.x: icmp: echo reply [tos 0x80]
(ttl 239, id 40656)
4580 0024 9ed0 0000 ef01 063e yyyy yyyy
xxxx xxxx 0000 ca78 6f05 0000 dd97 0d3a
d8af 0300
The AIX 4.3 based machine queried is using the precedence bits value used for the ICMP Echo
request with its ICMP Echo reply.
The next example is with Microsoft Windows 2000. The same ICMP Echo Request was sent:
20:13:36.717070 ppp0 > x.x.x.x > y.y.y.y: icmp: echo request [tos 0x80]
(ttl 255, id 13170)
4580 0024 3372 0000 ff01 d95d xxxx xxxx
yyyy yyyy 0800 df43 c304 0000 508c 0d3a
edf0 0a00
20:13:42.974295 ppp0 < y.y.y.y > x.x.x.x: icmp: echo reply (ttl 111, id
26133)
4500 0024 6615 0000 6f01 373b yyyy yyyy
xxxx xxxx 0000 e743 c304 0000 508c 0d3a
edf0 0a00
105
The ICMP Echo reply will not use the value assigned to the Precedence Bits with the ICMP Echo
Request.
Which operating systems share this behavioral pattern? Microsoft Windows 2000 Family, and
ULTRIX.
Differentiating between Microsoft Windows 2000 and Ultrix is easily achieved if we examine the
IP TTL field values. With ULTRIX the value assigned to the ICMP Echo reply will be 255, with
Microsoft Windows 2000 it will be 128.
Another interesting case is with HPUX 11.0. Lets examine the trace and logs:
The first reply from the HPUX machine echoed back the precedence field value we were using
with the ICMP Echo Request. But what have happened between the first and the second reply?
00:35:09.315260 ppp0 > x.x.x.x > y.y.y.y: icmp: echo request [tos 0x80]
(ttl 255, id 13170)
4580 0024 3372 0000 ff01 4bd1 xxxx xxxx
yyyy yyyy 0800 16f0 db3c 0000 9dc9 0d3a
56cf 0400
00:35:09.944274 ppp0 < y.y.y.y > x.x.x.x: icmp: echo request (DF) (ttl
242, id 22417)
4500 05dc 5791 4000 f201 ef79 yyyy yyyy
xxxx xxxx 0800 7e52 9abc def0 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
106
The first request was sent, as an instant reply the HPUX 11.0 machine initiated its PMTU
discovery process with ICMP Echo requests and sent an ICMP Echo request 1500 bytes long54.
00:35:09.944355 ppp0 > x.x.x.x > y.y.y.y: icmp: echo reply (ttl 255, id
14194)
4500 05dc 3772 0000 ff01 4299 xxxx xxxx
yyyy yyyy 0000 8652 9abc def0 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
54
For an explanation about the HPUX 11.0 PMTU process using ICMP Echo Requests please see the “DF Playground”
section.
108
00:35:09.954282 ppp0 < y.y.y.y > x.x.x.x: icmp: echo reply [tos 0x80]
(ttl 242, id 22418)
4580 0024 5792 0000 f201 34b1 yyyy yyyy
xxxx xxxx 0000 1ef0 db3c 0000 9dc9 0d3a
56cf 0400
The ICMP Echo reply received from the HPUX 11.0 machine for the ICMP Echo request echoed
back the Precedence bits field value.
Another ICMP Echo request was sent with TOS byte field value of 0x80 hex:
00:35:10.314321 ppp0 > x.x.x.x > y.y.y.y: icmp: echo request [tos 0x80]
(ttl 255, id 13170)
4580 0024 3372 0000 ff01 4bd1 xxxx xxxx
yyyy yyyy 0800 b7f3 db3c 0100 9ec9 0d3a
b3cb 0400
00:35:10.624275 ppp0 < y.y.y.y > x.x.x.x: icmp: echo reply (DF) (ttl
242, id 22419)
4500 0024 5793 4000 f201 f52f yyyy yyyy
xxxx xxxx 0000 bff3 db3c 0100 9ec9 0d3a
b3cb 0400
This time the ICMP Echo reply received did not echo back the TOS byte field value. The DF bit
was set. The PMTU discovery process finished its initial stages and went to regular operation.
From now on the ICMP Echo replies did not echo the Precedence bits field value.
This gives us the ability to track down HPUX 11.0 (and 10.30) based machines when they are
using the PMTU Discovery process.
This is not the only behavioral pattern I have experienced with HPUX 11.x based machines:
Therefore it is important to identify where the PMTU discovery process using ICMP Echo
requests is being used and when it is not. We may experience different results with an HPUX
11.x based machine.
Since OpenVMS use 255 as its IP TTL field value, and the Microsoft Windows based machines
use 128, we can differentiate between them and isolate OpenVMS, and the Microsoft based OSs.
Further distinction between the Microsoft operating systems can be achieved if we will query
them with ICMP Address Mask request where only Microsoft Windows 98/98SE will answer for.
The Microsoft Windows ME will not reply, enabling us to identify it.
111
1
ICMP Echo Request with Precedence Bits !=0
No Reply Reply
Diagram 3: An example for a way to fingerprint Microsoft Windows 2000, Ultrix, HPUX 11.0 & 10.30,
OpenVMS, Microsoft Windows ME, and Microsoft Windows 98/98SE based machines with ICMP Query
messages with the Precedence Bits field !=0
An HPUX based machine is placed in both sides of the diagram. If the PMTU Discovery process
will be faster than the first answering ICMP Echo reply than we might have an ICMP Echo reply
with Precedence bits equal to zero answering an ICMP Echo request with a value different than
zero as its precedence bits value. On the other hand, we demonstrated cases in which an HPUX
based machines will echo back any value the Precedence bits will carry with an ICMP Echo
request.
112
7.2.2.1 The use of the Type-of-Service field with the ICMP Protocol
RFC 1349 also defines the usage of the Type-of-Service field with the ICMP messages. It
distinguishes between ICMP error messages (Destination Unreachable, Source Quench,
Redirect, Time Exceeded, and Parameter Problem), ICMP query messages (Echo, Router
Solicitation, Timestamp, Information request, Address Mask request) and ICMP reply messages
(Echo reply, Router Advertisement, Timestamp reply, Information reply, Address Mask reply).
An ICMP error message is always sent with the default TOS (0x0000)
An ICMP request message may be sent with any value in the TOS field. “A mechanism to
allow the user to specify the TOS value to be used would be a useful feature in many
applications that generate ICMP request messages”55.
55
RFC 1349 - Type of Service in the Internet Protocol Suite, http://www.ietf.org/rfc/rfc1349.txt.
113
The RFC further specify that although ICMP request messages are normally sent with the
default TOS, there are sometimes good reasons why they would be sent with some other
TOS value.
An ICMP reply message is sent with the same value in the TOS field as was used in the
corresponding ICMP request message.
Using this logic I have decided to check if certain operating systems react correctly to an ICMP
query messages with a Type-of-Service field value, which is different than the default (0x0000).
The check out was produced with all ICMP query message types, sent with a Type-of-Service
field set to a known value, then set to an unknown value (the term known and unknown are used
here because I was not experimenting with non-legit values, and since any value may be sent
inside this field).
The following example is an ICMP Echo request sent to my FreeBSD 4.0 machine with the TOS
field equals an 8 hex value, which is a legit TOS value. The utility used here is sing56:
17:23:46.605297 if 4 > x.x.x.x > y.y.y.y: icmp: echo request [tos 0x8]
(ttl 255, id 13170)
4508 0024 3372 0000 ff01 60e4 xxxx xxxx
yyyy yyyy 0800 0e9a d604 0600 f2ea bc39
553c 0900
17:23:46.895255 if 4 < y.y.y.y > x.x.x.x: icmp: echo reply [tos 0x8]
(ttl 243, id 58832)
4508 0024 e5d0 0000 f301 ba85 yyyy yyyy
xxxx xxxx 0000 169a d604 0600 f2ea bc39
553c 0900
This is the second test I have produced, sending ICMP Echo request with the Type-of-Service
field set to a 10 Hex value, a value that is not a known Type-of-Service value:
56
sing has the ability to monitor for any replies and than print the received TOS value. I find this option very useful, and
thank the author for embedding this function, as I requested.
114
As it can be seen from the tcpdump trace, the ICMP echo reply message was sent with the same
value in the TOS field as was used in the corresponding ICMP echo request message.
I had to verify this behavioral pattern with FreeBSD 4.0 with the other ICMP query messages it
answers for. Since FreeBSD 4.0 does not respond to ICMP Information requests or to ICMP
Address Mask requests I had to verify this with ICMP Timestamp requests only.
The second test with was performed with the TOS field value set to 10 Hex value:
The same behavior was produced. The ICMP Timestamp replies were sent with the TOS field
value equals the TOS field value of the ICMP Timestamp requests.
Ok. I was curious again. I imagined that the Microsoft Windows implementation of the things
might be a little different.
When I was examining ICMP Echo requests I noticed something is wrong with the Microsoft
implementation:
116
This example was produced against a Microsoft Windows 2000 Professional SP2 based
machine. All the Microsoft Windows 2000 family based machines (Professional, Server,
Advanced Server) will act the same.
The other Microsoft based operating systems will act correctly - Microsoft Windows 98/SE/ME,
Microsoft Windows NT 4 Workstation SP3, Microsoft Windows NT 4 Server SP4, Microsoft
Windows NT 4 Workstation SP6a.
Ultrix and Novell Netware will share the same behavioral pattern as with Microsoft Windows 2000
family.
The next step will be to query the questionable IP Addresses of Microsoft Windows 2000 and
Novell Netware with ICMP Timestamp request. The Microsoft Windows 2000 based machines will
answer the query while the Novell Netware based machines will not.
Other methods to distinguish between the Microsoft Windows 2000 based machines to Novell
Netware based machine may apply here as well.
117
Microsoft Windows 2000 based machines will maintain the same behavioral pattern regarding the
TOS field with the ICMP Timestamp mechanism.
1
ICMP Echo Request with TOS !=0
No Reply Reply
No Reply Reply
Novell Netware Windows 2000 Family
Diagram 4: An example for a way to fingerprint Microsoft Windows 2000, Ultrix, Novell Netware, Microsoft
Windows ME, and Microsoft Windows 98/98SE based machines with ICMP query messages with the TOS
bits field !=0
Operating System Information Time Stamp Request Address Mask Echo Request
Request With TOS!=0x00 Request With TOS!=0x00
With TOS!=0x00 With TOS!=0x00
118
Operating System Information Time Stamp Request Address Mask Echo Request
Request With TOS!=0x00 Request With TOS!=0x00
With TOS!=0x00 With TOS!=0x00
Novell Netware 5.1 SP1 Not Answering Not Answering Not Answering 0x00
Novell Netware 5.0 Not Answering Not Answering Not Answering 0x00
Novell Netware 3.12 Not Answering Not Answering Not Answering 0x00
This is the only statement about the unused bit in the TOS Byte in the RFCs. The RFC states:
“The originator of a datagram sets this field to Zero“.
Obviously it was meant that this field would be always zero. But what will happen if we would set
this bit with our ICMP Echo requests? Will this bit be zero out on reply or will it be echoed back?
Only with ICMP Echo requests we can have a clear identification of OSs.
The next example is an ICMP Echo request sent with the Unused bit in the TOS Byte set,
targeting a FreeBSD 4.1.1 machine:
Echoing back the Unused bit in the TOS Byte represents the behavior of most of the operating
systems I have checked this behavior against.
Which operating systems are the exceptions, and will not echo back the Unused bit in the TOS
byte if set?
The next example is with Microsoft Windows 2000 Professional SP2 as the targeted machine:
We will use, again, the IP TTL field value to differentiate between Microsoft Windows 2000 (128)
and Ultrix (255).
120
7.2.3.1 Changed Pattern with Replies for Different ICMP Query Types
We have a changed pattern with Microsoft Windows 98/98SE/ME when using other ICMP query
message types other than ICMP Echo requests. Instead of echoing this field back, this time they
will zero out this field value with their replies.
1
ICMP Echo Request
with the TOS byte's Unused Bit = 1
No Reply Reply
Diagram 5: An example for a way to fingerprint operating systems using the unused bit in the TOS Byte
echoing method
Operating System Information Time Stamp Request Address Mask Echo Request
Request With Unused=1 Request With Unused=1
With Unused=1 With Unused=1
Debian GNU/ LINUX 2.2, Not Answering 0x1 Not Answering 0x1
Kernel 2.4 test 2
Redhat LINUX 6.2 Kernel Not Answering 0x1 Not Answering 0x1
2.2.14
121
Operating System Information Time Stamp Request Address Mask Echo Request
Request With Unused=1 Request With Unused=1
With Unused=1 With Unused=1
Table 21: ICMP Query Message Types with the TOS Byte Unused Bit value ! = 0
What will happen if we will decide to break this definition and send our ICMP query requests with
this bit set (having the value of one)?
Sun Solaris & HPUX 11.0x (possibly 10.30 as well) will echo back the reserved bit.
In the next example I have sent an ICMP Echo request with the Unused bit set (Reserve Flag),
using the –U option of sing, destined an HP-UX B.11.0 based machine:
122
The following is another behavioral pattern produced against an HPUX 11.0 based machine:
21:31:21.033366 if 4 > y.y.y.y > x.x.x.x: icmp: echo request (ttl 255,
id 13170)
4500 0024 3372 8000 ff01 fc8c yyyy yyyy
xxxx xxxx 0800 8b1b 8603 0000 f924 bd39
3082 0000
21:31:21.317916 if 4 < x.x.x.x > y.y.y.y: icmp: echo reply (ttl 236,
id 25606)
4500 0024 6406 8000 ec01 def8 xxxx xxxx
yyyy yyyy 0000 931b 8603 0000 f924 bd39
3082 0000
The next example was produced against a Sun Solaris 2.8 based machine:
We might see a distinction between Sun Solaris and HPUX based machines, if the PMTU
Discovery process using ICMP Echo requests is enabled on the HPUX queried host. We might
see the ICMP Echo reply received, without the DF bit set, and than after we will be queried with
an ICMP Echo request ‘the HPUX style’ back from our target. We might see another case where
we will be queried ‘the HPUX style’ just before the ICMP Echo reply will be received this time with
the DF bit set.
We might also see cases in which the ICMP Echo replies from both HPUX and Sun Solaris will be
exactly the same.
All ICMP query replies on the same operating system use the same pattern (either echo the
reserved bit with all replies or not). This enables us to use another ICMP query message type for
this fingerprinting method. If we will send an ICMP Address Mask request with the reserved bit
set, the result a Sun Solaris 2.8 machine will produce will be something like this next trace:
We will have both the reserved bit and the DF bit set with the ICMP Address Mask reply.
This operating system fingerprinting method enables us to identify and distinguish between Sun
Solaris, and HP-UX 10.30 &11.x operating systems to the other operating systems.
This method was tested against: Linux Kernel 2.4 test 2,4,5,6; Linux Kernel 2.2.x; FreeBSD 4.0,
3.4; OpenBSD 2.7,2.6; NetBSD 1.4.1,1.4.2; BSDI BSD/OS 4.0,3.1; Solaris 2.6,2.7,2.8; HP-UX
10.20, 11.0; Compaq Tru64 5.0; Aix 4.1,3.2; Irix 6.5.3, 6.5.8; Ultrix 4.2 – 4.5; OpenVMS v7.1-2;
Novel Netware 5.1 SP1, 5.0, 3.12; Microsoft Windows 98/98SE, Microsoft Windows NT WRKS
SP6a, Microsoft Windows NT Server SP4, Microsoft Windows 2000 Family.
124
will be not setting the DF Bit with their replies for a regular query that comes with the DF bit not
set.
17:07:16.128308 if 4 > x.x.x.x > y.y.y.y: icmp: echo request (DF) (ttl
255, id 13170)
4500 0024 3372 4000 ff01 c846 xxxx xxxx
yyyy yyyy 0800 96e5 7d04 0000 14e7 bc39
11f5 0100
17:07:16.375256 if 4 < y.y.y.y > x.x.x.x: icmp: echo reply (DF) (ttl
113, id 11936)
4500 0024 2ea0 4000 7101 5b19 yyyy yyyy
xxxx xxxx 0000 9ee5 7d04 0000 14e7 bc39
11f5 0100
Most of the operating systems that I have checked this behavior against acted the same as the
Microsoft Windows 2000 Advanced Server. In the reply they produced, the DF bit was set.
Which operating systems are the exceptional and do not echo back the DF bit?
Linux based on Kernel 2.2.x, Ultrix v4.2 – 4.5, and Novell Netware.
If we wish to further distinguish between the Linux based systems and the Ultrix based systems,
we can send an ICMP Information request or an ICMP Address Mask request to the questioned
IP addresses. The IP Addresses, which will produce a reply for our queries wll be those who are
based on the Ultrix operating system.
125
Again it is very simple to distinguish between the Microsoft Windows 98 family of operating
systems and between the Ultrix based machines. This is since the Microsoft Windows 98 family is
using 128 as their IP TTL field value in their ICMP query replies while Ultrix uses 255.
We have here a simple method to distinguish between Microsoft Windows 98 / 98 SE, and Ultrix
machines to the rest of the operating systems world.
Another interesting piece of information is that the Microsoft Windows 98 family changed its
behavior from DF echoing with the ICMP Echo request to not echoing the DF bit with ICMP
Address Mask requests. This inconsistency is a factor with all Microsoft operating systems
(Echoing with ICMP Echo request, not echoing with the other types of ICMP query).
Linux machines based on Kernel 2.2.x, Ultrix, Microsoft Windows 98/98SE/ME, and the Microsoft
Windows 2000 Family will not echo back the DF bit with ICMP Timestamp replies they produce
for corresponding ICMP Timestamp requests that sets their DF bit.
Here we can only distinguish between certain groups of operating systems; again it will be
according to their IP TTL field value with their replies.
Linux would use 255 as its TTL field value for the ICMP Timestamp reply; Ultrix would use the
same value. The Microsoft family of operating system members that will answer for this kind of
query will use 128 as their IP TTL field value.
Again we have Linux and Ultrix on the one hand and certain members of the Microsoft based
OSs family on the other hand.
This is an ICMP Echo request sent from a Sun Solaris 2.6 based machine to a Linux Kernel
2.2.14 based machine. We can see from the snort traces that the DF bit is set with the request
and not set with the reply. But again if some one would mimic this behavior with a tool used on a
Linux box to query the world, which is 100% mimicking a Sun Solaris request than we will never
know if this is a legit request or an attempt for scanning / fingerprinting.
57
When the PMTU Discovery process using ICMPEcho requests is not enabled, or when it works fast enough to set the
DF bit with the first ICMP Address Mask reply.
126
Operating System Info. Request Time Stamp Address Mask Echo Request
Request Request
OpenVMS v7.1-2 + ( + DF ) + ( + DF ) + ( + DF )
Novell Netware 5.1 SP1 Not Answering Not Answering Not Answering + ( - DF )
Novell Netware 5.0 Not Answering Not Answering Not Answering + ( - DF )
Novell Netware 3.12 Not Answering Not Answering Not Answering + ( - DF )
Operating System Info. Request Time Stamp Address Mask Echo Request
Request Request
1
DF Bit Set with ICMP Echo Request
No Reply Reply
No Reply Reply
5
DF BIt Echoing with ICMP Time Stamp Request
With the example above, we start our identification process with a query of ICMP Echo request
with the DF bit set. Linux Kernel 2.2.x, Ultrix and Novell Netware will not echo back the DF bit.
Since the original value assigned to the IP TTL field value with Novell Netware based machines is
128
128, and with Linux Kernel 2.2.x and Ultrix this value will be originally 255 we can divide the three
operating systems into two groups. Our next step will be to query the questionable Linux Kernel
2.2.x and Ultrix IP addresses with an ICMP Address Mask requests. The IP addresses, which will
answer, will be Ultrix based, while the non-answering IPs will be Linux Kernel 2.2.x based.
Now we will return to the IP addresses of the operating systems that did echo the DF in their
replies (first step test). We will query them with an ICMP Address Mask request with the DF bit
set.
From the operating systems that will answer the ICMP Address Mask query Microsoft Windows
98/98SE will not echo back the DF bit.
Sun Solaris, HPUX 11.x, and OpenVMS will echo back the DF bit with their ICMP Address Mask
replies. We will use an ICMP Information request to divide this group of IP addresses. While the
IP addresses of OpenVMS based machines will answer our query, Sun Solaris and HPUX 11.x
based IP addresses will not answer the query.
7.2.6 Using Code field values different than zero within ICMP ECHO
requests
An interesting detail I have discovered during my lab experiments for this research is when a
wrong code is sent along with the correct type of ICMP query message, different operating
systems will send different code values back.
In the next example I have sent an ICMP Echo request with the code field value set to 38 instead
of 0, to a Linux machine running Linux Kernel 2.2.14.
We can examine at the tcpdump trace, the type and code fields are in bold type:
00:21:05.238649 ppp0 > x.x.x.x > y.y.y.y: icmp: echo request (ttl 255,
id 13170)
4500 0024 3372 0000 ff01 08d3 xxxx xxxx
yyyy yyyy 0826 af13 2904 0000 41e4 c339
17a4 0300
00:21:05.485617 ppp0 < y.y.y.y > x.x.x.x: icmp: echo reply (ttl 240, id
2322)
4500 0024 0912 0000 f001 4233 yyyy yyyy
xxxx xxxx 0026 b713 2904 0000 41e4 c339
17a4 0300
In the ICMP Echo reply the queried Linux Kernel 2.2.14 based machine have produced the code
field value is set to 38 (decimal, 26 hex).
If we examine what RFC 792 requires, we see that Linux comply with it:
The sending side initializes the identifier (used to identify Echo requests aimed at different
destination hosts) and sequence number (if multiple Echo requests are sent to the same
destination host), adds some data (arbitrary) to the data field and sends the ICMP Echo request
to the destination host. In the ICMP header the code equals zero. The recipient should only
change the type to Echo reply and return the datagram to the sender.
129
0 4 8 16 31
Data...
This also means that we trust another machine to behave correctly, when that host produce the
ICMP Echo reply.
Linux changes the type field value to 0 and sends the reply. The code field is unchanged.
The RFC does not outline what should happen if a host receives an ICMP query message with a
wrong code. This might be because all ICMP query message types where defined with a default
code, code 0.
I have checked the behavior of my Microsoft Windows 2000 Professional SP2 based machine. I
have sent the same ICMP Echo Request message to the Microsoft Windows machine as I did
with the previous example:
The Microsoft Windows 2000 Professional SP2 operating system changed the code field value on
the ICMP Echo reply to the value of 0.
130
This method was tested with various operating systems including LINUX Kernel 2.4.x, IBM AIX
4.x & 3.2, SUN Solaris 2.51, 2.6, 2.7 & 2.8, OpenBSD 2.6 & 2.7, NetBSD 1.4.1, 1.4.2, BSDI
BSD/OS 4.0 & 3.1, HP-UX 10.20 & 11.0, Compaq Tru64 v5.0, Irix 6.5.3 & 6.5.8, Ultrix 4.2-4.5,
OpenVMS, FreeBSD 3.4, 4.0 & 4.1 and they produced the same results as the LINUX box
(Kernel 2.2.x) did.
Microsoft Windows 4.0 Server SP4, Microsoft Windows NT 4.0 Workstation SP 6a, Microsoft
Windows NT 4.0 Workstation SP3, Microsoft Windows 95 / 98 / 98 SE / ME have produced the
same behavior as the Microsoft Windows 2000 Professional (Server & Advanced Server).
7.2.7 Using Code field values different than zero within ICMP
Timestamp Request
I have decided to map which operating systems will answer to an ICMP Timestamp request that
will have its code field not set to zero, and how the ICMP Timestamp reply (if any) will help us
identify those operating systems.
This enables us to group together certain versions of the Microsoft Windows operating systems.
7.2.7.2 Operating Systems the Zero out the Code field value on Reply
I was looking to see if there are operating systems in which answered the crafted ICMP
Timestamp request with the Code field set to a value different than zero, which might zero out this
field value with their ICMP Timestamp reply.
I have found that the Linux operating systems based on Kernel 2.2.x or on Kernel 2.4.x zero out
the code field with ICMP Timestamp replies they produce for the corresponding ICMP Timestamp
requests with the code field value that is different than zero.
The next example is an ICMP timestamp request sent from a Linux Kernel 2.2.14 based machine
with the code field set to a value of 38 decimal / 26 hex. The targeted machine is a Linux Kernel
2.4 test 6 based machine. As we can see from the tcpdump trace, the targeted Linux Kernel 2.4
test 6 based machine zeroed out the code field with its ICMP Timestamp reply:
[root@godfather /root]#
20:10:18.138486 ppp0 > x.x.x.x > y.y.y.y: icmp: time stamp request (ttl
255, id 13170)
4500 0028 3372 0000 ff01 606c xxxx xxxx
yyyy yyyy 0d26 2e0c 7c04 0000 03af 451a
0000 0000 0000 0000
20:10:18.354222 ppp0 < y.y.y.y > x.x.x.x: icmp: time stamp reply (ttl
243, id 15717)
4500 0028 3d65 0000 f301 6279 yyyy yyyy
xxxx xxxx 0e00 888b 7c04 0000 03af 451a
0422 4e31 0422 4e31
This also gives us a unique piece of information that enables us to identify Linux based machines.
Diagram 7: An Example of Finger Printing Using crafted ICMP Echo & Timestamp Request
The diagram above describes a process in which we can use in order to differentiate between
certain groups of operating systems.
The first step is sending an ICMP Echo request with the code field set to a value different than
zero. The ICMP Echo replies with the code field equal to zero would distinguish the Microsoft
based operating systems group, from the other operating systems.
132
Sending ICMP Timestamp requests with a code field value different than zero to the ‘other OSs’
group will identify Linux Kernel 2.2.x / 2.4 based machines (since they zero out the code field with
their ICMP Timestamp replies).
Sending ICMP Timestamp request to the Microsoft Windows based group of operating systems
will separate the group to those machines rather being windows 95 or windows NT 4 SP4 and
above (not answer the query), to those that may be one of the following – Microsoft Windows 98 /
SE / ME / Windows 2000 Family (answer the query).
• AIX
• DG-UX
• HP-UX
For example: An attacker can use this to send UDP packets to a random, high UDP port and
count the number of ICMP Destination unreachable messages received within a given amount of
time.
Most of the operating systems will quote the offending packets IP Header and the first 8 data
bytes of the datagram that triggered the error. Several operating systems and networking devices
will parse the RFC guidelines a bit different and will echo more than 8 bytes.
133
The fact is not new. Fyodor outlined this in his article “Remote OS Identification by TCP/IP
Fingerprinting“58.
The idea is in trying to differentiate between the different operating systems that quote more than
the usual. How can this be done?
Looking for example at the amount of information quoted. Is there a limit to the quoted size? Will
the quoted data be the entire offending packet or just part of it? Will the quoted data be quoted
correctly? Will extra bytes be padded to the quoted data? and some other parameters.
The next example is with Sun Solaris 7. I have sent a UDP datagram to a closed UDP port:
00:13:35.923691 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 2000
unreachable Offending pkt: x.x.x.x.1084 > y.y.y.y.2000: udp 0 (ttl 45,
id 44551) (DF) (ttl 236, id 63417)
4500 0038 f7b9 4000 ec01 44e5 yyyy yyyy
xxxx xxxx 0303 4f3c 0000 0000 4500 001c
ae07 0000 2d11 8da4 xxxx xxxx yyyy yyyy
043c 07d0 0008 a1ac
Please note that for having more than 8 data bytes quoted, you need to have data in the
offending datagram. If not, there is nothing to quote beyond the regular 8 bytes (usually, if the OS
is not padding other data bytes).
The next example is with Sun Solaris 8. I have sent a UDP datagram to a closed UDP port,
adding 80 bytes of data to the datagram this time:
58
http://www.insecure.org/nmap/nmap-fingerprinting-article.html
134
11:52:51.367331 eth0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.2198 > y.y.y.y.0: udp 0 (ttl 48, id
17240) (DF) (ttl 231, id 49576)
4500 0070 c1a8 4000 e701 3469 yyyy yyyy
xxxx xxxx 0303 bf05 0000 0000 4500 006c
4358 0000 3011 a9ae xxxx xxxx yyyy yyyy
0896 0000 0058 8b5f 5858 5858 5858 5858
5858 5858 5858 5858 5858 5858 5858 5858
5858 5858 5858 5858 5858 5858 5858 5858
5858 5858 5858 5858 5858 5858 5858 5858
The result is an ICMP Port Unreachable Error message that will echo only 64 bytes of the
offending datagram’s data portion.
The limit of 64 bytes quoted from the offending packet’s data portion is not limited to Sun Solaris
only. HPUX 11.x, MacOS 7.55/8.x/9.04, will do the same by default.
Infact this is a tunnable parameter with Sun Solaris that can be changed using the ndd
command. The parameter is ip_icmp_return_data_bytes and it is set by default to 64. You may
change it to a value between 8 to 65536.
Other operating systems / networking devices will have their own limits. For example, Linux
based on Kernel 2.2.x/2.4.x will send an ICMP Error Message up to 576 bytes long. Linux will
quote 528 bytes from the data portion of the offending packet (576 minus 20 bytes of usuall IP
Header, minus 8 bytes of the ICMP Header, minus the offending packet’s IP Header that is 20
bytes will leave you with 528 bytes of data portion. This if no IP options are presented).
I know an operating system, and a family of networking devices that will pad extra data to the
echoed offending packet. The Linux case is detailed in the next section. The next example is with
Foundry Networks Serverlron running software version 07.1.02T12. I have sent a UDP datagram
to a closed UDP port on the Foundry switch:
135
12:08:48.240208 eth0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.2498 > y.y.y.y.0: udp 0 (ttl 51, id
44437) (ttl 51, id 17453)
4500 0044 442d 0000 3301 feaf yyyy yyyy
xxxx xxxx 0303 739c 0000 0000 4500 001c
ad95 0000 3311 955f xxxx xxxx yyyy yyyy
09c2 0000 0008 b13f dd2c 2a16 38e1 7646
7aaa 9d41
As it seems Foundry switches will pad 12 bytes with ICMP Port unreachable error messages.
Other fingerptinting facts that are outlined through this section will help us to differentiate between
the operating systems, which carry the same behavior.
Other ICMP Error Messages, which a Host can issue and should be checked to see if they hold
more fingerprinting differences, are:
Source Quench
Parameter Problem
The most interesting case is with the Linux operating system based on Kernel 2.2.x and 2.4.x.
The next example is with Linux based on Kernel 2.2.16 as the targeted machine, eliciting an
ICMP Port Unreachable error message:
00:21:30.493691 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 2000
unreachable Offending pkt: x.x.x.x.2066 > y.y.y.y.2000: udp 0 (ttl 44,
id 1732) [tos 0xc0] (ttl 238, id 53804)
45c0 0038 d22c 0000 ee01 4e60 yyyy yyyy
xxxx xxxx 0303 a88e 0000 0000 4500 001c
06c4 0000 2c11 dc95 xxxx xxxx yyyy yyyy
136
The quoted data is the entire offending datagram. Linux ICMP error messages will be up to 576
bytes long according to the Linux source code.
The next example is with Linux Kernel 2.2.16 as the targeted operating system. With this example
I have sent a protocol scan with nmap:
inux added to the entire offending packet that was quoted, another 20 bytes.
Since Linux handles the ICMP Protocol Unreachable error messages like the ICMP Fragment
Reassembly Time Exceeded error messages we will see the same pattern with ICMP Fragment
Reassembly Time Exceeded error messages:
Since Linux’s ICMP error messages will not be bigger than 576 bytes long, if the offending packet
will be big enough (not likely in real world situation) we will not see the added 20 bytes in the
ICMP Fragment Reassembly / ICMP Protocol Unreachable error messages.
This unique pattern will allow us to identify Linux based machines even if the Precedence Bits
value with the Linux ICMP Error messages will be changed to 0x000.
Foundry Network’s networking devices will pad extra 12 bytes of data with their ICMP Port
Unreachable error messages. Our first example is with a ServerIron switch running software
version 7.1.02T12, eliciting an ICMP Port Unreachable error message, for a UDP datagram trying
to communicate with UDP port 0:
12:08:48.240208 eth0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.2498 > y.y.y.y.0: udp 0 (ttl 51, id
44437) (ttl 51, id 17453)
4500 0044 442d 0000 3301 feaf yyyy yyyy
xxxx xxxx 0303 739c 0000 0000 4500 001c
ad95 0000 3311 955f xxxx xxxx yyyy yyyy
09c2 0000 0008 b13f dd2c 2a16 38e1 7646
7aaa 9d41
138
From the tcpdump trace we can conclude that the offending packet’s IP header and the first 8
data bytes were quoted correctly. Right after these, 12 bytes were padded, that came from
nowhere.
The next example is with Foundry Network’s BigIron 8000 running software version 6.6.05T51.
With this test I have sent a UDP datagram with 80 bytes of data to a closed UDP port (UDP port
80) on the BigIron 8000:
11:40:37.913018 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.2779 > y.y.y.y.0: udp 80 (ttl 52, id
25211) (ttl 52, id 60504)
4500 0044 ec58 0000 3401 b0d4 yyyy yyyy
xxxx xxxx 0303 edf3 0000 0000 4500 006c
627b 0000 3411 3a7a xxxx xxxx yyyy yyyy
0adb 0000 0058 3d09 1c1d 1e1f 2021 2223
2425 2627
Again, the offending packet’s IP Header and the first 8 data bytes are quoted correctly. 12 data
bytes are padded right after.
139
If a malicious computer attacker examines the types of alternation that have been made to the
headers, he may be able to make certain assumptions about the target operating system.
The only two field values we expect to be changed are the IP time-to-live field value and the IP
header checksum. The IP TTL field value changes because the field is decreased by one, each
time the IP Header is being processed. The IP header checksum is recalculated each time the IP
TTL field value is descreased.
Fyodor gives the following examples in his article “Remote OS detection via TCP/IP Stack Finger
Printing”59:
“For example, AIX and BSDI send back an IP 'total length' field that is 20 bytes too high.
Some BSDI, FreeBSD, OpenBSD, ULTRIX, and VAXen change the IP ID that you sent
them. While the checksum is going to change due to the changed TTL anyway, there are
some machines (AIX, FreeBSD, etc.) which send back an inconsistent or 0 checksum.
Same thing goes with the UDP checksum."
This section deals with the ICMP Port Unreachable error message.
12:33:17.319275 ppp0 > x.x.x.x.2160 > y.y.y.y.0: udp 0 [tos 0x10] (ttl
64, id 47349)
4510 001c b8f5 0000 4011 9bea xxxx xxxx
yyyy yyyy 0870 0000 0008 d18c
12:33:17.614823 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.2160 > y.y.y.y.0: udp 0 [tos 0x10]
(ttl 49, id 47349, bad cksum aaea!) [tos 0x10] (ttl 241, id 17965)
4510 0038 462d 0000 f101 5da6 yyyy yyyy
xxxx xxxx 0303 f470 0000 0000 4510 0030
b8f5 0000 3111 aaea xxxx xxxx yyyy yyyy
0870 0000 0008 0000
Several changed were made to the offending packet’s data when echoed:
IP Total Length Field - The total length field with the original UDP datagram equal to 28
(001c hex) bytes. With the echoed offending packet’s IP header this value was changed
to 48 (0030 hex) bytes. 20 bytes more than the original UDP datagram’s length.
59
http://www.insecure.org/nmap/nmap-fingerprinting-article.html
140
IP TTL Field value - With the ICMP error message this value is set to the value, which
reached its final destination (with this example the targeted host). When it reached it
target the TTL was set to 49. We also learn the target is 64-49 = 15 hops away.
IP Header Checksum - The IP Header checksum was changed because the IP Total
Length field value and the IP TTL field value were changed.
UDP Header Checksum – The UDP header checksum with the echoed information
equal to zero.
00:56:07.894612 ppp0 > x.x.x.x.1594 > y.y.y.y.0: udp 0 [tos 0x8] (ttl
64, id 2153)
4508 001c 0869 0000 4011 c54f xxxx xxxx
yyyy yyyy 063a 0000 0008 4c93
00:56:08.204551 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.1594 > y.y.y.y.0: udp 0 [tos 0x8]
(ttl 47, id 2153, bad cksum d64f!) [tos 0x8] (ttl 239, id 1065)
4508 0038 0429 0000 ef01 1a83 yyyy yyyy
xxxx xxxx 0303 aa13 0000 0000 4508 0030
0869 0000 2f11 d64f xxxx xxxx yyyy yyyy
063a 0000 0008 4c93
Several changed were made to the offending packet’s data when echoed:
IP Total Length Field - The total length field with the original UDP datagram equal to 28
bytes. With the echoed original IP header this value was changed to 48 bytes. 20 bytes
more than the original UDP datagram’s length.
IP TTL Field value - With the ICMP error message this value is set to the value, which
reached its final destination (with this example the targeted host). When it reached it
target the TTL was set to 47. We also learn the target is 64-47 = 17 hops away.
IP Header Checksum - The IP Header checksum was changed because the IP Total
Length field value and the IP TTL field value were changed.
7.3.6.2.1 ICMP Error Message Echoing Integrity with different 4.x versions of AIX
In contrast to AIX version 4.3 and 4.2.1 AIX version 4.1 use the original UDP Checksum. This
detail helps us to differentiate between the different versions of AIX.
01:01:11.128420 ppp0 > x.x.x.x.2933 > y.y.y.y.0: udp 0 [tos 0x8] (ttl
64, id 49317)
4508 001c c0a5 0000 4011 9209 xxxx xxxx
141
01:01:11.484552 ppp0 < y.y.y.y.4 > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.2933 > y.y.y.y.0: udp 0 [tos 0x8]
(ttl 53, id 49317, bad cksum 0!) (ttl 242, id 16127)
4500 0038 3eff 0000 f201 61ab yyyy yyyy
xxxx xxxx 0303 c226 0000 0000 4508 0030
c0a5 0000 3511 0000 xxxx xxxx yyyy yyyy
0b75 0000 0008 cc4e
Again several changed were made to the offending packet’s IP Header when echoed:
IP Total length - With the echoed IP Header this field value was changed from the
original 28 bytes to 48 bytes. 20 bytes more than the original.
IP TTL Field Value – Changed according to the hop count. Was equal to 53 when
arrived to its destination. The target is 64 – 53 = 11 hops away.
IP Header Checksum – Changed, and with the ICMP error is now equal to zero!
00:52:19.055758 ppp0 > x.x.x.x.1393 > y.y.y.y.0: udp 0 [tos 0x8] (ttl
64, id 58965)
4508 001c e655 0000 4011 3f63 xxxx xxxx
yyyy yyyy 0571 0000 0008 a55c
00:52:19.464548 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.1393 > y.y.y.y.0: udp 0 [tos 0x8]
(ttl 47, id 21990, bad cksum 5063!) (ttl 238, id 27639)
4500 0038 6bf7 0000 ee01 0bbd yyyy yyyy
xxxx xxxx 0303 87f3 0000 0000 4508 001c
55e6 0000 2f11 5063 xxxx xxxx yyyy yyyy
0571 0000 0008 0000
Several changed were made to the offending packet’s data when echoed:
The IP Identification field value is changed. This field is constructed with 16bit. The first
8 bits changed places with the second pair of 8 bits constructing this field. With the
original datagram this field value was e655, with the echoed IP header it is 55e660.
The IP TTL field value has changed. The target is 64 – 47 = 17 hops away.
The IP Header Checksum has changed because some of the parameters were changed
as well. We can name the IP TTL field value and the IP Total Length field value as an
example.
The UDP checksum is changed and now it equal to zero!
60
http://www.freebsd.org/cgi/query-pr.cgi?pr=16240 ; Patches were issued. This is fixed with FreeBSD 4.1.1.
142
61
The DF Bit is set.
143
Microsoft
windows 98
144
In general, when an ICMP error message is produced, the offending packet's IP Header + at least
8 bytes of data are quoted with the error message.
If we examine closely the next example, we can see that the offending packet's IP TTL field value
echoed back is zero.
We expect this value to decrease from the value initially assigned, but not to be zero. Since this
value should change from one hop to another, the checksum need to be recalculated each time.
With the Novell Netware error message we can see that the checksum echoed is miscalculated.
...And again this is a Fragment Reassembly Time Exceeded ICMP error message and not an
ICMP Time Exceeded in Transit error message.
This unique pattern enables us to determine if the operating system in question is a Novell
Netware or other with one datagram only.
145
0 1 2 3 4 5 6 7
The “Precedence field”, which is 3-bit long, is intended to prioritize the IP Datagram. It has eight
levels of prioritization62:
Precedence Definition
0 Routine (Normal)
1 Priority
2 Immediate
3 Flash
4 Flash Override
5 Critical
6 Internetwork Control
7 Network control
The second field, 4 bits long, is the “Type-of-Service” field. It is intended to describe how the
network should make tradeoffs between throughput, delay, reliability, and cost in routing an IP
Datagram.
The last field, the “MBZ” (most be zero), is unused and most be zero. Routers and hosts ignore
this last field. This field is 1 bit long.
62
RFC 791 – Internet Protocol, http://www.ietf.org/rfc/rfc791.txt.
146
Other precedence information is available with RFC 1812 Requirements for IP Version 4 Routers:
“4.3.2.5 TOS and Precedence
…
ICMP Source Quench error messages, if sent at all, MUST have their IP Precedence field set to
the same value as the IP Precedence field in the packet that provoked the sending of the
ICMP Source Quench message. All other ICMP error messages (Destination Unreachable,
Redirect, Time Exceeded, and Parameter Problem) SHOULD have their precedence value set to
6 (INTERNETWORK CONTROL) or 7 (NETWORK CONTROL). The IP Precedence value for
these error messages MAY be settable”.
With the operating systems I have checked, nearly all used the value of 0x000 for the
Precedence bits field with ICMP error messages.
Fyodor had outlined in his paper “Remote OS Identification by TCP/IP Fingerprinting” 63 the fact
that Linux is using the value of 0xc0 (an unused precedence value) as its TOS byte value with
ICMP Port Unreachable error messages.
In the next example we have sent one UDP packet destined to port 50 (which is closed on the
destination machine) from one Linux machine to another, both running Linux Kernel 2.2.16:
This abnormality with Linux is not only limited to ICMP Destination Unreachable Port Unreachable
error messages.
63
This fact was discovered by Fyodor. http://www.insecure.org/nmap/nmap-fingerprinting-article.html
147
The ICMP error message produced by a Linux machine based on Kernel 2.2.14, is Destination
Unreachable Protocol Unreachable (Type 3 Code 2). As it can be seen the TOS Byte value that
was used is again 0xc0. Which is an unused Precedence bits value.
Linux embraced the behavior RFC 1812 suggested and sends all his ICMP error messages with
the Precedence field value sent to 0xc0 (value of 6).
When an offending packet with a TOS field value of 0x0000 is eliciting an ICMP error message
from an offended host, the TOS field value with all the operating systems I have checked will be
set to 0x0000.
If we will pay attention to the TOS Byte we will see that Linux and several routers will use the
value of 0xc0 for the precedence field.
What will happen if the TOS field with the offending packet will be set to a value different than the
default (0x0000)?
We will have several operating systems that will echo the TOS field back with the ICMP error
message.
Our first example is with an AIX 4.3 machine, where a UDP datagram is sent with a TOS field
value of 0x10 hex:
12:33:17.319275 ppp0 > x.x.x.x.2160 > y.y.y.y.0: udp 0 [tos 0x10] (ttl
64, id 47349)
4510 001c b8f5 0000 4011 9bea xxxx xxxx
yyyy yyyy 0870 0000 0008 d18c
148
12:33:17.614823 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.2160 > y.y.y.y.0: udp 0 [tos 0x10]
(ttl 49, id 47349, bad cksum aaea!) [tos 0x10] (ttl 241, id 17965)
4510 0038 462d 0000 f101 5da6 yyyy yyyy
xxxx xxxx 0303 f470 0000 0000 4510 0030
b8f5 0000 3111 aaea xxxx xxxx yyyy yyyy
0870 0000 0008 0000
As it can be seen from the trace, the TOS field value was echoed back by the AIX based
machine. This was tested against AIX 4.1, 4.2.1, 4.3, 4.3 fix pack2.
12:58:57.663517 ppp0 > x.x.x.x.1074 > y.y.y.y.11: udp 0 [tos 0x8] (ttl
64, id 47314)
4508 001c b8d2 0000 4011 a037 xxxx xxxx
yyyy yyyy 0432 000b 0008 d9e1
12:58:57.984820 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 11
unreachable Offending pkt: x.x.x.x.1074 > y.y.y.y.11: udp 0 [tos 0x8]
(ttl 52, id 47314) [tos 0x8] (ttl 52, id 16984)
4508 0038 4258 0000 3401 22a6 yyyy yyyy
d508 c41c 0303 f8b7 0000 0000 4508 001c
b8d2 0000 3411 ac37 xxxx xxxx yyyy yyyy
0432 000b 0008 0000
How can we differentiate between DGUX and AIX? If we will pay attention to the echoing
integrity. AIX 4.x sets the IP total length field value, with the echoed offending IP Header, to a
value 20 bytes longer than the original. DGUX quote this field value correctly.
The last operating system, which I have found echoing the TOS field value with its ICMP error
messages, is Linux operating systems based on Kernel 2.2.x & 2.4 (the versions of the Kernel
that I have tested):
00:50:43.759906 ppp0 > x.x.x.x.1952 > y.y.y.y.0: udp 0 [tos 0x10] (ttl
64, id 15952)
4510 001c 3e50 0000 4011 e6b2 xxxx xxxx
yyyy yyyy 07a0 0000 0008 a27f
00:50:44.154556 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 0
unreachable Offending pkt: x.x.x.x.1952 > y.y.y.y.0: udp 0 [tos 0x10]
(ttl 47, id 15952) [tos 0xd0] (ttl 238, id 54662)
45d0 0038 d586 0000 ee01 a0af yyyy yyyy
xxxx xxxx 0303 52d5 0000 0000 4510 001c
3e50 0000 2f11 f7b2 xxxx xxxx yyyy yyyy
07a0 0000 0008 a27f
149
Another unique pattern with Linux is setting the Precedence bits field value to 0xc0 with ICMP
error messages. This helps us to differentiate Linux from the other operating systems that echo
the TOS field value.
While Linux embraced RFC 1812 instructions for routers regarding the TOS and Precedence
fields, the other operating systems that echoed the TOS field value didn’t seem to have a good
excuse for doing so.
What will happen if we will set the DF bit with an offending packet that will generate an ICMP
error message? Will the DF Bit be set with the ICMP error message?
In the next example, a UDP datagram is sent to a closed UDP port, to elicit an ICMP Port
Unreachable error message. The DF bit is set with the offending datagram. As it can be seen the
DF bit is set with the ICMP error message the FreeBSD 4.1.1 machine, which was the target
system issued back.
00:31:29.805075 ppp0 > x.x.x.x.1403 > y.y.y.y.2000: udp 0 (DF) (ttl 64,
id 19417)
4500 001c 4bd9 4000 4011 452b xxxx xxxx
yyyy yyyy 057b 07d0 0008 48c6
00:31:30.103692 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 2000
unreachable Offending pkt: x.x.x.x.1403 > y.y.y.y.2000: udp 0 (DF) (ttl
45, id 19417) (DF) (ttl 238, id 47017)
4500 0038 b7a9 4000 ee01 2b4e yyyy yyyy
xxxx xxxx 0303 efa9 0000 0000 4500 001c
4bd9 4000 2d11 582b xxxx xxxx yyyy yyyy
057b 07d0 0008 0000
We can distinguish between the group of operating systems, which will echo back the DF bit with
their replies, to the group of operating systems that will not.
150
00:49:45.853751 ppp0 > x.x.x.x.1580 > y.y.y.y.10: udp 0 (DF) (ttl 64,
id 63227)
4500 001c f6fb 4000 4011 730a xxxx xxxx
yyyy yyyy 062c 000a 0008 28dd
00:49:46.173681 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 10
unreachable Offending pkt: x.x.x.x.1580 > y.y.y.y.10: udp 0 (DF) (ttl
55, id 63227) (ttl 119, id 430)
4500 0038 01ae 0000 7701 714c yyyy yyyy
xxxx xxxx 0303 cde1 0000 0000 4500 001c
f6fb 4000 3711 7c0a xxxx xxxx yyyy yyyy
062c 000a 0008 28dd
Among the operating systems I have checked Linux machines based on Kernel 2.2.x / 2.4.x,
ULTRIX, Novell Netware, and Microsoft Windows 98/98SE/ME/NT4SP6A/Windows 2000 Family,
will not echo back the DF bit with their ICMP Error messages.
How can we distinguish between the operating systems in the non-DF echoing group?
Since Linux is using the value of 0xc0 hex for his Precedence Bits field value for all ICMP error
messages we can separate it instantly.
00:25:17.203727 ppp0 > x.x.x.x.1421 > y.y.y.y.2000: udp 0 (DF) (ttl 64,
id 11969)
4500 001c 2ec1 4000 4011 b938 xxxx xxxx
yyyy yyyy 058d 07d0 0008 9fa9
00:25:17.573698 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port 2000
unreachable Offending pkt: x.x.x.x.1421 > y.y.y.y.2000: udp 0 (DF) (ttl
45, id 11969) [tos 0xc0] (ttl 236, id 38250)
45c0 0038 956a 0000 ec01 e5c2 yyyy yyyy
xxxx xxxx 0303 4fee 0000 0000 4500 001c
2ec1 4000 2d11 cc38 xxxx xxxx yyyy yyyy
058d 07d0 0008 9fa9
ULTRIX echo integrity is not that good. The offending packet echoing will set both the IP Header
Checksum and the Original UDP Checksum to zero. It will also miscalculate the IP ID field value
and will flip the first 8 bits with the second one, creating a false value for it:
00:29:05.013726 ppp0 > x.x.x.x.1188 > y.y.y.y.2000: udp 0 (DF) (ttl 64,
id 34921)
4500 001c 8869 4000 4011 5f85 xxxx xxxx
yyyy yyyy 04a4 07d0 0008 a087
00:29:05.383686 ppp0 < 194.47.250.222 > x.x.x.x: icmp: y.y.y.y udp port
2000 unreachable Offending pkt: x.x.x.x.1188 > y.y.y.y.2000: udp 0 (ttl
45, id 27016, bad cksum 0!) (ttl 236, id 9736)
4500 0038 2608 0000 ec01 55da yyyy yyyy
xxxx xxxx 0303 c1e7 0000 0000 4500 001c
6988 0000 2d11 0000 xxxx xxxx yyyy yyyy
151
This will leave us with Novell Netware and the various Microsoft Windows Operating Systems.
As discussed in the section dealing with “Novell Netware Echoing Integrity Bug with ICMP
Fragment Reassembly Time Exceeded “, when a Novell Netware operating system issues an
ICMP Time Exceeded error message it will zero out the IP TTL field value with the echoed
offending packet. We will use this fingeprinting technique and send a fragment of a packet to the
questioned IP addresses that will elicit an ICMP Time Exceeded error messages.
1
Offending Packet with DF Bit Set
(data portion set to 70 bytes, for example)
Windows 98/98SE/ME
Microsoft Windows NT4 Server, SP6a Novell Netware
Microsoft Windows 2000 Family
We can take a second approach using the ICMP Fragment Reassembly Time Exceeded error
messages. We will send an offending packet with the DF bit set that will elicit an ICMP Fragment
Reassembly Time Exceeded error message back from the targeted IP addresses. Novell
Netware, Linux based Kernel 2.2.x and 2.4x, and the various Microsoft Windows operating
systems will set the DF bit with their replies. Linux and Novell have their unique fingerprinting with
ICMP Fragment Reassembly Time Exceeded error messages, enabling us to isolate the
Microsoft based operating systems based machines.
152
HP-UX 11.x based machines will have a unique behavior when the PMTU discovery process
based on ICMP Echo Requests is enabled (by default). In the next example I have sent a UDP
datagram to port 53 (DNS) of the targeted HPUX machine.
As an instant reply the PMTU discovery process, which is based upon ICMP Echo request(s), is
started:
00:45:03.113686 ppp0 < y.y.y.y > x.x.x.x: icmp: echo request (DF) (ttl
242, id 25153)
4500 05dc 6241 4000 f201 ea34 yyyy yyyy
xxxx xxxx 0800 7e52 9abc def0 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
153
00:45:03.113787 ppp0 > x.x.x.x > y.y.y.y: icmp: echo reply (ttl 255, id
98)
4500 05dc 0062 0000 ff01 7f14 xxxx xxxx
yyyy yyyy 0000 8652 9abc def0 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
155
The first ICMP Port Unreachable error message arrives without the DF bit set:
00:45:03.123692 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port domain
unreachable Offending pkt: x.x.x.x.codasrv > y.y.y.y.domain: 0 [0q] (0)
(DF) (ttl 51, id 7454) (ttl 242, id 25154)
4500 0038 6242 0000 f201 2fd8 yyyy yyyy
xxxx xxxx 0303 33c1 0000 0000 4500 001c
1d1e 4000 3311 f408 xxxx xxxx yyyy yyyy
0980 0035 0008 bf7e
The ICMP Port Unreachable error message that was sent for the second UDP datagram now sets
the DF bit as part of the PMTU discovery process maintenance:
00:45:03.813687 ppp0 < y.y.y.y > x.x.x.x: icmp: y.y.y.y udp port domain
unreachable Offending pkt: x.x.x.x.codasrv-se > y.y.y.y.domain: 26990
op5+ [b2&3=0x2d61] [29188a] [25700q] [24946n] [28769au] (0) (DF) (ttl
51, id 59904) (DF) (ttl 242, id 25155)
4500 0038 6243 4000 f201 efd6 yyyy yyyy
xxxx xxxx 0303 33c1 0000 0000 4500 001c
ea00 4000 3311 2726 xxxx xxxx yyyy yyyy
0981 0035 0008 bf7d
If you are sending only one offending datagram to the targeted HPUX 11.x based machine, you
might not see the change in pattern (but you will still receive an ICMP Echo request ‘the HPUX
style’ from the targeted host).
HPUX based operating system(s) machines will echo up to 64 bytes of the offending packet’s
data portion. By sending a bigger offending datagram (for example with 80 bytes of data portion)
we can examine which of the operating systems in question, which do not set the DF bit with the
ICMP error message, will echo 64 bytes of the data portion (or an OS that will echo more than 8
data bytes and will not set the the precedence bits to 0xc0).
157
When the PMTU discovery process based on ICMP Echo Requests will not be enabled than we
will see the following pattern:
158
As it seems all the probed operating systems I have tested this against behaved correctly
processing the query and sending the ICMP echo reply back.
Some operating systems will process the query and set the don’t fragment bit on the fragments of
the reply like we have outlined in the “DF Bit Playground” section. These operating systems will
be Sun Solaris, AIX 4.3, Linux 2.4.x, and HP-UX 10.30 & 11.0x.
We can use other methods, which does not generate the kind of noise this method generates.
Basically there is no reason for this size of ICMP Echo requests, and it should trigger IDS
systems immediately and alert them that something suspicious is happening.
Time elapsed until we receive an ICMP Fragment Reassembly Time Exceeded error
message when we will send one fragment to a targeted IP address.
The rate in which we will receive the ICMP Error messages. This idea is not new BUT
nobody payed attention to the fact that different ICMP error messages may have different
rates defined. For example with Linux kernel 2.4.x we can set:
An attacker can use this to trigger one of the ICMP error messages listed above and
count the number of ICMP error messages received within a given amount of time.
The rate in which we will receive ICMP query message replies. A malicious computer
attacker can probe a targeted network with ICMP Echo requests, for example, and count
the number of ICMP query reply messages received within a given amount of time.
159
Different operating systems use different implementations of the TCP/IP stack. We can identify
differences between those TCP/IP stack implementations. Therefore differentiate between the
different operating systems using those TCP/IP stack implementations differences.
Based on the sniffed information and those differences we can identify various operating systems
and services used on the targeted network. We can try to identify host(s), operating systems, and
services used on network(s) and host(s) communicating with our target network.
With the traditional active fingerprinting methods one sends a regular or a malformed packet to a
targeted host / range of IP addresses and watch for the response. When the response arrives (or
not) he will then compare the result with a database holding known fingerprints, which was built
earlier, and identify the operating system in use. With active fingerprinting we relate to the uptime
of the targeted system, at that particular moment the targeted machine was up and running.
64
-Passive Mapping: An Offensive Use of IDS, by Cortez Giovanni
-Passive Mapping: The importance of Stimuli: by Cortez Giovanni
-Passive Fingerprinting, by Lance Spitzner. http://project.honeynet.org/papers/passive/
-Passive Host Fingerprinting, by Max Vision. http://www.whitehats.com/papers/passive/index.html.
65
One notable example would be Trojans using non-default ports.
66
Anti-sniff from l0pht. More information can be found at http://www.l0pht.com.
160
Limited address space can be checked, since the method rely on user & network
activities, and it does not initiate one. We are totally dependent upon information sent
and/or network usage.
Some applications generate their own packets with the application’s specific field values
and will not produce the same signature(s) as the operating system itself would.
Some of the default field values we rely upon can be easily changed through simple
operating system configuration options.
The Passive Fingerprinting information can be collected from various locations, not only from
inside the targeted network.
The quality of the information will be affected from the location of the sensor. If, for example, the
location of the sensor will be inside an internal segment, than the entire network communications
between internal hosts (and also the outside world) will be revealed, and analyzed. If the location
of the sensor will be just outside a filtering device defending the target network, the information
gathered will include the host(s) that are allowed to be accessed from the Internet, and to access
the Internet only. Most of the internal machines (and infrastructure) will not be revealed with this
scenario.
The usage of Passive Fingerprinting techniques is not limited to offensive use only. One can set
up a defensive passive fingerprinting systems in order to find unreported systems and services
that are in contrast with the security policy of that organization. Since a full analysis can be done
on all TCP/IP layers of the information gathered, the defensive system can also track its internal
users usage of the Internet (for example web sites they browse).
Is this sound like a mix-up of sniffers and intrusion detection systems abilities all together with a
system built defensively?
Because the information is gathered using sensors we can do with it a lot more than just Passive
Fingerprinting. This gives a unique add-on to the abilities of a system built for passive collection
of data – a sniffer and set of filters that can do:
Passive fingerprinting
Intrusion Detection
Monitoring of internal Users Internet behavior.
Monitoring of internal Users Internal communications.
Monitoring for Security Policy breaches.
67
Passive Mapping: An Offensive Use of IDS, by Cortez Giovanni; Passive Mapping: The importance of Stimuli: By
Cortez Giovanni
161
Passive fingerprinting resembles network intrusion detection systems in the way information is
gathered. What are the differences between the two? An IDS system role is to detect attacks
whether successful or not against a network it deployed on. Passive Fingerprinting methods will
identify operating systems (and other kind of information such as services, special applications
etc.). These services can be combined together.
Some intrusion detection systems collect information about the system they defend using active
fingerprinting methods. This is done in order to discover which TCP/IP stack implementation is
being used (and the operating system using it). These scans can sometimes introduce a denial of
service condition against the targeted host(s) and/or network devices. The information gathered
help the intrusion detection system to build fragmented packets correctly according to its
destination operating system’s TCP/IP stack behavior. Instead of using active fingerprinting, a
passive fingerprinting approach can be used as well; this eliminates the possibility of a denial of
service against the residing machines and networking devices. It also brings another important
gain – the intrusion detection system can discover, automatically, new systems added to a
protected network (we can compare a list of IP addresses we have discovered using passive
fingerprinting to the actual IP address list of the organization).
Some of the advantages of a passively mapping process are immediately seen here. One notable
example is systems, which have low uptimes. With traditional active fingerprinting methods, one
will not notice the existence of those systems, and when information is collected about an outside
system tying to access the particular IP address of the low uptime system the right conclusion will
not be made.
Today, the passive fingerprinting methods known to the author do not rely on all the information
that will be examined and explained in this section. Most of the passive fingerprinting methods
rely upon TCP only techniques mainly related to few fields inside the protocol header such as –
the initial IP TTL field value, TOS, Windows size, Maximum Segment Size, IP Identification
number, Initial Sequence Numbers, the Don’t Fragment flag, Sack OK option, nap option, and
windows scaling option.
Information Sniffed
: Sensor
Interneal Network to Internet (Both ways)
Internal Network to DMZ (Both Ways)
Internal Segmentation Traffic
Internal Network
Boarder Router
DMZ
Direct Link
How a malicious computer attacker will place a sensor inside an internal network? One possibility
will be a combination of a virus/Trojan sent attached to an email addressing an internal user. If
you will ask yourself how much video clips / pictures / jokes you receive from friends and colleges
via email this will sound more real. One example might be a modification of the “LOVE Letter”
virus. It will not only send emails to 50 or so people that are listed in your contact info, it will also
attach a program, which would do a Passive Fingerprinting information gathering with abilities to
send the information gathered back to the malicious computer attacker (can also introduce filters
and other gizmos).
A malicious computer attacker can compromise one of the DMZ services, and place his sensor
on the compromised machine. We can name few services, which are known to have
vulnerabilities in them – some versions of wuftpd, some versions of bind, some versions of IIS
and the list is long.
68
If this is the case, there is a serious misunderstanding in the design of the Network regarding Network Security.
163
Information Sniffed
:
DMZ to Internet (Both ways)
Internal Network to DMZ (Both Ways)
Internal DMZ Traffic
Internal Network
Boarder Router
Sensor
DMZ
Direct Link
Information Sniffed
:
Internet to DMZ (Both ways)
Internal Network to Internet (Both Ways)
Routing Info.
Internal Network
Boarder Router
ISP
ISP
Sensor
DMZ
Direct Link
Diagram 11: A Sensor is located on the upstream/downstream link of the attacked network
164
With this example the information gathered includes traffic flow between internal systems and
systems on the Internet, and traffic flow between hosts on the Internet and the DMZ.
Some organizations might have dedicated WAN lines for upstream and downstream links.
Whether the sensor is located on the downstream link or on the upstream link it will gather traffic
information about “one side of the connection” only.
Sensor located on the upstream link and a sensor located on the downstream link will produce
different mapping. This is because the number of Internal systems that access the Internet is
usually higher than the number of Internal systems that are allowed to be accessed from the
Internet.
Routing information can also be gleaned, if the sensor is to be located between the targeted
network’s router(s) to the ISP’s router(s).
The sets of parameters, or questions, we are going to use for the Passive Fingerprinting process
with ICMP are:
Which operating system answers for what kind of ICMP query messages?
Which operating system answers for special/crafted ICMP queries and how?
Which operating system produces what sort of ICMP Error messages?
An analysis of ICMP error messages. Pinpointing several fields inside the IP header
and in the ICMP portion of the datagram that will help us identify differences between
different operating systems.
Analyses of ICMP query messages (request & response). Pinpointing several fields
inside the IP header and in the ICMP portion of the datagram that will help us to
identify differences between operating systems.
The amount of information we can work with is significant, and will allow us to be very accurate in
concluding what kind of operating systems produced the ICMP traffic examined, or answered it.
Even if the local administrator has changed few default settings regarding the default behavior of
the operating system with certain fields inside the ICMP datagram (IP Header or the ICMP portion
of the datagram), other fields will come to our rescue.
In this section I am going to walk through each of the identification stages and demonstrate to
you, the reader, how passive fingerprinting with ICMP is done.
8.3.1 Which operating system answers for what kind of ICMP Query
messages?
We can divide this section to a number of available probes and answers gathered:
165
The answers gathered would allow us to group together certain operating systems that would
answer for a particular normal ICMP Query message(s).
For example, Linux and *BSD based operating systems with default out-of-the-box installation
answer for ICMP Echo requests and for ICMP Timestamp Requests. Until Microsoft Windows
2000 family of operating systems has been released it was a unique combination for these two
groups of operating systems. Since the Microsoft Windows 2000 operating system family mimics
the same behavior (yes mimic), it is no longer feasible to make this particular distinction.
Microsoft might have been thinking that this way of behavior might hide Microsoft windows 2000
machines in the haze. As we have seen they have much more to learn.
The thing is there is no clear distinction between one operating system to another based on this
method. We can only group operating systems together and try other methodologies in order to
divide those groups a bit more.
An example: If we see a certain operating system answer for an ICMP Information request and
than answer for ICMP Address Mask request we can conclude that this operating system is an
ULTIX based machine.
With the example above we have one operating system query another with an ICMP Echo
request. The targeted operating system answered the query and set the DF bit with its answer.
The fact the DF bit is set with the ICMP Echo reply will limit the number of operating system the
replying side might be to: Sun Solaris, HPUX 10.30 & 11.0x., AIX 4.3.x, and Linux Kernel 2.4.x.
166
For example, Microsoft, and *BSD based operating systems will not answer ICMP query
messages aimed at the broadcast address of the network they reside on. A SUN Solaris based
operating system machine will answer for ICMP Echo requests and for ICMP Timestamps
requests aimed at the broadcast address of the network it resides on.
Common to All
An interesting detail that one should be familiar with is that the only ICMP query message type,
which is implemented with all operating systems, is the ICMP Echo request. RFC 112269 states
that every host should implement an end-user-accessible application interface for sending ICMP
Echo request query messages to other hosts. We can test this when we use the “ping” utility on
various operating systems. “ping” uses its own default values for several field values within the
ICMP Echo request datagram, and not the operating system’s.
So, what will happen if we will see an ICMP query message type coming from a host to another,
which is not an ICMP Echo query message?
We can than conclude that the querying host is using a 3rd party utility (not an OS integrated).
Than the question will be – what tools are able of sending this kind of ICMP query message? And
which kind of operating system can provide the ground for such a tool? UNIX and UNIX-like
operating systems are known to as a better ground for hackery tools70.
Since we have logged the ICMP datagram sent, we can compare it to a signature produced from
different tools and try to locate the tool being used (sometimes it might be needed to compile the
tools on different architectures of the same operating system)71. Even if the malicious computer
attacker was using different parameters each time he used the tool, still the tool might have
unique fingerprints. After identifying the tool we might learn about the underlying operating
system this tool might have been compiled on, eliminating, our operating system choise selection.
With Passive fingerprinting we must remember that we are only observers and are dependent
upon usage of the network.
Countermeasure
Fooling this method of passive fingerprinting is very simple. Just configure your operating system
not to answer ICMP query messages. You can configure your operating system not to answer for
an ICMP query message it was configured out-of-the-box to answer for. This will fool the
database I have described in this section.
You can also change some parameters that will affect the ICMP query request (this is dependent
upon configuration options with your operating system).
69
RFC 1122: Requirements for Internet Hosts - Communication Layers, http://www.ietf.org/rfc/rfc1122.txt.
70
Altough there is a trend to port a lot of *nix based tools to the win32 platform.
71
See my article “Identifying ICMP Hackery Tools Used In The Wild Today”, http://www.sys-
security.com/archive/securityfocus/icmptools.html.
167
What will happen if a certain field inside the ICMP query message will be sent with a mangled
field value? Which operating system will answer the request and do the response will reveal
unique information regarding the replying operating system?
We will force the target to generate an ICMP error message by mangling a certain field value in
our query. We have several field values that we can choose from in order to generate several
different ICMP error messages.
All conditions forced by the query host on the targeted IP address, will force the underlying OS
kernel to issue an ICMP error message. With only one exception, all the error conditions will
always trigger an ICMP error message.
For example, if we will use a value, which does not represent a valid protocol number field value
with the IP header, the targeted host will elicit an ICMP Destination Unreachable Protocol
Unreachable error message back to the offending packets IP source address.
nmap 2.54 Beta 1 has integrated this and Fyodor has named it - IP Protocol scan. nmap sends
raw IP packets without any further protocol header (no payload) to each specified protocol on the
target machine. If an ICMP Protocol Unreachable error message is received, the protocol is not in
use. Otherwise it is assumed it is opened (or a filtering device is dropping our packets).
In the next example I have used nmap 2.54 beta 22 in order to scan a Microsoft Windows 2000
SP1 Professional machine:
72
You can find more information in the “Advanced Host Detection methods with the ICMP protocol” section.
168
The method used by nmap is easily detected, since the datagrams we will see in our logs will not
have payloads. It should turn in nmap quite easily.
A malicious computer attacker may use only one datagram with this method. Again, the nature of
the datagram, not having a payload, will educate us about the tool used (and the platform it might
be compiled on).
The usage of advanced host detection methods will help us map hosts and networking devices
onthe network we are targeting, and host(s) communicating/probing it.
Using the TOS field inside the IP Header with a method called “TOS Echoing”.
Using the ‘Unused bit’ inside the IP Header. Sun Solaris and HPUX 11.x will echo
back this field when it will be set.
What will happen if the DF bit will be set with the ICMP requests? Than according to
the type of the request sent we can identify several operating systems. This method
is called “DF bit echoing”.
Sending ICMP query message types with the Code field set to a value different than
zero.
What will happen if the ICMP Address Mask request will be fragmented? It will allow
us to fingerprint Sun Solaris and HP-UX 11.0 (and probably 10.30) based machines.
With the examples above, as well as with the regular ICMP query messages, if a tool is known to
produce this kind of tests (one such tool is sing, available from
169
One notable distinction between the regular ICMP queries to the advanced ICMP queries is that
with some of the advanced methods we can reveal a certain operating system, where with the
regular ICMP queries we can only group certain operating systems together or hope that other
variants of ICMP query message types will be used against the system in question so we will
have more information in hand, that may help us to conclude the operating system in use.
The database will hold information about operating systems, which will produce other interesting
data with the ICMP query replies as well.
An example:
Our sensor have picked the following traffic exchanged:
17:23:46.605297 if 4 > x.x.x.x > y.y.y.y: icmp: echo request [tos 0x8]
(ttl 255, id 13170)
4508 0024 3372 0000 ff01 60e4 xxxx xxxx
yyyy yyyy 0800 0e9a d604 0600 f2ea bc39
553c 0900
17:23:46.895255 if 4 < y.y.y.y > x.x.x.x: icmp: echo reply [tos 0x8]
(ttl 243, id 58832)
4508 0024 e5d0 0000 f301 ba85 yyyy yyyy
xxxx xxxx 0000 169a d604 0600 f2ea bc39
553c 0900
The IP address y.y.y.y is a valid IP address for a machine used in the network we are
monitoring.
Whether the querying IP address is internal or external to the network being probed.
An ICMP Echo request was sent with a TOS byte field value set to 0x8 hex. The
operating system, which has answered the query (y.y.y.y), echoed back the TOS
field.
We can conclude that the probed operating system is not Microsoft Windows 2000,
Novell Netware or ULTIX. This is based on the TOS field echoing fingerprinting
method I have introduced in my research about ICMP.
We have other relevant information we can use here; we will explain those issues later on.
170
Operating system, which do not generate ICMP Protocol Unreachable Error Messages
LINUX ICMP Error Message Quoting Size Differences / The 20 Bytes from No Where
Foundry Networks Networking Devices Padded Bytes with ICMP Port Unreachable(s) /
The 12 Bytes from No Where
ICMP Error Message Echoing Integrity (Tested with ICMP Port Unreachable)
Novell Netware Echoing Integrity Bug with ICMP Fragment Reassembly Time Exceeded
Since not all ICMP query request message types are implemented on the various operating
systems it leaves us only with ICMP Echo requests to be examined closely.
Please note: “ping” uses its own default values for several field values within the ICMP Echo
request datagram it generates, and not the Operating System’s.
Which information and field values will interested us the most in an ICMP Echo request generated
by a “ping” utility?
The IP Portion
IP TTL
IP Options
0 4 8 16 31
4 bit
4 bit 8-bit type of service
Header 16-bit total length ( in bytes )
Version Length (TOS)=0
3 bit
16-bit identification 13-bit Fragment Offset
Flags
Options ( if any )
IP Data
Identifier Sequence Number
Field
Data...
172
Discussed in Section 7.
8.3.3.1.5 IP Options
T.B.D.
Is the same ICMP ID value is assigned to the same host each time we issue the ping
command?
73
RFC 792, The Internet Control Message Protocol. http://www.ietf.org/rfc/rfc0792.txt.
173
Operating System ICMP ID Field Source of the ICMP ID Carry the same ID Gap
Value Number number to the
Starts with same host with
HEX / Decimal another ICMP
Echo request?
Windows 95
Windows 98
Windows 98 SE 200 / 512 Yes Value Always = 512
Equals the number first
assigned
Windows ME 300 / 768 Yes Value Always = 768
Equals the number first
assigned
Windows NT 4
Workstation SP3
Windows NT 4 100 / 256 Yes Value Always = 256
Workstation SP6a Equals the number first
assigned
Windows NT 4 Server 100 / 256 Yes Value Always = 256
SP4 Equals the number first
assigned
174
Operating System ICMP ID Field Source of the ICMP ID Carry the same ID Gap
Value Number number to the
Starts with same host with
HEX / Decimal another ICMP
Echo request?
With the Microsoft based operating systems constant values are used.
With the introduction of Service Pack 1 for Microsoft Windows 2000 family of operating systems
the ICMP ID field value has changed from the value of 512 to 768.
The “ping” utility with UNIX and UNIX-like operating systems will use the Process ID (PID) as its
ICMP ID value.
When examining an ICMP Echo request produced with the “ping” utility and identify the values of
256, 512, & 768 as being used for the ICMP ID, we will than conclude that the issuing host is
running one of the Microsoft Windows operating systems.
8.3.3.2.1.3 Is the same ICMP ID value is assigned to the same host each time?
We send an ICMP Echo request to a host and receive a reply. We than issue another ICMP Echo
request to the same host. Will the ICMP ID field number be the same as it was with the previous
request?
175
The “ping” utility with UNIX and UNIX-like operating systems will use the Process ID (PID) as its
ICMP ID value. Therefore the ICMP ID field value will change each time we issue the command.
In the next example I have sent an ICMP Echo request to a Microsoft Windows 2000 based
machine from a LINUX based machine running Kernel 2.2.14:
Since Microsoft based operating systems use constant values for the ICMP ID field value, there is
no gap between one ICMP ID number to another.
8.3.3.2.1.5 The usage of ICMP ID and Sequence Numbers with Microsoft Based Operating
Systems
RFC 792 (Internet Control Message Protocol) suggests how the ICMP Identifier field and the
ICMP Sequence Number field should be used:
“The identifier and sequence number may be used by the echo sender to aid in matching the
replies with the echo requests. For example, the identifier might be used like a port in TCP or
UDP to identify a session, and the sequence number might be incremented on each echo request
sent. The echoer returns these same values in the echo reply”.
176
It literally suggests that the ICMP Identifier field will be used to differentiate between ICMP Query
messages sent to different hosts. It also suggests that the ICMP Sequence Number field will be
used to differentiate between the ICMP query messages sent to the same host.
The ‘ping’ utility with UNIX and UNIX-like operating systems has adopted this suggestion.
When examining the behavior of the ‘ping’ utility with Microsoft Windows based operating
systems I have encountered a different behavioral pattern.
As it can be seen, the ICMP Identifier field value is the same with both instances. This is
regardless the fact we are using the ‘ping’ utility to send ICMP Echo requests to two separate
hosts. The number assigned to this field is 768 decimal.
So how does the ‘ping’ utility with Microsoft based operating systems differentiate between the
different ICMP Queries?
The ‘ping’ utility is using the Sequence Number field. For each ICMP Echo Request the ICMP
Sequence Number is a unique number. The gap between one ICMP Sequence Number field
value to another is 100 hex/256 decimal.
If the ICMP Identifier field has a constant value, can we identify the different Microsoft operating
systems passively when someone is using the ‘ping’ utility to query our machines?
Yes.
With the ‘ping’ utility with Microsoft based operating systems the values assigned for the
different ICMP datagram fields are OS based (in contrast with the ‘ping’ utility on UNIX and
UNIX-like operating systems which uses the application own values for the different ICMP
datagram fields). When using other applications with Microsoft based operating systems to
generate ICMP Query messages the ICMP Identifier field values will still be the same as it was
with the ‘ping’ utility, if these applications will be using the Microsoft MFC.
Therefore when ever we see an ICMP Query datagram with an ICMP Identifier field value of
256/512/768 it will indicate that the underlying operating system to be used is an MS based.
We can also look at the ICMP Sequence Number field value for extra information. The ‘ping’
utility with MS based operating systems will issue its first ICMP Query message with the ICMP
Sequence Number field set to a value of 256 (the ‘ping’ utility with UNIX and UNIX-like operating
systems will have this field value set to 0 on its first query to a Host). This field value will increase
with 256 decimal each time we send an ICMP Query message (with the UNIX and UNIX-like
‘ping’ utility the field value will increase only if we are sending sequential Queries. Each time we
issue the ‘ping’ command this field value will be set to 0 on the first query to be sent).
178
We can even calculate the number of ICMP Query messages a Windows based OS have issued
since the last boot time. All we need to do is divide the ICMP Sequence number field value with
256.
Microsoft can argue that their ICMP implementation is not in contrast with RFC 792, since the
term that was used in order to describe the usage of the ICMP Identifier field was “may be used”.
But if we use common sense, than what role, in the Microsoft case, the ICMP Identifier field has?
Since ICMP Echo requests carry with them the sequence number, and its starting number
changes from one implementation to another, along with the fact that the gap between each
number is different between one operating system to another it gives us another important piece
of information to identify various operating systems on the passively probed network.
Solaris 2.5.1
Solaris 2.6 0 1/ 1
Solaris 2.7
Solaris 2.8
Windows 95
Windows 98
Windows 98 SE 256 100 / 256
Windows ME 256 100 / 256
Windows NT 4 Workstation SP3
Windows NT 4 Workstation SP6a 256 100 / 256
Windows NT 4 Server SP4 256 100 / 256
Windows 2000 Professional SP1 256 100 / 256
Windows 2000 Server SP1 256 100 / 256
Windows 2000 Advanced Server 256 100 / 256
179
Microsoft based operating systems will use 256 as their initial ICMP sequence number field value,
while UNIX and UNIX-like operating systems will use the value of 0.
Microsoft based operating systems as well as Linux based machines and *BSD based machines,
use a gap of 256 (100 Hex) between one sequence number to another sent in a series to the
same host.
AIX and Sun Solaris, as well as other UNIX and UNIX-like operating systems, will use a gap of 1
(1 Hex).
In the next example I have sent an ICMP Echo requests from an AIX 4.1 machine to a Linux
based on Kernel 2.2.14 machine. The sequence number is in bold:
The RFC does not specify how much data should be sent along with the ICMP Echo request. It
only states, “Adds some data”. The RFC does not specify what is the data sent as well.
The parameters we relate to with the ICMP data field with ICMP Echo request are:
The Offset of the data field portion from the ICMP Header
The size of the data field
The content of the data field
8.3.3.2.3.1 The Offset of the data portion from the end of the ICMP Header
With Microsoft based operating system’s “ping” utility the Echo Request’s data portion comes
right after the end of the ICMP datagram IP Header.
With UNIX and UNIX-like operating systems the first 8 bytes of the ICMP data portion are being
used for the calculation of the round trip time (RTT)74.
74
This brings another creative thought into mind – How does Microsoft based operating systems calculate the round trip
time. It is quite obvious that it somehow “remembered”.
181
Table 27: Different ICMP data field size(s) and Total Datagram size(s)
The ping utility with UNIX and UNIX-like operating systems use 56 bytes for the ICMP data field
(8 bytes of those are used for the calculation of the round trip time).
Microsoft Windows operating systems use 32 bytes for the ICMP data field portion.
If HPUX 10.30/11.0x or AIX 4.3.x use the path MTU discovery process that is based on ICMP
Echo requests, we will see ICMP Echo request datagrams with size bigger than 576 bytes. An
example was given in the text for a datagram with the size of 1500 bytes.
The ping utility with Microsoft Windows based operating system will use the combination of
“abcdefghijklmnopqrstuvwabcdefghi” in its ICMP Data field.
While the ping utility with UNIX and UNIX-Like operating systems will use “08 09 0A 0B 0C 0D
0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25
26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37” which its ASCII
equivalent is “……………………!"#$%&'()*+,-./01234567”.
Again, the ping utility with UNIX and UNIX-Like operating systems use its first 8 bytes of the
ICMP Data field for calculating the round trip time, and only than put the arbitrary code.
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ................
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F !"#$%&'()*+,-./
30 31 32 33 34 35 36 37 01234567
Aix 4.1
This is a good example where the second ICMP Echo request did not make it to the destination
system.
183
184
They all can be used in Host Detection, Invrerse Mapping, and OS fingerprinting
attempts.
If you examine the list closely all ICMP message types, whether query types or error types are
listed.
9.2 Outbound
There are people who claim that any traffic type of ICMP should be allowed from a protected
network to the Internet. This is not true, in my opinion. Filtering the incoming traffic does not mean
we are protected from some of the security hazards I have outlined in this paper.
ICMP “Fragmentation Needed but the DF bit was set” (Type 3 Code 4)
To prevent misconfiguration errors as outlined in the “Advanced Host Detection” section.
185
The current state with filtering devices is not that good. Most of the products in the market
today do not perform true stateful inspection with the ICMP protocol. Allowing ICMP Echo
replies inside your protected network is very dangerous and simply not worth the risk.
Unless you use a true stateful filtering device with the ICMP protocol don’t let ICMP Echo
replies into your protected network. This will make your requests useless. block them as
well.
o Since hosts still react to ICMP Source Quenches by slowing communication, they
can be used as a Denial-of-Service measure.
186
Redirect messages
o If you can forge ICMP Redirect error messages, and if your target host pays
attention to them - ICMP redirects may be employed for denial of service attacks,
where a host is sent a route that loses it connectivity, or is sent an ICMP Network
Unreachable packet telling it that it can no longer access a particular network.
It is also depends upon the operating systems you are using in your network segments. Some
operating systems will react differently to ICMP fragmentation needed but the DF bit was set error
messages than other operating systems.
If you will block incoming ICMP “Fragmentation Needed but the Don’t Fragment Bit was Set” error
messages, your network performance will suffer from degradation. You should understand the
security risks involving in opening this kind of traffic to your DMZ (& protected network) - The
possibility of a Denial-of-Service, Inverse Mapping, Host Detection, and a one-way Covert
communication channel (which was not been seen in the wild yet).
Another consideration can be the usage of network troubleshooting tools such as traceroute
and ping. In the case of traceroute if the filtering device you are using does not support true
stateful inspection with ICMP than allowing ICMP TTL Exceeded In Transit (Type 11, code 0)
error messages inside the protected network can lead to various security hazards. The same
goes with ping, where ICMP Echo reply is even more dangerous when allowed inside the
protected network (Inverse Mapping, Covert Channel and more security risks).
You can limit the number of systems that need to use the network troubleshooting tools with ACL,
but bear in mind that these systems, probably, can be mapped from the Internet – and this is only
the tip of the iceberg.
75
See Section 2 for more information on the Path MTU Discovery process.
187
Unless your filtering device is a real intelligent one, doing his work with dynamic tables and
correlating correctly the ICMP replies with the ICMP requests, do not open your Internal network
segment to ICMP traffic at all.
Some might offer to use a Proxy server with the ICMP protocol as a barrier between the Internet
and your protected network(s). A Proxy Server is only a tunnel – remember that.
Direct Link
* Y ou can hav e a dedicated Management station that would be allowed to use ICMP f or
troubleshooting purposes only . The v arious ICMP replies should be allowed only by a statf ul
inspection / Dy namic f irewall. This means that no incoming ICMP is traf f ic is allowed to the
management station, unless its correlated with a prev ious ICMP query this machine
produced.
** If a malicious computer attacker breaks into the DMZ y ou do not want to prov ide him the
means to scan internal machines & and the ability to query them directly .
You have an Internal segment built with Microsoft based operating system machines (for the sake
of the example only). A malicious computer attacker might send you a Trojan that will have Host
detection and/or mapping capabilities. It will be hidden in an Email message (either as attachment
or some other thing) a naïve user will open. After activation it will start to map internal hosts and
internal segments and send the information back to the malicious computer attacker.
What will be the easiest method in order to map internal host(s)? Ping them probably.
How many of you reading this research have “management segments” that are allowed to use the
ping utility in order to verify that some Hosts are alive?
188
If something like this Trojan gets its way to this segment than probably your entire internal
networking infrastructure (or important part of it) will be revealed.
Some one might think that strong filtering or a good anti virus might help – forget it. I have seen
people separating their work environment to more than two or three computers, but they always
use the Email, and need to surf the web… (good ways to send the collected information out).
My suggestion is to configure internal host(s) not to answer for ICMP query message types they
should not answer for. I would restrict this to the maximum and not allow internal hosts to be
queried with any ICMP query message type.
If you can afford it, install a personal firewall on all internal hosts, and confiure it to block all ICMP
queries.
Management
Boarder Router
None None
"Stateful Firewall"
189
Some firewalls will hold a certain portion of a fragmented packet until the IP Header and the
underlying protocol’s header arrives. Sometimes, the ICMP error message for Fragment
Reassembly Time Exceeded will not be of the Host, it will be of the Firewall spoofing it. Some
Firewalls has the ability to spoof ICMP Echo replies for Hosts they are defending. We will have
the opportunity to fingerprint the operating system, which the firewall software is installed on.
We will gain an extremely important ability. Therefore it is recommended to have two basic rules
when you configure your firewall’s rule base. The first rule will be to deny any traffic destined to
the firewall and the second rule will be to deny any error messages (or other conditions such as
TCP reject etc.) initiated from the Firewall destined the Internet that might help a malicious
computer attacker in his task to fingerprint the Firewall itself.
190
10.0 Conclusion
The ICMP protocol is a very powerful tool in the hands of smart malicious computer attackers.
Mapping, detecting, and fingerprinting of hosts and networking devices can be done in various
ways as I have outlined in this paper.
It is extremely important to understand that ICMP traffic can be used for other malicious activities
other than scanning, such as:
Therefore filtering Inbound and Outbound ICMP traffic is very important and may help you in
preventing risks to your computing environment.
191
11.0 Acknowledgment
11.1 Acknowledgment for version 1.0
I would like to thank the following people for their help with/during this research.
Ariel Pisetsky for going over this paper correcting my English, and for his moral support.
Special thanks to mr2940 for his patience while I introduced my new ideas.
James Cudney, Michael, Pat, for their support when the times where bad.
I would like to thank Fyodor for his help providing me with necessary test systems.
I would like to thank the people who provided feedback to the first version of this research paper,
and to the people who provided feedback to my Bugtraq posts.
I would like to thank Fyodor for his help providing me with necessary test systems.
I would like to thank the huge amount of people who provided feedback for my work.
JD Glaser
Jeff Moss
Lance Spitzner
Marty Roesch
Simple Nomad
Max Vision
I would like also to thank the huge amount of people who provided feedback for my work.
192
193
194
195
Operating System Info. Time Stamp Address Mask Address Mask IP TTL on IP TTL on
Request Request Request Request Frag. ICMP ICMP
datagrams datagrams
- In Reply - - In Req. -
Linux Kernel 2.4.x - + - - 255 64
Linux Kernel 2.2.x - + - - 255 64
Linux Kernel 2.0.x 64 64
Windows 95 - - + + 32 32
Windows 98 - + + + 128 32
Windows 98 SE - + + + 128 32
Windows ME - + - - 128 32
Windows NT 4 WRKS - - + + 128 32
SP 3
Windows NT 4 WRKS - - - - 128 32
SP 6a
Windows NT 4 Server - - - - 128 32
SP4
Windows 2000 - + - - 128 128
Professional
Windows 2000 Server - + - - 128 128
196
Networking Info. Time Stamp Address Mask Address Mask IP TTL on IP TTL on
Devices Request Request Request Request Frag. ICMP ICMP
datagrams datagrams
- In Reply - - In Req. -
Cisco Catalyst + + + - 60 60
5505 with OSS
v4.5
197
Operating System Info. Request Time Stamp Request Address Mask ECHO
Request Request
Windows 95 - - + + (0)
Windows 98 - - (CHANGE) + + (0)
Windows 98 SE - - (CHANGE) + + (0)
Windows ME - - (CHANGE) - + (0)
Windows NT 4 WRKS SP 3 - - + + (0)
Windows NT 4 WRKS SP 6a - - - + (0)
Windows NT 4 Server SP4 - - - + (0)
Windows 2000 Professional - - (CHANGE) - + (0)
Windows 2000 Server - - (CHANGE) - + (0)
198
Networking Devices Info. Request Time Stamp Request Address Mask ECHO
Request Request
199
Operating System Info. Request Time Stamp Request Address Mask Echo Request
Request
Broadcast
Broadcast Broadcast Broadcast
FreeBSD 4.0 - - - -
FreeBSD 3.4 - - - -
OpenBSD 2.7 - - - -
OpenBSD 2.6 - - - -
NetBSD
BSDI BSD/OS 4.0
BSDI BSD/OS 3.1
Solaris 2.5.1 * + - +
Solaris 2.6 * + - +
Solaris 2.7 * + - +
Solaris 2.8 * + - +
HP-UX v10.20 + + - +
Irix 6.5.3
Irix 6.5.8
AIX 4.1
AIX 3.2
OpenVMS v7.1-2
Windows 95
Windows 98 - - - -
Windows 98 SE - - - -
Windows ME - - - -
Windows NT 4 WRKS SP - - - -
3
Windows NT 4 WRKS SP - - - -
6a
Windows NT 4 Server SP4 - - - -
Windows 2000 - - - -
Professional
Windows 2000 Server - - - -
200
201
202
Operating System Information Time Stamp Request Address Mask Echo Request
Request With TOS!=0x00 Request With TOS!=0x00
With TOS!=0x00 With TOS!=0x00
Novell Netware 5.1 SP1 Not Answering Not Answering Not Answering 0x00
Novell Netware 5.0 Not Answering Not Answering Not Answering 0x00
Novell Netware 3.12 Not Answering Not Answering Not Answering 0x00
203
Operating System Information Time Stamp Request Address Mask Echo Request
Request With Unused=1 Request With Unused=1
With Unused=1 With Unused=1
204
Operating System Info. Request Time Stamp Address Mask Echo Request
Request Request
OpenVMS v7.1-2 - - - -
Novell Netware 5.1 SP1 Not Answering Not Answering Not Answering -
Novell Netware 5.0 Not Answering Not Answering Not Answering -
Novell Netware 3.12 Not Answering Not Answering Not Answering -
205
Operating System Info. Request Time Stamp Address Mask Echo Request
Request Request
OpenVMS v7.1-2 + ( + DF ) + ( + DF ) + ( + DF )
Novell Netware 5.1 SP1 Not Answering Not Answering Not Answering + ( - DF )
Novell Netware 5.0 Not Answering Not Answering Not Answering + ( - DF )
Novell Netware 3.12 Not Answering Not Answering Not Answering + ( - DF )
206
76
The DF Bit is set.
207
Microsoft
windows 98
Mirosoft No Same Same Changed Changed Same
Windows according because of new
98SE to hop parameters.
count.
Microsoft No Same Same Changed Changed Same
Windows ME according because of new
to hop parameters.
count.
Microsoft No Same Same Changed Changed Same
Windows NT according because of new
4 to hop parameters.
count.
Microsoft No Same Same Changed Changed Same
Windows according because of new
2000 Family to hop parameters.
count.
208
FreeBSD No 1 255 0 8 56
4.1
FreeBSD No 1 255 According According 0 8 Symbols 56
3.4 to other to other & Signs
OpenBSD No 255 processes processes 8 56
2.7 in the in the
OpenBSD No 255 System System 8 56
2.6
NetBSD No 1 255 0 8 56
BSDI No 255 8 56
BSD/OS
4.0
BSDI No 255 8 56
BSD/OS
3.1
Windows No 32
95
Windows No 256 32 256 100 / 256 0 Alphabet 32
98
Windows No 256 32 200 / 512 Value 256 100 / 256 0 Alphabet 32
98 SE Always =
512
Equals
the
number
first
assigned
Windows No 1 32 300 / 768 Value 256 100 / 256 0 Alphabet 32
ME Always =
768
Equals
the
number
first
assigned
209
210
icmp_echo_ignore_all
Controls if the Kernel answer for ICMP Echo requests.
Default: Disabled (0)
icmp_echo_ignore_broadcast
“If either is set to true, then the kernel will ignore either all ICMP Echo requests sent to it
or just those to broadcast/multicast addresses, respectively”.
Default: Disabled (0)
icmp_ignore_bogus_error_responses
“Some routers violate RFC 1122 by sending bogus responses to broadcast frames. Such
violations are normally logged via a kernel warning. If this is set to TRUE, the kernel will
not give such warnings, which will avoid log file clutter”.
Default: Disabled (0).
You can configure these configuration options using commands similar to the following (which will
prevent the Linux based machine from answering an ICMP Echo requests):
The problem with Linux Kernel 2.2.x / 2.4.x is that we cannot block ICMP Timestamp requests, or
block ICMP Timestamp requests aimed at the broadcast address of the network the Linux based
machine resides on.
ip_respond_to_echo_broadcast
Control whether IPv4 responds to broadcast ICMPv4 echo request.
Default: 1 (Enabled)
77
Taken from “Solaris Tunable Parameters Reference Manual” for Sun Solaris 8. Available from http://docs.sun.com.
211
As root:
# ndd -set /dev/ip ip_respond_to_echo_broadcast 0
ip_respond_to_timestamp_broadcast
Control whether IPv4 responds to broadcast ICMPv4 timestamp request.
Default: 1 (Enabled)
As root:
# ndd -set /dev/ip ip_respond_to_timestamp_broadcast 0
ip_respond_to_address_mask_broadcast
Control whether IPv4 responds to broadcast ICMPv4 address request.
Default: 1 (Enabled)
As root:
# ndd /dev/ip ip_respond_to_address_mask_broadcast 0
ip_respond_to_timestamp
Controls if the Kernel answer for ICMP Timestamp request.
Default: 1 (Enabled)
As root:
# ndd -set /dev/ip ip_respond_to_timestamp 0
The problem with Sun Solaris is that we can still send ICMP Address Mask requests and ICMP
Echo requests destined the Sun Solaris based machine, and they will be answered.
Default:
100 milliseconds for ip_icmp_err_interval
10 for ip_icmp_err_burst
Range:
0 - 99,999 milliseconds for ip_icmp_err_interval
1 - 99,999 for ip_icmp_err_burst
ip_send_redirects
Controls wether IPv4 sends out ICMPv4 redirect messages.
Default: Enabled (1)
ip_ignore_redirects
Default: 0 (not ignore)
212
ip_icmp_return_data_bytes
When IPv4 or IPv6 sends an ICMPv4 or ICMPv6 error message, it includes the IP header
of the packet that causes the error message. This parameter controls how many extra
bytes of the packet beyond the IPv4 or IPv6 header to be included in the ICMPv4 or
ICMPv6 error.
Deafult: 64
Range: 8 to 65.536
ip_ire_pathmtu_interval
The interval in milliseconds when IP flushes the path maximum transfer unit (PMTU)
discovery information, and tries to rediscover PMTU.
Default: 10 Minutes
Range: 5 seconds to 277 hours
Other interesting parameters without any description in the Sun manuals are:
icmp_accept_clear_messages
ip_def_ttl
ip_broadcast_ttl
Create a script in the /etc/init.d directory and create links to it in the /etc/rc2.d,
/etc/rc1.d, and /etc/rcS.d directories.
The script should run between the existing S69inet and S72inetsvc scripts.
Name the script with the S70 or S71 prefix. Scripts with the same prefix are run in some
sequential way so it doesn’t matter if there is more than one script with the same prefix.
See the README file in the /etc/init.d directory for more information on naming run
control scripts.
213
alert icmp any any -> any any (msg:"ICMP Echo Reply"; itype: 0; icode:
0;)
alert icmp any any -> any any (msg:"ICMP Echo Reply (Undefined Code!)";
itype: 0;)
alert icmp any any -> any any (msg:"ICMP Unassigned! (Type 1)"; itype:
1; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Unassigned! (Tupe 1)
(Undefined Code)"; itype: 1;)
alert icmp any any -> any any (msg:"ICMP Unassigned! (Type 2)"; itype:
2; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Unassigned! (Type 2)"
(Undefined Code); itype: 2;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Network Unreachable)"; itype: 3; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable (Host
Unreachable)"; itype: 3; icode: 1;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Protocol Unreachable)"; itype: 3; icode: 2;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable (Port
Unreachable)"; itype: 3; icode: 3;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Fragmentation Needed and DF bit was set)"; itype: 3; icode: 4;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Source Route Failed)"; itype: 3; icode: 5;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Destination Network Unknown)"; itype: 3; icode: 6;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Destination Host Unknown)"; itype: 3; icode: 7;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Source Host Isolated)"; itype: 3; icode: 8;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Communication with Destination Network is Administratively
Prohibited)"; itype: 3; icode: 9;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Communication with Destination Host is Administratively Prohibited)";
itype: 3; icode: 10;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Network Unreachable for Type of Service)"; itype: 3; icode: 11;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable (Host
Unreachable for Type of Service)"; itype: 3; icode: 12;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Communication Administratively Prohibited)"; itype: 3; icode: 13;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable (Host
Precedence Violation)"; itype: 3; icode: 14;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Precedence Cutoff in effect)"; itype: 3; icode: 15;)
alert icmp any any -> any any (msg:"ICMP Destination Unreachable
(Undefined Code!)"; itype: 3;)
214
alert icmp any any -> any any (msg:"ICMP Source Quench"; itype: 4;
icode: 0;)
alert icmp any any -> any any (msg:"ICMP Source Quench (Undefined
Code!)"; itype: 4;)
alert icmp any any -> any any (msg:"ICMP Redirect (for Network or
Subnet)"; itype: 5; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Redirect (for Host)"; itype:
5; icode: 1;)
alert icmp any any -> any any (msg:"ICMP Redirect (for TOS and
Network)"; itype: 5; icode: 2;)
alert icmp any any -> any any (msg:"ICMP Redirect (for TOS and Host)";
itype: 5; icode: 3;)
alert icmp any any -> any any (msg:"ICMP Redirect (Undefined Code!)";
itype: 5;)
alert icmp any any -> any any (msg:"ICMP Alternate Host Address";
itype: 6; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Alternate Host Address
(Undefined Code!)"; itype: 6;)
alert icmp any any -> any any (msg:"ICMP Unassigned! (Type 7)"; itype:
7; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Unassigned! (Type 7)
(Undefined Code!)"; itype: 7;)
alert icmp any any -> any any (msg:"ICMP Echo Request"; itype: 8;
icode: 0;)
alert icmp any any -> any any (msg:"ICMP Echo Request (Undefined
Code!)"; itype: 8;)
alert icmp any any -> any any (msg:"ICMP Router Advertisment"; itype:
9; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Router Advertisment (Undefined
Code!)"; itype:9 ;)
alert icmp any any -> any any (msg:"ICMP Router Selection"; itype: 10;
icode: 0;)
alert icmp any any -> any any (msg:"ICMP Router Selection (Undefined
Code!)"; itype: 10;)
alert icmp any any -> any any (msg:"ICMP Time-To-Live Exceeded in
Transit"; itype: 11; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Fragment Reassembly Time
Exceeded"; itype: 11; icode: 1;)
alert icmp any any -> any any (msg:"ICMP Time Exceeded (Undefined
Code!)"; itype: 11;)
alert icmp any any -> any any (msg:"ICMP Parameter Problem Code 0
(unspecified Error)"; itype: 12; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Parameter Problem Code 1
(Missing a Requiered Option)"; itype: 12; icode: 1;)
alert icmp any any -> any any (msg:"ICMP Parameter Problem Code 2 (Bad
Length)"; itype: 12; icode: 2;)
alert icmp any any -> any any (msg:"ICMP Parameter Problem (Undefined
Code!)"; itype: 12;)
alert icmp any any -> any any (msg:"ICMP Timestamp Request"; itype: 13;
icode: 0;)
alert icmp any any -> any any (msg:"ICMP Timestamp Request (Undefined
Code!)"; itype: 13;)
alert icmp any any -> any any (msg:"ICMP Timestamp Reply"; itype: 14;
icode: 0;)
alert icmp any any -> any any (msg:"ICMP Timestamp Reply (Undefined
Code!)"; itype: 14;)
215
alert icmp any any -> any any (msg:"ICMP Information Request"; itype:
15; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Information Request (Undefined
Code!)"; itype: 15;)
alert icmp any any -> any any (msg:"ICMP Information Reply"; itype: 16;
icode: 0;)
alert icmp any any -> any any (msg:"ICMP Information Reply (Undefined
Code!)"; itype: 16;)
alert icmp any any -> any any (msg:"ICMP Address Mask Request"; itype:
17; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Address Mask Request
(Undefined Code!)"; itype: 17;)
alert icmp any any -> any any (msg:"ICMP Address Mask Reply"; itype:
18; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Address Mask Reply (Undefined
Code!)"; itype: 18;)
alert icmp any any -> any any (msg:"ICMP Reserved for Security (Type
19)"; itype: 19; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Reserved for Security (Type
19) (Undefined Code!)"; itype: 19;)
alert icmp any any -> any any (msg:"ICMP Traceroute"; itype: 30; icode:
0;)
alert icmp any any -> any any (msg:"ICMP Traceroute (Undefined Code!";
itype: 30;)
alert icmp any any -> any any (msg:"ICMP Datagram Conversion Error";
itype: 31; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Datagram Conversion Error
(Undefined Code!)"; itype: 31;)
alert icmp any any -> any any (msg:"ICMP Mobile Host Redirect"; itype:
32; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Mobile Host Redirect
(Undefined Code!)"; itype: 32;)
alert icmp any any -> any any (msg:"ICMP IPV6 Where-Are-You"; itype:
33; icode: 0;)
alert icmp any any -> any any (msg:"ICMP IPV6 Where-Are-You (Undefined
Code!)"; itype: 33;)
alert icmp any any -> any any (msg:"ICMP IPV6 I-Am-Here"; itype: 34;
icode: 0;)
alert icmp any any -> any any (msg:"ICMP IPV6 I-Am-Here (Undefined
Code!"; itype: 34;)
alert icmp any any -> any any (msg:"ICMP Mobile Registration Request";
itype: 35; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Mobile Registration Request
(Undefined Code!"; itype: 35;)
alert icmp any any -> any any (msg:"ICMP Mobile Registration Reply";
itype: 36; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Mobile Registration Reply
(Undefined Code!)"; itype: 36;)
alert icmp any any -> any any (msg:"ICMP SKIP"; itype: 39; icode: 0;)
alert icmp any any -> any any (msg:"ICMP SKIP (Undefined Code!"; itype:
39;)
alert icmp any any -> any any (msg:"ICMP Photuris Code 0 (Reserved)";
itype: 40; icode: 0;)
alert icmp any any -> any any (msg:"ICMP Photuris Code 1 (Unknown
Security Parameters Index)"; itype: 40; icode: 1;)
216
alert icmp any any -> any any (msg:"ICMP Photuris Code 2 (Valid
Security Parameters, But Authentication Failed)"; itype: 40; icode: 2;)
alert icmp any any -> any any (msg:"ICMP Photuris Code 3 (Valid
Security Parameters, But Decryption Failed)"; itype: 40; icode: 3;)
alert icmp any any -> any any (msg:"ICMP Photuris (Undefined Code!)";
itype: 40;)
alert icmp any any -> any any (msg:"ICMP Unknown Type";)
217
Ofir Arkin
Founder
http://www.sys-security.com
[email protected]
218