Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. ·...

42
Practical Issues with Intrusion Detection Practical Issues with Intrusion Detection Intrusion Detection — How? Sensors Simple Logging Log Files Finding Compromised Hosts 1 / 42

Transcript of Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. ·...

Page 1: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Practical Issues with Intrusion

Detection

Practical Issues withIntrusion DetectionIntrusion Detection— How?

Sensors

Simple Logging

Log Files

FindingCompromised Hosts

1 / 42

Page 2: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Intrusion Detection — How?

Practical Issues withIntrusion DetectionIntrusion Detection— How?

Sensors

Simple Logging

Log Files

FindingCompromised Hosts

2 / 42

■ Where do sensors go?■ How do you put them there?■ Sensor issues■ Other techniques■ Ethical and legal issues

Page 3: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Sensors

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

3 / 42

Page 4: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Locations

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

4 / 42

■ Outside the firewall?■ We know there are bad guys there; what’s the

point?■ Just inside? What’s the threat model?■ On sensitive internal nets?■ In front of each sensitive host?■ In “dark space”?

Page 5: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

What’s Dark Space?

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

5 / 42

■ A block of address space not used by realmachines and not pointed to by DNS entries

■ There is no legitimate reason to send packetsto such addresses

■ Therefore, any host sending to such addressesis up to no good

■ Commonly used to detect scanning worms

Page 6: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

What’s the Purpose?

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

6 / 42

■ Unless you’re a researcher, you care about realthreats to your own machines

■ Inside the firewall? Detect data exfiltration■ Sensitive internal nets: detect threats aimed at

them■ Watching each host? Detect attacks on inside

hosts from other hosts on the same LAN■ Dark space? Detect scanning worms (and

attackers)

Page 7: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Auto-Quarantine

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

7 / 42

■ Many organizations implement“auto-quarantine”

■ This is especially common for universityresidence hall networks

■ Machines that do too much scanning (and inparticular attempt to probe dark space) areassumed to be virus-infected

■ They’re moved to a separate net; the only sitesthey can contact are Windows Update,anti-virus companies, and the like

Page 8: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Honeypots and Honeynets

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

8 / 42

■ Special-purpose host or network designed to beattacked

■ Equipped with copious monitoring■ Lure the attacker in deeper■ Waste the attacker’s time; study the attacker’s

technique■ Note well: keeping honeypot (and dark space)

addresses secret is vital

Page 9: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Host- or Net-Resident?

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

9 / 42

■ Suppose you want to monitor each host.Where does the monitor live?

■ Dedicated in-line hardware: good, butexpensive

■ On the host: cheap, but subvertible

Page 10: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Net-Resident: Parallel

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

10 / 42

Network

NetworkHost

IDS

■ Very unobtrusive■ But — need special hardware to tap an

Ethernet■ Need some network connection to the IDS

Page 11: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Tapping an Ethernet

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

11 / 42

■ Cannot simply wire IDS to jack■ Best solution: one-way tap gear■ Note: unidirectional only; may need a pair of

them■ Some switches have a monitoring port (AKA

spanning port, mirroring port, etc) — canreceive copies of data from any other port

■ For 10BaseT nets, use a hub instead of aswitch

Page 12: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Net-Resident: Serial

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

12 / 42

IDS NetworkHost

■ Can’t miss packets■ But — if it crashes, the host is unreachable■ More detectable, via timing■ Can the IDS box be hacked?

Page 13: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Host-Resident Monitor

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

13 / 42

NetworkHost IDS

■ No special hardware needed■ IDS sees exactly what host sees■ But — subvertible■ Useful precaution: immediately transmit IDS

data elsewhere

Page 14: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

TCP Normalization

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

14 / 42

■ Attackers can play games with TCP/IP toconfuse network-resident IDS

■ Example: overlapping fragments:

s u n o r m

r o o t

Which fragment is honored?■ TTL games: give some packets a TTL just

high enough to reach the IDS, but not highenough to reach the destination host

■ Solution: TCP normalizer, to fix these

Page 15: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

The Big Advantages of Host IDS

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

15 / 42

■ More time■ More context■ Everything is reassembled■ Look at entire item, not streams■ Example: it’s all but impossible to do email

virus scanning in the network

Page 16: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Extrusion Detection

Practical Issues withIntrusion Detection

Sensors

Locations

What’s Dark Space?

What’s the Purpose?

Auto-Quarantine

Honeypots andHoneynets

Host- orNet-Resident?Net-Resident:Parallel

Tapping an Ethernet

Net-Resident: SerialHost-ResidentMonitor

TCP NormalizationThe Big Advantagesof Host IDS

Extrusion Detection

Simple Logging

Log Files

FindingCompromised Hosts

16 / 42

■ Detect bad things leaving your network■ Detect sensitive things leaving your network■ Finds theft of inside information, either by

