1 / 68

Operating Systems

Operating Systems. 软件学院 高海昌 hchgao@xidian.edu.cn. Contents. 1. Introduction ** 2. Processes and Threads ***** ** 3. Deadlocks ** 4. Memory Management ***** 5. Input/Output *** 6. File Systems **** 8. Multiple Processor Systems * 9. Security **. 2. Chapter 9: Security.

dwilkerson
Télécharger la présentation

Operating Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating Systems 软件学院 高海昌 hchgao@xidian.edu.cn

  2. Contents 1. Introduction ** 2. Processes and Threads ******* 3. Deadlocks ** 4. Memory Management ***** 5. Input/Output *** 6. File Systems **** 8. Multiple Processor Systems * 9. Security ** • 2

  3. Chapter 9: Security 9.1 The security environment 9.2 Basics of cryptography 9.3 User authentication 9.4 Attacks from inside the system 9.5 Attacks from outside the system 9.6 Protection mechanisms 9.7 Trusted systems • 3

  4. Threats Security goals and threats 机密性 篡改

  5. Intruders Common Categories • Casual prying (窥探) by nontechnical users • Snooping by insiders • Determined attempt to make money • Commercial or military espionage

  6. Accidental Data Loss Common Causes • Acts of God • fires, floods, wars • Hardware or software errors • CPU malfunction, bad disk, program bugs • Human errors • data entry, wrong tape mounted

  7. Chapter 9: Security 9.1 The security environment 9.2 Basics of cryptography 9.3 User authentication 9.4 Attacks from inside the system 9.5 Attacks from outside the system 9.6 Protection mechanisms 9.7 Trusted systems • 7

  8. Basics of Cryptography Relationship between the plaintext and the ciphertext

  9. Secret-Key Cryptography • Monoalphabetic substitution 单字符替换 • each letter replaced by different letter • Given the encryption key, easy to find decryption key • Secret-key crypto called symmetric-key crypto A B C D E F G…… Q W E R T Y U…… ATTACK QZZQEA

  10. Public-Key Cryptography • All users pick a public key/private key pair • publish the public key • private key not published • Public key is the encryption key, private key is the decryption key • RSA, slow than symmetric cryptography Q1: How much is 314159265358979 x 314159265358979 ? Q2: What is the square root of 3912571506419387090594828508241?

  11. One-Way Functions • Function such that given formula for f(x) • easy to evaluate y = f(x) • But given y, • computationally infeasible to find x

  12. Digital Signatures • (a) Computing a signature block • (b) What the receiver gets • MD5 16-byte, SHA 20-byte • E(D(x))=x (b)

  13. Chapter 9: Security 9.1 The security environment 9.2 Basics of cryptography 9.3 User authentication 9.4 Attacks from inside the system 9.5 Attacks from outside the system 9.6 Protection mechanisms 9.7 Trusted systems • 13

  14. User Authentication Basic Principles. Authentication must identify: • Something the user knows • Something the user has • Something the user is This is done before user can use the system

  15. Authentication Using Passwords (a) A successful login (b) Login rejected after name entered (c) Login rejected after name and password typed

  16. How crackers break in • How a cracker broke into LBL • a U.S. Dept. of Energy research lab • Ping / telnet / dnsquery / passwd / packet sniffer

  17. Salt Password UNIX password security UNIX: the user password is “encrypted” by using it as a key to encrypt a fixed block of data. The use of salt to defeat precomputation of encrypted passwords

  18. One-Time passwords • One way function y=f(x) • given x it is easy to find y, but given y it is computational infeasible to find x. • The input and output should be the same length, i.e. 128 bits • pi-1 = f(pi) p0 = f(p1), p1 = f(p2), p2 = f(p3), p3 = f(p4) p1 = f(f(f(f(s)))), p2 = f(f(f(s))), p3 = f(f(s)) , p4 = f(s) • Challenge-Response authentication • client get r, send f(r,k)

  19. Authentication Using a Physical Object • Magnetic cards • magnetic stripe cards • chip cards: stored value cards, smart cards

  20. Authentication Using Biometrics A device for measuring finger length.

  21. Countermeasures 对策 • Limiting times when someone can log in • Automatic callback at number prespecified • Limited number of login tries • A database of all logins • Simple login name/password as a trap • security personnel notified when attacker bites

  22. Chapter 9: Security 9.1 The security environment 9.2 Basics of cryptography 9.3 User authentication 9.4 Attacks from inside the system 9.5 Attacks from outside the system 9.6 Protection mechanisms 9.7 Trusted systems • 22

  23. Trojan Horses • Free program made available to unsuspecting user • Actually contains code to do harm • Place altered version of utility program on victim's computer • trick user into running that program

  24. Login Spoofing (a) Correct login screen (b) Phony login screen

  25. Logic Bombs • Company programmer writes program • potential to do harm • OK as long as he/she enters password daily • if programmer fired, no password and bomb explodes

  26. Trap Doors (a) Normal code. (b) Code with a trapdoor inserted

  27. Buffer Overflow • (a) Situation when main program is running • (b) After program A called • (c) Buffer overflow shown in gray

  28. Generic Security Attacks Typical attacks • Request memory, disk space, tapes and just read • Try illegal system calls • Start a login and hit DEL, RUBOUT, or BREAK • Try modifying complex OS structures • Try to do specified DO NOTs • Convince a system programmer to add a trap door • Beg admin's sec’y to help a poor user who forgot password

  29. Famous Security Flaws The TENEX – password problem (a) (b) (c)

  30. Design Principles for Security • System design should be public • Default should be no access • Check for current authority • Give each process least privilege possible • Protection mechanism should be • simple • uniform • in lowest layers of system • Scheme should be psychologically acceptable And … keep it simple

  31. Operating Systems Lesson 2

  32. Chapter 9: Security 9.1 The security environment 9.2 Basics of cryptography 9.3 User authentication 9.4 Attacks from inside the system 9.5 Attacks from outside the system 9.6 Protection mechanisms 9.7 Trusted systems • 32

  33. Network Security • External threat • code transmitted to target machine • code executed there, doing damage • Goals of virus writer • quickly spreading virus • difficult to detect • hard to get rid of • Virus = program can reproduce itself • attach its code to another program • additionally, do harm

  34. Virus Damage Scenarios • Blackmail • Denial of service as long as virus runs • Permanently damage hardware • Target a competitor's computer • do harm • espionage 间谍活动 • Intra-corporate dirty tricks • sabotage (阴谋破坏)another corporate officer's files

  35. How Viruses Work • Virus written in assembly language • Inserted into another program • use tool called a “dropper” • Virus dormant (潜伏) until program executed • then infects other programs • eventually executes its “payload”

  36. How Viruses Work (1) Several kinds of Viruses based on what is infected companion executable program memory boot sector device driver macro source code viruses • 36

  37. How Viruses Work (2) Virus could infect them all Recursive procedure that finds executable files on a UNIX system

  38. How Viruses Work (3) • An executable program • With a virus at the front • With the virus at the end • With a virus spread over free space within program Parasitic virus 寄生病毒

  39. How Viruses Work (5) • After virus has captured interrupt, trap vectors • After OS has retaken printer interrupt vector • After virus has noticed loss of printer interrupt vector and recaptured it

  40. How Viruses Spread • Virus placed where likely to be copied • When copied • infects programs on hard drive, floppy • may try to spread over LAN • Attach to innocent (无辜) looking email • when it runs, use mailing list to replicate

  41. Antivirus and Anti-Antivirus Techniques (a) A program (b) Infected program (c) Compressed infected program (d) Encrypted virus (disguise) (e) Compressed virus with encrypted compression code

  42. Antivirus and Anti-Antivirus Techniques Examples of a polymorphic virus 多形态病毒 All of these examples do the same thing

  43. Antivirus and Anti-Antivirus Techniques • Integrity checkers • Behavioral checkers • Virus avoidance • good OS • install only shrink-wrapped software • use antivirus software • do not click on attachments to email • frequent backups • Recovery from virus attack • halt computer, reboot from safe disk, run antivirus

  44. The Internet Worm (Morris) • Consisted of two programs • bootstrap to upload worm • the worm itself • Worm first hid its existence • Next replicated itself on new machines

  45. Mobile Code (1) Sandboxing (a) Memory divided into 1-MB sandboxes (b) One way of checking an instruction for validity

  46. Mobile Code (2) Applets can be interpreted (解释)by a Web browser

  47. Mobile Code (3) How code signing works

  48. Java Security • A type safe language • compiler rejects attempts to misuse variable • Checks include … • Attempts to forge 伪造 pointers • Violation of access restrictions on private class members • Misuse of variables by type • Generation of stack over/underflows • Illegal conversion of variables to another type

  49. Chapter 9: Security 9.1 The security environment 9.2 Basics of cryptography 9.3 User authentication 9.4 Attacks from inside the system 9.5 Attacks from outside the system 9.6 Protection mechanisms 9.7 Trusted systems • 49

  50. Protection Domains (1) Examples of three protection domains

More Related