Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Network Intrusion Detection, Third Edition.pdf
Скачиваний:
213
Добавлен:
15.03.2015
Размер:
2.58 Mб
Скачать
12/03/97 02:35:53 EB419A7E muon.phy.nnn.gov sunrpc
12/03/97 02:35:56 EB419A7E muon.phy.nnn.gov sunrpc
12/03/97 02:36:02 EB419A7E muon.phy.nnn.gov sunrpc
12/03/97 02:36:08 F94110F6 muon.phy.nnn.gov sunrpc
12/03/97 02:47:46 C4AF4C22 muon.phy.nnn.gov sunrpc
12/03/97 02:47:52 C4AF4C22 muon.phy.nnn.gov sunrpc
12/03/97 03:09:26 A63222B3 muon.phy.nnn.gov gw1.havregrace.arpa.net sunrpc
12/03/97 03:09:29 A63222B3 muon.phy.nnn.gov gw1.havregrace.arpa.net sunrpc
12/03/97 03:09:35 A63222B3 muon.phy.nnn.gov gw1.havregrace.arpa.net sunrpc

Single Exploit, Portmap

The following trace is fairly simple. In this case, a system is targeting multiple sites looking for portmapper. An interesting thing about this scan is that the attacking host comes from a U.S. Government lab. Despite the way the government is portrayed by the X-Files and in various movies, this probably is not a covert plot. Instead, when you get attacked by government computers, it is an opportunity to make a difference: That system is probably compromised. When I called that lab, the fellow in charge of security was so thankful for the tip that he was willing to send me the attack code and data files from the attacker. The attack code was targeting rpc.statd. The data files had two names: XXX.domains and XXX.results, in which XXX was the target of the attack such as mil.domains and isp.domains. This is called the shopping list. The results file was a listing of systems that had systems with active, unprotected portmappers. These results files were presumably the shopping lists for the next stage of this attack, the actual exploit. The sensors in this case were TAMU netloggers, an interesting but

obsolete network-logging software package and their trace is shown below.

994 -> relay.nnnn.arpa.net

994 -> relay.nnnn.arpa.net

994 -> relay.nnnn.arpa.net

995 -> ns1.nnnn.arpa.net

954 -> 192.168.16.7

954 -> 192.168.16.7

861 ->

861 ->

861 ->

Port 111 TCP is an attempt to access portmapper. This trace was particularly interesting because for several years access attempts on TCP 111 were fairly rare, although UDP 111 attempts were quite common. This particular attempt was a harbinger of things to come. Note that the source ports are all below 1024, which indicates the process running on the government system is running as root. This system is compromised! By March 1998, this exploit was mowing down a large number of Sun Solaris systems, many of which were the DNS, web, or mail servers for their sites. This is particularly interesting because the vulnerability was widely known and the fix was widely available, as shown here:

Computer Emergency Response Team (CERT) put out a warning in December 1997 at

http://www.cert.org/advisories/CA-97.26.statd.htm.

More and more UNIX operating systems were shipping with "secure" portmappers.

Wietse Venema's code to protect portmapper was available at

http://coast.cs.purdue.edu/pub/tools/unix/portmap.

rexec

The following trace is just a variety of rexec attempts. The interesting thing about rexec is that it does expect a password for authentication. So, why don't the attackers use rlogin instead? They are probably trying default passwords, because rexec does not tend to log. Also, SGI systems shipped for a long time with a guest account with a password of guest. An attacker could then use this at least to get reconnaissance information and probably to also begin privilege escalation. An attacker has a low chance of being detected unless the site has either networkor host-based intrusion detection.

The following trace represents how many attempts?

21:30:17.210000 prober.1439 > 172.20.18.173.512: S 334208000:334208000(0) win 61440

21:30:22.720000 prober.1439 > 172.20.18.173.512: S 334208000:334208000(0) win 61440

21:30:46.720000 prober.1439 > 172.20.18.173.512: S 334208000:334208000(0) win 61440

21:31:02.170000 prober.1449 > 172.20.18.173.512: S 340608000:340608000(0) win 61440

21:31:07.720000 prober.1449 > 172.20.18.173.512: S 340608000:340608000(0) win 61440

21:31:31.720000 prober.1449 > 172.20.18.173.512: S 340608000:340608000(0) win 61440

