Introduction to Computer Security David Brumley [email protected] Carnegie Mellon University.

63
Introduction to Computer Security David Brumley [email protected] Carnegie Mellon University

Transcript of Introduction to Computer Security David Brumley [email protected] Carnegie Mellon University.

Page 1: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Introduction to Computer Security

David [email protected] Mellon University

Page 2: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

2

Today: Overview

• Course Staff• Trusting Trust• Course Overview• Example Applications• Course Mechanics• CMU CTF Team

Page 3: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

3

You will findat least one error

on each set of slides. :)

Page 4: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

4

David Brumley• B.A. Math UNC 1998• M.S. CS Stanford 2003• Ph.D. CS CMU 2008

• Computer security officer, Stanford University, 1998-2002

• Assistant Professor, CMU, Jan 2009

Page 5: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

5

Current Research Thrusts

• Automatic Exploit Generation– AEG and Mayhem

• Binary code analysis– Decompilation

• Vetting whole systems

Page 6: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

6

Teaching Assistants

1. Zack Weinberg

2. Peter Chapman

Page 7: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

7

TrustTrusting

Page 8: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

8

Do you trust hisSoftware?

Photo from http://culturadigitalbau.wikispaces.com/file/view/thompson.c1997.102634882.lg.jpg/212982274/thompson.c1997.102634882.lg.jpg

Page 9: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

9

Ken ThompsonCo-Creator of

UNIX and CTuring Award: 1983

Page 10: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

10

Compiler

011001001111010

Page 11: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

11

Compiler

011001001111010

...if(program == “login”) add-login-backdoor();if(program == “compiler”) add-compiler-backdoor();

Page 12: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

12

Ken ThompsonCo-Creator of

UNIX and CTuring Award: 1983

Hacker

Page 13: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

13

Would you trust Mother Teresa’s software?

Page 14: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

14

Sanitize the environment when invoking external programs

Do not call system() if you do not need a command processor

Exclude user input from format strings

Use the readlink() function properlyDo not subtract or compare pointers that do not refer to the same array

Mask signals handled by noninterruptible signal handlers

Ensure that unsigned integer operations do not wrap

Guarantee that array and vector indices are within bounds

Would you trust Mother Teresa’s software?

Page 15: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

15

Surely cryptographers code must be secure?

Ron RivestAdi Shamir Len Adleman

Picture from http://www.usc.edu/dept/molecular-science/RSA-2003.htm

Page 16: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

16

Perfect Cryptography Exists!We’re no better off guessing what an encrypted message contains given the ciphertext. - Claude Shannon

Page 17: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

17

But implementations may still leak...

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; .... }

Page 18: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

18

Isn’t this networking?

Routers run an operating system, which hackers now

target

Page 19: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Even GPS runs:• Webservers• FTP servers• Network time daemons

19

Page 20: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

20

Security is many things

Page 21: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

This Class: Introduction to the Four Research Cornerstones of Security

21

Software Security Network Security

OS Security Cryptography

Page 22: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

22

Course Topics

Your job: become conversant in these topics

Page 23: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Software Security

23

Page 24: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Control Flow Hijacks

24

shellcode (aka payload) padding &buf

computation + control

Allow attacker ability to run arbitrary code– Install malware– Steal secrets– Send spam

Page 25: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

25

Page 26: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

26

Page 27: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

27

Page 28: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Software Security• Recognize and exploit vulnerabilities– Format string– Buffer overflow– Gist of other control flow hijacks, e.g., heap overflow

• Understand defenses in theory and practice– ASLR– DEP– Canaries– Know the limitations!

28

Page 29: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Cryptography

29

Page 30: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Everyday Cryptography

• ATM’s• On-line banking• SSH• Kerberos

Page 31: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Alice Bob

MPublic Channel

Adversary Eve: A very clever person

Page 32: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Alice Bob

MPublic Channel

Adversary Eve: A very clever person

Cryptography’s Goals:– Data Privacy– Data Integrity– Data Authenticity

Page 33: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Alice Bob

MPublic Channel

Adversary Eve: A very clever personCryptonium

Pipe

Page 34: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Alice Bob

MPublic Channel

Adversary Eve: A very clever personCryptonium

Pipe

Cryptography’s Goals:– Privacy– Integrity– Authenticity

Page 35: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

35

Page 36: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Goals• Understand and believe you should never, ever invent your own

algorithm

• Goals– Encryption– Integrity– Authentication

• Concepts– Symmetric key crypto– Hashes– Macs– Signatures

• Example pitfalls

36

Page 37: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

OS/Systems Security

37

Page 38: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

38

PrincipalReferenceMonitor

Object

RequestedOperation

ApprovedOperation

Source Guard Resource

Authentication Authorization

In security, we isolate reasoning about the guard

Page 39: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

39

Page 40: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

OS Goals

• Know Lampson’s “gold” standard– Authorization– Authentication– Audit

• Know currently used security architectures

40

Page 41: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Network Security

41

Page 42: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

42

Page 43: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

43

Page 44: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

44

Page 45: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Networking Goals

• Understand the base rate fallacy and it’s application to IDS

• Be able to recognize and perform basic web attacks

• State what a DDoS is, and how CDN’s mitigate their effect

45

Page 46: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Course Mechanics

46

Page 47: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Basics• Pre-req: – Basic UNIX development (gcc, gdb, etc.)– 15-213 or similar is recommended

• Read all papers before lecture– Read– Underline– Question– Review

• Course website: http://www.ece.cmu.edu/~dbrumley/courses/18487-f14/www

47

Page 48: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Workload

• 3 homework assignments

• 3 exams, keep highest 2 grades

• CTF

48

Page 49: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

CTF Component: Learn Outside the Course

• Solve 10 CTF problems– Not picoctf.com

• Videotape the solutions, put on a private youtube.– Make videos private for now

• See livectf.com for fun

49

Page 50: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Basic Mechanics• Grading based on:– 3 homeworks (35%)– Highest 2 out of 3 tests (30% each)– Participation and CTF (5%)

• No late days except under exceptional circumstances.

• I guarantee at least the following:– 90-100%: A– 80-89%: B– 70-79%: C– 60-69%: D– < 59%: F

50

Page 51: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

ETHICS

!• Obey the law• Do not be a nuisance• Don’t cheat, copy others

work, let others copy, etc.

51

Page 52: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Capture the Flag

52

Page 53: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

53

CMU Capture the Flag Team

Page 54: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

54

Red Team

• Vulnerability Discovery• Exploitation• Network mapping• Web security

Blue Team

• Intrusion detection• Hot-patching• Firewalls• Work-arounds

Page 55: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

55

Page 56: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

56

Page 57: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

10,000 Students in 2,000 teams

57Size of circle proportional to number of teams

Page 58: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

58

Page 59: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

59

Page 60: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

Example Network Forensics

60

Page 61: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

PicoCTF

• 10,000 students

• 600 teams solving advanced problems– ROP attacks– Breaking incorrect use of modern crypto

• Identified the best of the best“I learned more in one week than the last two years in CS courses.”

61

If you get an A, you may be eligible to help with PicoCTF 2014

Page 62: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

62

Questions?

Page 63: Introduction to Computer Security David Brumley dbrumley@cmu.edu Carnegie Mellon University.

END