| |||||||||||||||||||||
Date: Tue, 26 Jun 2001 20:24:52 -0700
From: Ofir Arkin <ofir@sys-security.com.>
To: Bugtraq List <BUGTRAQ@securityfocus.com.>
Subject: Identifying OpenBSD 2.6-2.9 based machines using ICMP Port Unreachables
When a host generates an ICMP Error message it will echo some parts of the
offending packet. The ICMP Error message will include the IP Header and at
least 8 bytes of data from the offending packet.
There are some fingerprinting methods which relay on the fact that some
operating systems do not echo correctly the offending packet's data.
It is known that some operating systems do not echo correctly the IP Total
Length field value. The problem is that some operating systems echo a value
which is 20 bytes bigger than the original value carried with the offending
packet.
During my research on X (to be published at the Black Hat Briefings 2001
July 11-12) I have found a new fingerprinting method that involves the same
field value. With this method the IP Total Length field value being echoed
(with an ICMP Port Unreachable Error Message) is 20 bytes less than the
original value. With the next example I have used hping2 to generate a UDP
datagram with 80 bytes of data querying UDP port 50 on my OpenBSD 2.9 i386
based machine:
[root@godfather /root]# hping2 -2 -y -p 50 -d 80 172.18.2.145
eth0 default routing interface selected (according to /proc)
HPING 172.18.2.145 (eth0 172.18.2.145): udp mode set, 28 headers + 80 data
bytes
ICMP Port Unreachable from 172.18.2.145 (unknown host name)
ICMP Port Unreachable from 172.18.2.145 (unknown host name)
ICMP Port Unreachable from 172.18.2.145 (unknown host name)
...
The tcpdump trace:
09:52:33.989622 eth0 > 172.18.2.201.2999 > 172.18.2.145.re-mail-ck: udp 80
(DF) (ttl 64, id 5207)
4500 006c 1457 4000 4011 c8ab ac12 02c9
ac12 0291 0bb7 0032 0058 c808 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 5858 5858 5858 5858 5858 5858
5858 5858 5858 5858 5858 5858
09:52:33.989622 eth0 < 172.18.2.145 > 172.18.2.201: icmp: 172.18.2.145 udp
port re-mail-ck unreachable Offending pkt: 172.18.2.201.2999 >
172.18.2.145.re-mail-ck: udp 80 (DF) (ttl 64, id 5207) (ttl 255, id 41822)
4500 0038 a35e 0000 ff01 bae7 ac12 0291
ac12 02c9 0303 28b3 0000 0000 4500 0058
1457 4000 4011 c8bf ac12 02c9 ac12 0291
0bb7 0032 0058 c808
The snort trace:
06/20-09:53:07.989622 172.18.2.201:3033 -> 172.18.2.145:50
UDP TTL:64 TOS:0x0 ID:10872 IpLen:20 DgmLen:108 DF
Len: 88
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 XXXXXXXXXXXXXXXX
06/20-09:53:07.989622 172.18.2.145 -> 172.18.2.201
ICMP TTL:255 TOS:0x0 ID:51307 IpLen:20 DgmLen:56
Type:3 Code:3 DESTINATION UNREACHABLE: PORT UNREACHABLE
| |||||||||||||||||||||
|