Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Network Intrusion Detection, Third Edition.pdf
Скачиваний:
220
Добавлен:
15.03.2015
Размер:
2.58 Mб
Скачать

they would bow again, and so on, until they finally looked up with a pained expression and walked away. I cannot look at an Echo-Chargen trace without thinking about that little trick. The example trace is UDP, but I have found you can make the oscillation with the TCP variant of these services as well, although I haven't figured out how to spoof the address and make it

work. For fun, if you have Cisco routers, telnet to your router's Echo or Chargen port. For instance, $ telnet myrouter 7 accesses the TCP echo port. Many Cisco routers seem to

have these open by default.

Elegant Kills

Brute-force attacks tend to rely on spoofed addresses to provide a bit of cover for the attacker. One packet kills can operate with a much lower footprint. They take advantage of flaws in the IP stack's capability to deal with illegal conditions, or even bad programming. The following sections look at several of these, including Echo-Chargen, Teardrop, Land, and a fun little attack against an adventure game called Doom.

Teardrop

Smurf and Echo-Chargen work by brute force; Teardrop works by finesse. It takes advantage of a simple fact: Network protocol stacks are not good at math. They are especially bad at negative numbers. This is another ancient attack, and although it is still in use, I do not see it that often. My intrusion-detection students must complete a practical assignment to achieve certification. The assignment varies in the details, but essentially it is to collect and analyze about 10 network traces. Quite often, they instrument their cable modems and collect data for a while, and Teardrop shows up on many of the practical assignments. Therefore, it is still being tried. The next question is this: Does it still work? Sure, but only on unpatched or older operating systems. The following is an example of a Teardrop trace:

10:25:48.205383 wile-e-coyote.45959 > target.net.3964: udp 28 (frag 242:36@0+)

10:25:48.205383 wile-e-coyote > target.net: (frag 242:4@24)

Because it has been a long time since Chapter 3, "Fragmentation," perhaps a reminder is in order. The top line shows a fragment named 242 with 36 octets of data for offset 0. The second line shows 4 more octets of data for offset 24. Therefore to service this packet, the operating system would have to rewind from 36 to 24. Negative numbers can translate to very large positive numbers, and so the operating system is likely to scribble all over some other program's section of memory. Try this a couple times and you kill the system.

The core problem is that many IP stacks do not know how to deal with negative, or illegal, numbers. I most recently saw this when the PROTOS toolkit was released along with a CERT advisory on February 12, 2002. HD Moore, a security researcher, was running the toolkit against a Red Hat, Linux 7 box and caused a segmentation fault. We tried to look at this packet with Ethereal, but it killed Ethereal. A TCPdump trace is shown here:

18:49:54.519006 10.0.0.1.59108 > 10.0.0.2.161: GetRequest(33)

.1.3.6.1.2.1.1.5.0[len3<asnlen4294967295] (DF) 4500 004c 0000 4000 4011 269f 0a00 0001

0a00 0002 e6e4 00a1 0038 0efc 302e 0201

0004 0670 7562 6c69 63a0 2102 0206 9202

0100 0201 0030 1530 1306 082b 0601 0201

0105 0044 84ff ffff ff02 0100

Notice that, at the top of the trace, TCPdump is trying to tell us something about the Abstract

Syntax Notation (ASN.1) length being over 4 billion bytes long. Even with modern systems, that is one heck of a lot of memory to allocate to a single packet. The 84ff ffff ff02 near the

end of the hex dump is the value in the length field, if you were just dying to know that.

It is just a matter of time until someone finds another field in the IP stack to do this trick with.

Note that another characteristic of fragmentation is that it eludes some intrusion-detection systems that do not support packet reassembly.

Land Attack

The Land attack is famous for two reasons: It is a very elegant oneor two-packet kill, and it is the "hello world" of intrusion-detection filters. As soon as I heard about it, I wrote a filter to detect it—after all, you cannot ask for an easier signature. But we never captured an attack. I was afraid we had made some kind of silly error in the filter, so I downloaded the attack exploit and compiled it. Now what system could I run it against? I needed something that had intrusion detection running so that I could get a trace of the attack. At that time, we had only intrusion detection in the DMZ. What about the web server? It was in the DMZ. So, I put the web server's IP address into the exploit script, fired the exploit, and boom, the web server crashed as advertised. I hurried over to reboot the web server and never gave the experiment a second thought. Well, until our intrusion-detection analyst called. She was so excited because she had found an actual Land attack and had already reported it to our CIRT. I just kind of said, "Great job," and spent the rest of the day quietly whistling to myself. The detect she saw is shown in the trace below:

12/03/97 02:19:48

192.168.1.1

80

-> 192.168.1.1

80

192.168.1.1

31337 -> 192.168.1.1

12/03/97 02:21:53

31337

 

 

 

I hope the statute of limitations for this deed has passed by the time this book gets printed.

We're Doomed

I love the culture I live in. First, they convince my kid to play with dolls; they just call them action figures. When he finally gets too old to play with dolls, he trades his plastic action figures in for cyber action figures. Some of the great cyber action figures, complete with horns and everything, live in the game of Doom.

Doom is played on port 666. So what is going on in the following trace?

12/03/97 02:19:48

0

206.256.199.8

19

-> 192.168.102.3

666

0

206.256.199.8

19

-> 164.256.23.100

12/03/97 02:21:53

666

0

206.256.199.8

19

-> 164.256.140.32

12/03/97 02:28:20

666

0

206.256.199.8

19

-> 192.168.18.28

12/03/97 02:30:29

666

0

206.256.199.8

19

-> 164.256.67.121

12/03/97 02:30:44

666

0

206.256.199.8

19

-> 164.256.140.32

12/03/97 02:34:47

666

0

206.256.199.8

19

-> 147.168.130.93

12/03/97 02:35:28

666

0

206.256.199.8

19

-> 192.168.18.28

12/03/97 02:36:56

666

0

206.256.199.8

19

-> 147.168.153.78

12/03/97 02:39:23

666

0

206.256.199.8

19

-> 147.168.130.93

12/03/97 02:41:55

666

 

 

 

 

Apparently, some individuals are so bored that they are spoofing a bunch of addresses, such that if these attackers chance on folks playing Doom, the Chargen output might disrupt the game in some way (and a single packet can be enough to do the trick).

The following simulated reconstructed trace shows the cause and effect of such an action, finding a Doom server. Again, 147.168.153.78 in this case is spoofed, and the activity is being caused by an unknown IP address. Although Doom traffic is becoming more rare these days, a similar game called Quake still generates a packet or two. Here is the Doom trace:

12/03/97 02:39:22

0

147.168.153.78

666

-> 206.256.199.8

19

0

206.256.199.8

19

-> 147.168.153.78

12/03/97 02:39:23

666

 

 

 

 

Actually, I had not seen this trace in a long time and was going to remove it from the material; then the following variant showed up again in January 1999. Note that the intrusion-detection system did flag this. What tips us off and lets us know that?

17:58:13.725824 doomer.echo > 172.20.196.51.666: udp 1024 (DF) 17:58:13.746748 doomer.echo > 172.20.196.51.666: udp 426 (DF) 18:03:24.133079 doomer.echo > 172.20.46.79.666: udp 1024 (DF) 18:03:24.157238 doomer.echo > 172.20.46.79.666: udp 426 (DF)

21:05:22.503299 dns1.arpa.net.domain > doomer.domain: 42815 (44) 21:05:26.152327 doomer.domain > dns1.arpa.net.domain: 42815* 2/0/0 (98) (DF) 23:50:15.728480 doomer.echo > 172.20.76.2.666: udp 1024 (DF) 23:50:15.751821 doomer.echo > 172.20.76.2.666: udp 426 (DF)

Sure! The domain lookup is a big hint! We have already discussed Echo and Chargen, and we have seen them show up together. What is going on? The attacker is bouncing off an open echo port to cover his tracks, the receiving computer will see the system with echo port in the source address field, not the attacker. The attacker spoofs the address of the target machine to a machine, and then bounces traffic off these ports onto the game. The preceding signature is a tough one; 7 to 666 is also a classic signature of a UDP flood denial-of-service program called Pepsi. However, Pepsi scanners do not usually pause for a refreshing DNS lookup.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]