Intrusion Detection
CS 161 - Lecture 23
Computer Science 161
Announcements
2
Computer Science 161
Last Time: Denial of Service
3
Computer Science 161
Last Time: SYN Cookies
4
Computer Science 161
Last Time: Firewalls
5
Computer Science 161
Today: Intrusion Detection
6
Computer Science 161
Today: Intrusion Detection
7
Computer Science 161
Path Traversal Attacks
8
Computer Science 161
Top 25 Most Dangerous Software Weaknesses (2020)
9
Rank | ID | Name | Score |
[1] | Improper Neutralization of Input During Web Page Generation (’Cross-site Scripting’) | 46.82 | |
[2] | Out-of-bounds Write | 46.17 | |
[3] | Improper Input Validation | 33.47 | |
[4] | Out-of-bounds Read | 26.50 | |
[5] | Improper Restriction of Operations within the Bounds of a Memory Buffer | 23.73 | |
[6] | Improper Neutralization of Special Elements used in an SQL Command (’SQL Injection’) | 20.69 | |
[7] | Exposure of Sensitive Information to an Unauthorized Actor | 19.16 | |
[8] | Use After Free | 18.87 | |
[9] | Cross-Site Request Forgery (CSRF) | 17.29 | |
[10] | Improper Neutralization of Special Elements used in an OS Command (’OS Command Injection’) | 16.44 | |
[11] | Integer Overflow or Wraparound | 15.81 | |
[12] | Improper Limitation of a Pathname to a Restricted Directory (’Path Traversal’) | 13.67 | |
[13] | NULL Pointer Dereference | 8.35 | |
[14] | Improper Authentication | 8.17 | |
[15] | Unrestricted Upload of File with Dangerous Type | 7.38 | |
[16] | Incorrect Permission Assignment for Critical Resource | 6.95 | |
[17] | Improper Control of Generation of Code (’Code Injection’) | 6.53 |
Computer Science 161
Unix File Paths
10
Computer Science 161
Unix File Paths
/home/public/evanbot.jpg
11
home
public
private
evanbot.jpg
codabot.jpg
passwords.txt
Computer Science 161
Unix File Paths
./codabot.jpg (Assume we're currently in public)
12
home
public
private
evanbot.jpg
codabot.jpg
passwords.txt
Computer Science 161
Unix File Paths
/home/public/../private/passwords.txt
13
home
public
private
evanbot.jpg
codabot.jpg
passwords.txt
Computer Science 161
Path Traversal Intuition
14
Frontend
evanbot.jpg
Enter file name:
Backend
Send this file to the user:
/home/public/evanbot.jpg
home
private
evanbot.jpg
codabot.jpg
passwords.txt
public
Backend Filesystem
Computer Science 161
Path Traversal Intuition
15
Frontend
../private/passwords.txt
Enter file name:
Backend
Send this file to the user:
/home/public/../private/passwords.txt
home
public
private
evanbot.jpg
codabot.jpg
passwords.txt
Backend Filesystem
Computer Science 161
Path Traversal Attacks
16
Computer Science 161
Types of Detectors
17
Computer Science 161
Types of Detectors
18
Computer Science 161
Structure of a Network
19
Server
Employee Computer
Employee Computer
Border Router
End hosts in the local network send packets to the Internet by sending it to the border router for forwarding
Internet
Computer Science 161
Network Intrusion Detection System (NIDS)
20
Server
Employee Computer
Employee Computer
Border Router
NIDS: put the detector here
Internet
Computer Science 161
Network Intrusion Detection System (NIDS)
21
Computer Science 161
NIDS: Benefits
22
Computer Science 161
NIDS: Drawbacks
23
Computer Science 161
Drawback: Inconsistent Interpretation
24
NIDS
../etc/passwd
Computer Science 161
Drawback: Inconsistent Interpretation
25
NIDS
%2e%2e%2f%2e%2e%2f
Computer Science 161
Drawback: Inconsistent Interpretation
26
NIDS
..///.///..////
Computer Science 161
Evasion Attacks
27
Computer Science 161
Evasion Attacks: Defenses
28
Computer Science 161
Drawback: Encrypted Traffic
29
Computer Science 161
Recall: Structure of a Network
30
Server
Employee Computer
Employee Computer
Border Router
End hosts in the local network send packets to the Internet by sending it to the border router for forwarding
Internet
Computer Science 161
Host-Based Intrusion Detection System (HIDS)
31
Server
Employee Computer
Employee Computer
Border Router
HIDS: put detectors here
Internet
Computer Science 161
Host-Based Intrusion Detection System (HIDS)
32
Computer Science 161
Logging
33
Computer Science 161
Detection Accuracy
34
Computer Science 161
Detection Errors
35
Computer Science 161
Perfect Detectors
36
void detector_with_no_false_positives(char *input) {
printf("Nope, not an attack!");
}
void detector_with_no_false_negatives(char *input) {
printf("Yep, it's an attack!");
}
Computer Science 161
Detection Tradeoffs
37
Computer Science 161
Detection Tradeoffs
38
Computer Science 161
Detection Tradeoffs
39
Not false positives
False positives
5
95
The proportion of false positives stays the same, but when there are more requests, the absolute number of false positives increases
50
950
Computer Science 161
Base Rate Fallacy
40
Computer Science 161
Combining Detectors
41
Computer Science 161
Styles of Detection
42
Break: Back at 4:32 PM PT
Computer Science 161
Styles of Detection
43
Computer Science 161
Signature-based Detection
44
Computer Science 161
Signature-based Detection: Examples
45
Computer Science 161
Signature-based Detection: Tradeoffs
46
Computer Science 161
Specification-based Detection
47
Computer Science 161
Specification-based Detection: Examples
48
Computer Science 161
Specification-based Detection: Tradeoffs
49
Computer Science 161
Anomaly-based Detection
50
Computer Science 161
Anomaly-based Detection: Examples
51
Computer Science 161
Anomaly-based Detection: Tradeoffs
52
Computer Science 161
Behavioral Detection
53
Computer Science 161
Behavioral Detection: Examples
54
Computer Science 161
Behavioral Detection: Tradeoffs
55
Computer Science 161
Other Intrusion Detection Strategies
56
Computer Science 161
Vulnerability Scanning
57
Computer Science 161
Vulnerability Scanning: Tradeoffs
58
Computer Science 161
Honeypots
59
Computer Science 161
Honeypots: Examples
60
Computer Science 161
Honeypots: Tradeoffs
61
Computer Science 161
Forensics
62
Computer Science 161
Blocking: Intrusion Prevention Systems
63
Computer Science 161
Building the Perfect IPS?
Takeaway: You must always have tradeoffs between false positive and false negative rates
64
0% false negative rate
0% false positive rate
Computer Science 161
Attacks on Intrusion Detection Systems (IDS)
65
Computer Science 161
Inside A Modern IDS
66
Internet
Network
Packet Filter
NIDS unit
NIDS unit
NIDS unit
NIDS unit
Computer Science 161
Inside A Modern IDS
67
Computer Science 161
Path Traversal Attacks: Summary
68
Computer Science 161
Types of Detectors: Summary
69
Computer Science 161
Detection Accuracy: Summary
70
Computer Science 161
Styles of Detection: Summary
71
Computer Science 161
Other Intrusion Detection Strategies: Summary
72
Computer Science 161