Two attempts. Observe the source ports 1439 and 1449—each is retried two times. Also, note the sequence numbers: 33420… for the first three packets and 34060… for the second set of three packets. You need more data to make an educated assessment, but notice that the two sequence numbers end in 08000. Given two distinct TCP sequence numbers, it is very unlikely that they would have this pattern. This might indicate some kind of crafting of the sequence number. Look at other TCP sequence numbers referenced in the book, and you will discover

that most are fairly unique and do not show such patterns.

POP3

Here, we have a fast scan with nicely uniform arrival times. If this doesn't set off our scan detect code, nothing will! A number of POP buffer exploits exist, so the target is easy to understand.

What is odd about this trace is the host selection. The scan is targeting a particular subnet, number 14. But what is the deal with the hosts? If you were the analyst on duty and you saw

this, what would you check for?

20:35:25.260798 bad.guy.org.4086 > 192.168.14.101.110: S 20:35:25.279802 bad.guy.org.4129 > 192.168.14.119.110: S 20:35:25.281073 bad.guy.org.4141 > 192.168.14.126.110: S 20:35:25.287761 bad.guy.org.4166 > 192.168.14.128.110: S 20:35:25.290293 bad.guy.org.4209 > 192.168.14.136.110: S 20:35:25.295865 bad.guy.org.4234 > 192.168.14.141.110: S 20:35:25.303651 bad.guy.org.4277 > 192.168.14.146.110: S 20:35:25.317924 bad.guy.org.4302 > 192.168.14.173.110: S 20:35:25.319275 bad.guy.org.4378 > 192.168.14.171.110: S

