Intrusion Detection
CS 161 Fall 2022 - Lecture 23
Computer Science 161
Last Time: Denial of Service
2
Computer Science 161
Last Time: SYN Cookies
3
Computer Science 161
Last Time: Firewalls
4
Computer Science 161
Today: Intrusion Detection
5
Computer Science 161
Today: Intrusion Detection
6
Computer Science 161
Path Traversal Attacks
7
Computer Science 161
Top 25 Most Dangerous Software Weaknesses (2020)
8
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
9
Computer Science 161
Unix File Paths
/home/public/evanbot.jpg
10
home
public
private
evanbot.jpg
codabot.jpg
passwords.txt
Computer Science 161
Unix File Paths
./codabot.jpg (Assume we're currently in public)
11
home
public
private
evanbot.jpg
codabot.jpg
passwords.txt
Computer Science 161
Unix File Paths
/home/public/../private/passwords.txt
12
home
public
private
evanbot.jpg
codabot.jpg
passwords.txt
Computer Science 161
Path Traversal Intuition
13
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
14
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
15
Computer Science 161
Types of Detectors
16
Computer Science 161
Types of Detectors
17
Computer Science 161
Structure of a Network
18
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)
19
Server
Employee Computer
Employee Computer
Border Router
NIDS: put the detector here
Internet
Computer Science 161
Network Intrusion Detection System (NIDS)
20
Computer Science 161
NIDS: Benefits
21
Computer Science 161
NIDS: Drawbacks
22
Computer Science 161
Drawback: Inconsistent Interpretation
23
NIDS
../etc/passwd
Computer Science 161
Drawback: Inconsistent Interpretation
24
NIDS
%2e%2e%2f%2e%2e%2f
Computer Science 161
Drawback: Inconsistent Interpretation
25
NIDS
..///.///..////
Computer Science 161
Evasion Attacks
26
Computer Science 161
Evasion Attacks: Defenses
27
Computer Science 161
Drawback: Encrypted Traffic
28
Computer Science 161
Recall: Structure of a Network
29
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)
30
Server
Employee Computer
Employee Computer
Border Router
HIDS: put detectors here
Internet
Computer Science 161
Host-Based Intrusion Detection System (HIDS)
31
Computer Science 161
Logging
32
Computer Science 161
Detection Accuracy
33
Computer Science 161
Detection Errors
34
Computer Science 161
Perfect Detectors
35
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
36
Computer Science 161
Detection Tradeoffs
37
Computer Science 161
Detection Tradeoffs
38
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
39
Computer Science 161
Combining Detectors
40
Computer Science 161
Styles of Detection
41
Computer Science 161
Styles of Detection
42
Computer Science 161
Signature-based Detection
43
Computer Science 161
Signature-based Detection: Examples
44
Computer Science 161
Signature-based Detection: Tradeoffs
45
Computer Science 161
Specification-based Detection
46
Computer Science 161
Specification-based Detection: Examples
47
Computer Science 161
Specification-based Detection: Tradeoffs
48
Computer Science 161
Anomaly-based Detection
49
Computer Science 161
Anomaly-based Detection: Examples
50
Computer Science 161
Anomaly-based Detection: Tradeoffs
51
Computer Science 161
Behavioral Detection
52
Computer Science 161
Behavioral Detection: Examples
53
Computer Science 161
Behavioral Detection: Tradeoffs
54
Computer Science 161
Other Intrusion Detection Strategies
55
Computer Science 161
Vulnerability Scanning
56
Computer Science 161
Vulnerability Scanning: Tradeoffs
57
Computer Science 161
Honeypots
58
Computer Science 161
Honeypots: Examples
59
Computer Science 161
Honeypots: Tradeoffs
60
Computer Science 161
Forensics
61
Computer Science 161
Blocking: Intrusion Prevention Systems
62
Computer Science 161
Building the Perfect IPS?
Takeaway: You must always have tradeoffs between false positive and false negative rates
63
0% false negative rate
0% false positive rate
Computer Science 161
Attacks on Intrusion Detection Systems (IDS)
64
Computer Science 161
Inside A Modern IDS
65
Internet
Network
Packet Filter
NIDS unit
NIDS unit
NIDS unit
NIDS unit
Computer Science 161
Inside A Modern IDS
66
Computer Science 161
Path Traversal Attacks: Summary
67
Computer Science 161
Types of Detectors: Summary
68
Computer Science 161
Detection Accuracy: Summary
69
Computer Science 161
Styles of Detection: Summary
70
Computer Science 161
Other Intrusion Detection Strategies: Summary
71
Computer Science 161