Introduction to Computer Security
David Brumley dbrumley@cmu.edu
Carnegie Mellon University
Introduction to Computer Security David Brumley dbrumley@cmu.edu - - PowerPoint PPT Presentation
Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University Today: Overview Course Staff Trusting Trust Course Overview Example Applications Course Mechanics CMU CTF Team 2 You will find
Introduction to Computer Security
David Brumley dbrumley@cmu.edu
Carnegie Mellon University
2
3
4
University, 1998-2002
CMU, Jan 2009
– AEG and Mayhem
– BitShred
– Decompilation
5
Trusting
6
7
Photo from http://culturadigitalbau.wikispaces.com/ file/view/thompson.c1997.102634882.lg.jpg/212982274/thompson.c1997.102634882.lg.jpg
Ken Thompson Co-Creator of UNIX and C Turing Award: 1983
8
9
Compiler
011001001111010 FIX mak login.c
10
Compiler
011001001111010
... if(program == “login”) add-login-backdoor(); if(program == “compiler”) add-compiler-backdoor();
FIX mak login.c
Ken Thompson Co-Creator of UNIX and C Turing Award: 1983
11
12
13
14
Ron Rivest Adi Shamir Len Adleman
Picture from http://www.usc.edu/dept/molecular-science/RSA-2003.htm
We’re no better off guessing what an encrypted message contains given the ciphertext.
15
16
message decrypt(ciphertext c, private_key k){ plaintext m; if(k == 1) m = time t1 decryption ops; return m; if(k == 2) m = time t2 decryption ops; return m; if(k == 3) m = time t3 decryption ops; return m; .... }
17
Routers run an
which hackers now target
Even GPS systems run
18
19
20
Software Security Network Security OS Security Cryptography
21
Intro to Computer Security
Software Security
Control Flow Hijack Execution Safety Information Flow
Cryptography
Goals
Crypto Stream Ciphers Block Ciphers Asymmetric Crypto Authentication/Integrity
OS Security
Common Defenses Authorization Security Architectures
Network Security
Web Security Denial
Service Protocols Intrusion Detection
Your job: become conversant in these topics
22
23
shellcode (aka payload) padding &buf computation + control
Allow attacker ability to run arbitrary code
– Install malware – Steal secrets – Send spam
24
25
26
– Format string – Buffer overflow – Gist of other control flow hijacks, e.g., heap overflow
– ASLR – DEP – Canaries – Know the limitations!
27
28
Alice Bob
M
Public Channel Adversary Eve: A very clever person
Alice Bob
M
Public Channel Adversary Eve: A very clever person
Cryptography’s Goals:
– Data Privacy – Data Integrity – Data Authenticity
Alice Bob
M
Public Channel Adversary Eve: A very clever person
Cryptonium Pipe
Alice Bob
M
Public Channel Adversary Eve: A very clever person
Cryptonium Pipe
Cryptography’s Goals:
– Privacy – Integrity – Authenticity
34
ever invent your own algorithm
35
36
37
Principal Reference Monitor Object Requested Operation Approved Operation
Source Guard Resource
Authentication Authorization
In security, we isolate reasoning about the guard
38
OS Security
Authentication
Principles
Authorization
Reference monitors Access control lists
Auditing Security Architectures
Virtual Machines Software Fault Isolation
– Authorization – Authentication – Audit
39
40
41
Network Security
Web Security
XSS
Stored XSS Reflected XSS
SQL Injection
Defense Sanitization Stored procedures Attacks Basic syntax Comments Probes
CSRF
Attack Defense Referer Validation Custom Header Token validation
Intrusion Detection
Stateful Stateless Base Rate
Protocols
Kerberos BGP
Denial
Service
Bots CDN
42
Network Security
Web Security
XSS
Stored XSS Reflected XSS
SQL Injection
Defense Sanitization Stored procedures Attacks Basic syntax Comments Probes
CSRF
Attack Defense Referer Validation Custom Header Token validation
Intrusion Detection
Stateful Stateless Base Rate
Protocols
Kerberos BGP
Denial
Service
Bots CDN
43
Network Security
Web Security
XSS
Stored XSS Reflected XSS
SQL Injection
Defense Sanitization Stored procedures Attacks Basic syntax Comments Probes
CSRF
Attack Defense Referer Validation Custom Header Token validation
Intrusion Detection
Stateful Stateless Base Rate
Protocols
Kerberos BGP
Denial
Service
Bots CDN
application to IDS
attacks
mitigate their effect
44
45
– Basic UNIX development (gcc, gdb, etc.) – 15-213 or similar is recommended
– Read – Underline – Question – Review
http://www.ece.cmu.edu/~dbrumley/courses/18487-f13
46
47
best.
48
49
#1 Song: The Macarena Spice Girls Play Olympics Windows 95 Reigned
50
Ping of Death!
51
IP Packet Max IP packet size = 65535 octets (216 – 1) (RFC 791) 20 for typical header 8 for ICMP header 65507 for data (65535-20-8) To process ICMP, I need to handle up to 65507 octets
http://jobtrakr.com/2011/11/16/so-you-want-to-be-a-manager/52
IP Packet Max IP packet size = 65535 octets (216 – 1) (RFC 791) 20 for typical header 8 for ICMP header 65507 for data (65535-20-8) To process ICMP, I need to handle up to 65507 octets
http://jobtrakr.com/2011/11/16/so-you-want-to-be-a-manager/One 4000 byte packet with Maximum Transmission Unit (MTU) of 1500
53
... length 4000 ID x fragflag
... ... length 1500 ID x fragflag 1
... ... length 1040 ID x fragflag
370 ... ... length 1500 ID x fragflag 1
185 ... packet len < MTU 1480 octet data
Gets fragmented in 3 packets
54
Attacker Victim
into one big packet
exceeds buffer bounds, crashes
“A few ICMPv6 packets with router advertisements requests can cause a denial-of-service vulnerability reminiscent of the famous "Ping of Death". It’s a good illustration of how much we still do not know about the stability of IPv6. We continue to recommend turning off IPv6 on workstations if your network is not engineered for its use.”
55
“A few ICMPv6 packets with router advertisements requests can cause a denial-of-service vulnerability reminiscent of the famous "Ping of Death". It’s a good illustration of how much we still do not know about the stability of IPv6. We continue to recommend turning off IPv6 on workstations if your network is not engineered for its use.”
56
– 3 homeworks (35%) – Highest 2 out of 3 tests (30% each) – Participation and coolest bug (5%)
– 90-100%: A – 80-89%: B – 70-79%: C – 60-69%: D – < 59%: F
57
work, let others copy, etc.
58
My wife will have a baby boy sometime this
59
Image credits: http://onyx-ii.com/srcstore/scripts/store/item.cfm?Item_Number=BE-STXLW-CD
60
61
62
Red Team
Blue Team
63
64
65
Size of circle proportional to number of teams
66
67
68
– ROP attacks – Breaking incorrect use of modern crypto
“I learned more in one week than the last two years in CS courses.”
69
If you get an A, you may be eligible to help with PicoCTF 2014
70
72
Program High In Low In High Out Low Out
OK to mix NO mixing!
e.g., password e.g., dictionary
73
Information Flow
Data Dependence
Assignment
Control Dependence
if-then-else
Side Channel
Timing
property.
74
Trapped Errors
halts computation immediately ex:
an illegal address
Untrapped Errors
can go unnoticed until (possibly much) later ex:
an array of strings
75
76
Untrapped Errors
can go unnoticed until (possibly much) later ex:
integer
77
A safe language has no untrapped errors.
untyped typed statically checked dynamically checked
“typechecking”
safety and security.
– Give examples of vulnerabilities protected by CFI – Give examples of vulnerabilities not protected by CFI
78