(If my answer differs from yours, it's okay.) I would want to know whether these were actually active hosts on the 14 subnet. If they are, the attacker already clearly has some information about us from a previous intelligence-gathering effort. If they are active hosts, and also run

popd, it is past time to consider increasing the countermeasures for that subnet!

Targeting SGI Systems?

The following trace shows a port scan, but it is pretty specific and it looks like a UNIX system is the target. This is believed to be targeted at SGI UNIX systems due to port 5232, part of their distributed graphics. Unless the intrusion-detection system is weighting the IMAP and telnet

port (and most do), this scan could easily be missed because it is only three packets:

21:17:12 prober.1351 > 172.20.4.6.imap: S 19051280:19051180(0) win 512 <mss

1460>

21:17:12 prober.1352 > 172.20.4.6.5232: S 12879079:12879079(0) win 512 <mss 1460>

21:17:12 prober.1353 > 172.20.4.6.telnet: S 42734399:42734399(0) win 512 <mss 1460>

Discard

When Discard gets a packet, it throws it away. When we detected this, we joked that it must be a student of Richard Stevens (because he uses Discard for many of the examples in his book). In this case, four SYNs were attempted to each host in the scan before moving on to the next

host in the scan:

08:02:35 dscrd.net.268 > 192.168.160.122.9: S 1797573506:1797573506(0) win 16384 (DF)

08:02:38 dscrd.net.268 > 192.168.160.122.9: S 1797573506:1797573506(0) win 16384 (DF)

Three-Port Scan

I added this scan primarily because the added latency of the HTTP portion of the scan. It is much slower than the rest of the trace. And as an added bonus, I bet you haven't seen a daytime scan before! Most likely, this is a benign network mapping effort out of Bell labs called Netsizer—of course, if the source address happens to be your primary competitor, you might

want to look into this further! Here it is:

20:50:04.532822 prober.54934 > myhost.domain: S 2118852885:2118852885(0) win 8760 (DF)

20:50:08.028023 prober.54934 > myhost.domain: S 2118852885:2118852885(0) win 8760 (DF)

20:50:14.432349 prober.54934 > myhost.domain: S 2118852885:2118852885(0) win 8760 (DF)

20:50:27.226116 prober.54934 > myhost.domain: S 2118852885:2118852885(0) win 8760 (DF)

20:50:52.824148 prober.54934 > myhost.domain: S 2118852885:2118852885(0) win 8760 (DF)

20:53:26.414741 prober.54944 > myhost.http: S 2144702009:2144702009(0) win 8760 (DF)

20:53:29.913485 prober.54944 > myhost.http: S 2144702009:2144702009(0) win 8760 (DF)

20:53:49.111043 prober.54944 > myhost.http: S 2144702009:2144702009(0) win 8760 (DF)

20:54:14.710959 prober.54944 > myhost.http: S 2144702009:2144702009(0) win 8760 (DF)

20:55:05.905554 prober.54944 > myhost.http: S 2144702009:2144702009(0) win 8760 (DF)

21:00:10.209063 prober.54968 > myhost.daytime: S 2196732969:2196732969(0) win 8760 (DF)

21:00:13.703247 prober.54968 > myhost.daytime: S 2196732969:2196732969(0) win 8760 (DF)

21:00:20.103798 prober.54968 > myhost.daytime: S 2196732969:2196732969(0) win 8760 (DF)

21:00:32.902480 prober.54968 > myhost.daytime: S 2196732969:2196732969(0) win 8760(DF)

21:00:58.500635 prober.54968 > myhost.daytime: S 2196732969:2196732969(0) win 8760(DF)

Weird Web Scans

This scan earns no speed records, but that is intentional. Is the attacker looking for web servers? We could hypothesize they are and UNIX-based web servers at that. Sending the

packet to the 0 host address is an old-style BSD broadcast; Windows systems will fail to answer. The scan proceeds at a slower rate so that all the inputs can be processed.

Note the source port remains the same for each subnet:

18:45:06.820 b.t.t.6879 > 172.20.1.0.http: S 1025092638:1025092638(0) win 61440

18:45:09.356 b.t.t.7136 > 172.20.2.0.http: S 1041868014:1041868014(0) win 61440

18:45:12.626 b.t.t.6879 > 172.20.1.0.http: S 1025092638:1025092638(0) win 61440

18:45:14.375 b.t.t.7395 > 172.20.3.0.http: S 1059077568:1059077568(0) win 61440

18:45:15.184 b.t.t.7136 > 172.20.2.0.http: S 1041868014:1041868014(0) win 61440

18:45:16.790 b.t.t.7650 > 255.255.255.255.http: S 1075727476:1075727476(0) win 61440

18:45:17.970 b.t.t.7905 > 172.20.5.0.http: S 1092175088:1092175088(0) win 61440

18:45:20.190 b.t.t.7395 > 172.20.3.0.http: S 1059077568:1059077568(0) win 61440

18:45:20.442 b.t.t.8160 > 172.20.6.0.http: S 1108940634:1108940634(0) win 61440

18:45:22.695 b.t.t.7650 > 255.255.255.255.http: S 1075727476:1075727476(0) win 61440

18:45:23.648 b.t.t.7905 > 172.20.5.0.http: S 1092175088:1092175088(0) win 61440

TCP Broadcast?

Well, the 0 host ID looks like old-style broadcasts, and smells like old-style broadcasts, but here is a comment from one of the book's reviewers:

"First, there is no such thing as broadcasting using TCP. See TCP/IP Illustrated, Volume I, p. 169: 'Broadcasting and multicasting only apply to UDP, where it makes sense for an application to send a single message to multiple recipients. TCP is a connection-oriented protocol that implies a connection between two hosts (specified by IP addresses) and one process on each host (specified by port numbers).'

"In fact, to be sure I tried this out against our test network, which contains about 25 hosts—all different OSs and hardware, old software and new software—against several different TCP ports, using both the .0 and the .255 broadcasts…and no hosts will answer this request. The .0 or .255 address is interpreted as a unicast address and no other hosts on the net will pick up the packet. This further makes sense when we think about how TCP identifies connections according to the tuple (src ip, dst ip, src port, dst port). In the case of a broadcast address, there is no way to include that address in the tuple. The attacker cannot obtain a broadcast-type response from these SYN packets because there is no way to negotiate a three-way handshake using a broadcast address."

However, routers do not work at the TCP layer, they work at the IP layer; so this packet is not actually looking for web servers, it is doing reconnaissance hoping for ICMP error messages such as unreachables.

The following excerpt is another web-based scan, from the access_log of a UNIX computer running the Apache web server code. This captured the contents of the traffic destined for the httpd port. By using both the network IDS and the host-based logs, we can fuse what is happening. Apache is the most popular web server software in use on the Internet. This trace is the result of a popular web server multi-CGI-BIN exploit; whisker or the nessus tools are

famous examples. These are commonly in use. We cannot seem to go a day without someone trying to run one of these against www.sans.org:

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