attacker or by rogue insider■ Can be done in the network or in application

gateways

Page 17: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Simple Logging

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Simple Logging

Some ResultsThe Most ProbedPortsWhat Did TheProbers Want?

Broader Data

Bad Neighborhoods

Log Files

FindingCompromised Hosts

17 / 42

Page 18: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Simple Logging

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Simple Logging

Some ResultsThe Most ProbedPortsWhat Did TheProbers Want?

Broader Data

Bad Neighborhoods

Log Files

FindingCompromised Hosts

18 / 42

■ I ran this command for a while, on two hosts:

tcpdump -p -l "tcp[13] == 0x2 and dst $us"

■ What does it do?■ Logs all TCP SYN-only packets addressed to

us (tcp[13] is the flags byte in the TCPheader; 0x2 is SYN)

Page 19: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Some Results

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Simple Logging

Some ResultsThe Most ProbedPortsWhat Did TheProbers Want?

Broader Data

Bad Neighborhoods

Log Files

FindingCompromised Hosts

19 / 42

■ About 85 probes apiece, during a 30-hour run■ 63 different ports scanned■ Some obvious: http, ssh, Windows file-sharing,

SMTP, web proxy■ Some strange: 49400–49402, 8081–8090,

81–86■ Some ominous: terabase, radmin-port■ Most probers looked at one port; one looked

at 46 ports

Page 20: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

The Most Probed Ports

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Simple Logging

Some ResultsThe Most ProbedPortsWhat Did TheProbers Want?

Broader Data

Bad Neighborhoods

Log Files

FindingCompromised Hosts

20 / 42

Scans Port

3 ms-wbt-server3 ssh5 80005 http-alt6 ms-sql-s6 radmin-port7 BackupExec8 smtp9 WebProxy9 http

Page 21: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

What Did The Probers Want?

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Simple Logging

Some ResultsThe Most ProbedPortsWhat Did TheProbers Want?

Broader Data

Bad Neighborhoods

Log Files

FindingCompromised Hosts

21 / 42

■ WebProxy and SMTP are probably for spamemail and connection-laundering

■ The others look like probes for knownvulnerabilities

■ http could have been a “spider” or it could belooking for known holes

Page 22: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Broader Data

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Simple Logging

Some ResultsThe Most ProbedPortsWhat Did TheProbers Want?

Broader Data

Bad Neighborhoods

Log Files

FindingCompromised Hosts

22 / 42

■ Useful source:http://www.dshield

.org

■ Its current Top 10list shown at right

■ Clearly, the probersare interested inpeer-to-peerservers. . .

■ Some ports aremysterious

Name Port

— 15281win-rpc 1026eDonkey2000 4662eMule 4672icq 1027bittorrent 6881— 1028gnutella-svc 6346smtp 25microsoft-ds 445

Page 23: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Bad Neighborhoods

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Simple Logging

Some ResultsThe Most ProbedPortsWhat Did TheProbers Want?

Broader Data

Bad Neighborhoods

Log Files

FindingCompromised Hosts

23 / 42

■ I see more probes here than elsewhere. Why?■ There are different “neighborhoods” — ranges

of IP addresses — in cyberspace■ University networks are good hunting — few

firewalls, good bandwidth, manypoorly-administered machines

■ Newly-allocated network blocks have fewhosts, and aren’t scanned as much

Page 24: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Log Files

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

24 / 42

Page 25: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Shadow Hawk

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

25 / 42

Shadow Hawk Busted Again

As many of you know, Shadow Hawk (a/k/aShadow Hawk 1) had his home searched by agentsof the FBI. . .

When he was tagged by the feds, he had beendownloading software (in the form of C sources)from various AT&T systems. According toreports, these included the Bell Labs installationsat Naperville, Illinois and Murray Hill, New Jersey.

—Phrack Issue 16, File 11, November 1987

Page 26: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

How was Shadow Hawk Detected?

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

26 / 42

■ He had broken into some Bell Labs machines■ He tried to use uucp — a dial-up file

transfer/email system that came with Unix —to grab /etc/passwd files from othermachines

■ Uucp logged all file transfer requests■ Several people at Murray Hill had automated

jobs that scanned the log files for anythingsuspicious

Page 27: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Stalking the Wily Hacker

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

27 / 42

■ An accounting file didn’t balance — ausername had been added without the properbookkeeping entries

■ Cliff Stoll noticed and tried to figure out whatwas going on

■ Ultimately, it led to a KGB-controlledoperation aimed at military secrets. . .

Page 28: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

What was the Common Thread?

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

28 / 42

■ Log files of various sorts■ “Extraneous” information■ Log files can prevent problems, help you figure

out how the system was penetrated, what wasaffected, and — if you’re lucky and persistent— who did it

Page 29: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Where Do Log Files Come From?

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

29 / 42

■ Many different system components canproduce logs

■ Often, these aren’t enabled by default■ Should they be?

Page 30: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Detecting Problems Via Logfiles

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

30 / 42

The ”Code Red” worm activity can be identifiedon a machine by the presence of the followingstring in a web server log files:

/default.ida?NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

NNNNNNNNNNNNNNNNNNNNNNNNNNN%u9090%u6858%ucbd3%u7801%

u7801%u9090%u6858%ucbd3%u7801%u9090%u9090%u8190%u00c3%u0003%u8b00%u531

b%u53ff%u0078%u0000%u00=a

Fromhttp://www.cert.org/advisories/CA-2001-19.html

Page 31: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

An Attempted Intrusion?

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

31 / 42

[Sun Nov 20 23:17:18 2005] [error] [client www.xxx.yyy.zzz]

File does not exist: /usr/pkg/share/httpd/htdocs/xmlrpc

[Sun Nov 20 23:17:28 2005] [error] [client www.xxx.yyy.zzz]

File does not exist: /usr/pkg/share/httpd/htdocs/phpgroupware

(There were many more attempts from that IPaddress.) Both of these represent services withknown security holes

Page 32: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Problems with Log Files

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

32 / 42

■ How did I spot those probes?■ Manual search through error log■ Not very scalable. . .

Page 33: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Log File Scanners

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

33 / 42

■ Need to automate scans■ Pick out “interesting” events■ Hmm — what’s interesting?

Page 34: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Log Files and Intrusion Detection

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

34 / 42

■ Analyzing log files like that is a form ofintrusion detection

■ Can look for specific signatures, such asexamples above

■ Or — can look for anomalous patterns, suchas too many misses or too-long URLs

Page 35: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Correlating Log Files

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

35 / 42

■ Sometimes, the interesting information isspread among several log files

■ Need accurate timestamps for correlationbetween machines

■ Timestamps should generally be in UTC,rather than the local timezone

Page 36: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Types of Correlation

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

Shadow HawkHow was ShadowHawk Detected?Stalking the WilyHackerWhat was theCommon Thread?Where Do Log FilesCome From?Detecting ProblemsVia Logfiles

An AttemptedIntrusion?Problems with LogFiles

Log File Scanners

Log Files andIntrusion Detection

Correlating Log Files

Types of Correlation

FindingCompromised Hosts

36 / 42

■ Intra-machine — different forms of logfile■ Intra-site■ Inter-site■ Watch out for privacy issues!

Page 37: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Finding Compromised Hosts

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

FindingCompromised Hosts

FindingCompromised Hosts

Databases

Layer 2 Data

Switch DataLocating an EvilWiFi Laptop

37 / 42

Page 38: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Finding Compromised Hosts

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

FindingCompromised Hosts

FindingCompromised Hosts

Databases

Layer 2 Data

Switch DataLocating an EvilWiFi Laptop

38 / 42

■ Suppose you’ve identified a compromised host.Now what?

■ Get data: IP address and (when feasible) MACaddress

■ Find it

Page 39: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Databases

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

FindingCompromised Hosts

FindingCompromised Hosts

Databases

Layer 2 Data

Switch DataLocating an EvilWiFi Laptop

39 / 42

■ Must be able to map IP address to location■ Must be able to map IP address to person■ Difficult on this campus — wide-open nets■ Primary reason for host registration in many

places

Page 40: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Layer 2 Data

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

FindingCompromised Hosts

FindingCompromised Hosts

Databases

Layer 2 Data

Switch DataLocating an EvilWiFi Laptop

40 / 42

■ Enterprise-grade switches are “managed”■ They can map an IP address or a MAC address

to a physical port■ Especially useful if the attacker is forging

addresses. . .

Page 41: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Switch Data

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

FindingCompromised Hosts

FindingCompromised Hosts

Databases

Layer 2 Data

Switch DataLocating an EvilWiFi Laptop

41 / 42

Note that a single MAC address has shown up ontwo different switch ports, in different buildings.This is reasonable for a laptop, but not for aserver!

Page 42: Practical Issues with Intrusion Detectionsmb%c2%a0%c2%a0%c2%a0%c2%a0... · 2006. 11. 14. · Extrusion Detection Simple Logging Log Files Finding Compromised Hosts 3 / 42. Locations

Locating an Evil WiFi Laptop

Practical Issues withIntrusion Detection

Sensors

Simple Logging

Log Files

FindingCompromised Hosts

FindingCompromised Hosts

Databases

Layer 2 Data

Switch DataLocating an EvilWiFi Laptop

42 / 42

■ Ask the switch what access point it’s near■ Ping-flood the machine■ Wander around the room looking at the

lights. . .