OS Security. Authentication. Radboud University Nijmegen, The Netherlands. Winter 2014/2015

Similar documents
OS Security. Authentication. Radboud University Nijmegen, The Netherlands. Winter 2014/2015

User Authentication. Modified By: Dr. Ramzi Saifan

PASSWORDS & ENCRYPTION

User Authentication. Modified By: Dr. Ramzi Saifan

What is Authentication? All requests for resources have to be monitored. Every request must be authenticated and authorized to use the resource.

Hands-On Network Security: Practical Tools & Methods. Hands-On Network Security. Roadmap. Security Training Course

Hands-On Network Security: Practical Tools & Methods

Computer Security: Principles and Practice

Lecture 3 - Passwords and Authentication

Fundamentals of Linux Platform Security

Lecture 3 - Passwords and Authentication

Network Security Fundamentals

AIT 682: Network and Systems Security

Authentication. Identification. AIT 682: Network and Systems Security

User Authentication Protocols Week 7

CSC 474 Network Security. Authentication. Identification

Proving who you are. Passwords and TLS

CS530 Authentication

Windows authentication methods and pitfalls

Authentication Objectives People Authentication I

O/S & Access Control. Aggelos Kiayias - Justin Neumann

Information Security CS 526

Chapter 3: User Authentication

Information System Audit Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000)

Lecture 14 Passwords and Authentication

CNT4406/5412 Network Security

CNIT 125: Information Security Professional (CISSP Preparation) Ch 6. Identity and Access Management

User Authentication Protocols

Information Security CS 526

Introduction to Information Security Prof. V. Kamakoti Department of Computer Science and Engineering Indian Institute of Technology, Madras

Authentication. Chapter 2

CIS 6930/4930 Computer and Network Security. Topic 6. Authentication

10/1/2015. Authentication. Outline. Authentication. Authentication Mechanisms. Authentication Mechanisms. Authentication Mechanisms

Passwords CSC 193 WAKE FOREST. U N I V E R S I T Y Department of Computer Science. Spring 2014

McAfee Certified Assessment Specialist Network

Password cracking. IN Ethical Hacking. Bruvoll & Sørby. Department of Informatics 1 / 46

Radius, LDAP, Radius, Kerberos used in Authenticating Users

Lecture 9 User Authentication

HOST Authentication Overview ECE 525

PRACTICAL PASSWORD AUTHENTICATION ACCORDING TO NIST DRAFT B

CIT 380: Securing Computer Systems

Authentication System

MODULE NO.28: Password Cracking

Sumy State University Department of Computer Science

Authentication. Steven M. Bellovin January 31,

Exam4Free. Free valid exam questions and answers for certification exam prep

Information Security & Privacy

Computer Security 3e. Dieter Gollmann. Security.di.unimi.it/1516/ Chapter 4: 1

0/41. Alice Who? Authentication Protocols. Andreas Zeller/Stephan Neuhaus. Lehrstuhl Softwaretechnik Universität des Saarlandes, Saarbrücken

CIT 470: Advanced Network and System Administration. Topics. Namespaces. Accounts and Namespaces. 1. Namespaces 2. Policies

Authentication. Tadayoshi Kohno

CIS 4360 Introduction to Computer Security Fall WITH ANSWERS in bold. First Midterm

Passwords. EJ Jung. slide 1

Attacking Your Two-Factor Authentication (PS: Use Two-Factor Authentication)

CSCE 548 Building Secure Software Entity Authentication. Professor Lisa Luo Spring 2018

ICT 6541 Applied Cryptography Lecture 8 Entity Authentication/Identification

CIS 551 / TCOM 401 Computer and Network Security. Spring 2006 Lecture 13

Outline. Login w/ Shared Secret: Variant 1. Login With Shared Secret: Variant 2. Login Only Authentication (One Way) Mutual Authentication

Topics. Authentication System. Passwords

COMPUTER NETWORK SECURITY

SCRAM authentication Heikki Linnakangas / Pivotal

Hashes, MACs & Passwords. Tom Chothia Computer Security Lecture 5

Chapter 5: User Management. Chapter 5 User Management

MU2b Authentication, Authorization and Accounting Questions Set 2

TPM v.s. Embedded Board. James Y

Mike Pilkington. SANS Forensics and IR Summit June, 2011

CPSC 467b: Cryptography and Computer Security

n Describe the CEH hacking methodology and system hacking steps n Describe methods used to gain access to systems

1.264 Lecture 27. Security protocols Symmetric cryptography. Next class: Anderson chapter 10. Exercise due after class

Message Networking 5.2 Administration print guide

Security+ Guide to Network Security Fundamentals, Third Edition. Chapter 7 Access Control Fundamentals

Exam Questions MA0-150

Linux Systems Security. Access Control and Authentication NETS1028 Fall 2016

User Authentication and Passwords

Undergraduate programme in Computer sciences

CSCI 667: Concepts of Computer Security

Why bother? Default configurations Buffer overflows Authentication mechanisms Reverse engineering Questions?

SCRAM authentication Heikki Linnakangas / Pivotal

Elements of Cryptography and Computer and Network Security Computer Science 134 (COMPSCI 134) Fall 2016 Instructor: Karim ElDefrawy

T H E U N I V E R S I T Y O F B R I T I S H C O L U M B I A. Authentication EECE 412. Copyright Konstantin Beznosov

Chapter 5 Authentication and Basic Cryptography

Authentication CS 136 Computer Security Peter Reiher January 22, 2008

CS 111. Operating Systems Peter Reiher

Operating systems and security - Overview

Operating systems and security - Overview

CYB 610 Project 1 Workspace Exercise

Authentication. Steven M. Bellovin September 26,

BTEC Level 3. Unit 32 Network System Security Password Authentication and Protection. Level 3 Unit 32 Network System Security

Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) Language-based Protection: Solution

Why bother? Default configurations Buffer overflows Authentication mechanisms Reverse engineering Questions?

Authentication, Passwords. Robert H. Sloan

Goals. Understand UNIX pw system. Understand Lamport s hash and its vulnerabilities. How it works How to attack

Why secure the OS? Operating System Security. Privilege levels in 80X86 processors. The basis of protection: Seperation. Privilege levels - A problem

Check List: Linux Machines

CS System Security Mid-Semester Review

Identification Schemes

Overview. Terminology. Password Storage

Outline Key Management CS 239 Computer Security February 9, 2004

Jérôme Kerviel. Dang Thanh Binh

Authentication Methods

Transcription:

OS Security Authentication Radboud University Nijmegen, The Netherlands Winter 2014/2015

What does an OS do? Definition An operating system (OS) is a computer program that manages access of processes (programs) to shared ressources. OS Security Authentication 2

What does an OS do? Definition An operating system (OS) is a computer program that manages access of processes (programs) to shared ressources. Examples of shared resources Memory Input and Output (I/O) including Files on the harddrive Network Computation cycles on the processor(s) Peripheral hardware (keyboard, screen,... ) OS Security Authentication 2

What does that mean for security? Operating system needs to decide whether processes are allowed to perform certain operations Obvious security disasters: One process reading the memory of another process A process reading a secret file A process preventing other processes from operating One process reading (keyboard) input meant for another process OS Security Authentication 3

Wait, what about users? Is the process with ID 4321 allowed to read the file /home/peter/os-security/exam-2014.pdf? OS Security Authentication 4

Wait, what about users? Is the process with ID 4321 allowed to read the file /home/peter/os-security/exam-2014.pdf? Is user peter allowed to read the file /home/peter/os-security/exam-2014.pdf? OS Security Authentication 4

Wait, what about users? Is the process with ID 4321 allowed to read the file /home/peter/os-security/exam-2014.pdf? Is user peter allowed to read the file /home/peter/os-security/exam-2014.pdf? Need to map between a user (human) and a certain operation OS Security Authentication 4

Wait, what about users? Is the process with ID 4321 allowed to read the file /home/peter/os-security/exam-2014.pdf? Is user peter allowed to read the file /home/peter/os-security/exam-2014.pdf? Need to map between a user (human) and a certain operation Definition Authentication is the means by which it is determined that a particular entity (typically a human) intends to perform a given operation. OS Security Authentication 4

Wait, what about users? Is the process with ID 4321 allowed to read the file /home/peter/os-security/exam-2014.pdf? Is user peter allowed to read the file /home/peter/os-security/exam-2014.pdf? Need to map between a user (human) and a certain operation Definition Authentication is the means by which it is determined that a particular entity (typically a human) intends to perform a given operation. Typically perform user authentication as a login procedure Start a shell mapped to the logged-in user A shell is (basically) an interface to run other programs All programs run from this shell are mapped to the logged-in user OS Security Authentication 4

Problems of authentication Authentication is not necessarily perfect. Have to balance Fraud rate: authentication that passed, but should have failed Insult rate: authentication that failed, but should have passed OS Security Authentication 5

Problems of authentication Authentication is not necessarily perfect. Have to balance Fraud rate: authentication that passed, but should have failed Insult rate: authentication that failed, but should have passed User authentication does not catch everything: Programs may perform operations that are not requested (or intended) by the user Programs may not perform operations that are requested (or intended) by the user OS Security Authentication 5

Problems of authentication Authentication is not necessarily perfect. Have to balance Fraud rate: authentication that passed, but should have failed Insult rate: authentication that failed, but should have passed User authentication does not catch everything: Programs may perform operations that are not requested (or intended) by the user Programs may not perform operations that are requested (or intended) by the user Can perform operation authentication: Ensure that a given operation is performed on request of a given user Only feasible for very important operations OS Security Authentication 5

Problems of authentication Authentication is not necessarily perfect. Have to balance Fraud rate: authentication that passed, but should have failed Insult rate: authentication that failed, but should have passed User authentication does not catch everything: Programs may perform operations that are not requested (or intended) by the user Programs may not perform operations that are requested (or intended) by the user Can perform operation authentication: Ensure that a given operation is performed on request of a given user Only feasible for very important operations Worst-case of authentication going wrong: impersonation Authenticating as somebody else lets you perform all operations that this user is allowed to do Authenticating as anybody else lets you perform arbitrary operations OS Security Authentication 5

User authentication Can authenticate through something you know (typically a password) something you have (typically a card or token) something you are (biometrics) Multi-factor authentication combines two (or more) means of authentication OS Security Authentication 6

The user root UNIX and Linux have a special superuser called root The user ID of root is always 0 OS Security Authentication 7

The user root UNIX and Linux have a special superuser called root The user ID of root is always 0 root may access all files OS Security Authentication 7

The user root UNIX and Linux have a special superuser called root The user ID of root is always 0 root may access all files root may change permissions on all files OS Security Authentication 7

The user root UNIX and Linux have a special superuser called root The user ID of root is always 0 root may access all files root may change permissions on all files root may bind programs to network sockets with port number smaller than 1024 OS Security Authentication 7

The user root UNIX and Linux have a special superuser called root The user ID of root is always 0 root may access all files root may change permissions on all files root may bind programs to network sockets with port number smaller than 1024 root may impersonate any other user A process belonging to root may change its user ID to that of another user Once a process has changed from user ID 0 to another user ID, there is no way back OS Security Authentication 7

The user root UNIX and Linux have a special superuser called root The user ID of root is always 0 root may access all files root may change permissions on all files root may bind programs to network sockets with port number smaller than 1024 root may impersonate any other user A process belonging to root may change its user ID to that of another user Once a process has changed from user ID 0 to another user ID, there is no way back There are still certain actions that a program run by root cannot do (more next lecture) OS Security Authentication 7

The user root UNIX and Linux have a special superuser called root The user ID of root is always 0 root may access all files root may change permissions on all files root may bind programs to network sockets with port number smaller than 1024 root may impersonate any other user A process belonging to root may change its user ID to that of another user Once a process has changed from user ID 0 to another user ID, there is no way back There are still certain actions that a program run by root cannot do (more next lecture) Security nightmare: an attacker who gets root access OS Security Authentication 7

The Linux login procedure First process started after OS bootup is called init Main job of init is to start other processes OS Security Authentication 8

The Linux login procedure First process started after OS bootup is called init Main job of init is to start other processes init starts a program called getty getty stands for get terminal or get teletypewriter OS Security Authentication 8

The Linux login procedure First process started after OS bootup is called init Main job of init is to start other processes init starts a program called getty getty stands for get terminal or get teletypewriter getty starts login init, getty and login all run as root login prompts for username and password OS Security Authentication 8

The Linux login procedure First process started after OS bootup is called init Main job of init is to start other processes init starts a program called getty getty stands for get terminal or get teletypewriter getty starts login init, getty and login all run as root login prompts for username and password Bad password: login exits, init starts new getty Good password: login changes to new user and executes a shell OS Security Authentication 8

Attacks against passwords and countermeasures Guessing attack: Avoid short passwords and passwords from a dictionary OS Security Authentication 9

Attacks against passwords and countermeasures Guessing attack: Avoid short passwords and passwords from a dictionary Over-the-shoulder attack: password aging (replace passwords after a certain time), user training OS Security Authentication 9

Attacks against passwords and countermeasures Guessing attack: Avoid short passwords and passwords from a dictionary Over-the-shoulder attack: password aging (replace passwords after a certain time), user training Automated on-line guessing: Limit the number and/or rate of retries, report suspicious number of retries OS Security Authentication 9

Attacks against passwords and countermeasures Guessing attack: Avoid short passwords and passwords from a dictionary Over-the-shoulder attack: password aging (replace passwords after a certain time), user training Automated on-line guessing: Limit the number and/or rate of retries, report suspicious number of retries Read the password file: Use a (salted) one-way hash, prevent users from reading the file OS Security Authentication 9

Attacks against passwords and countermeasures Guessing attack: Avoid short passwords and passwords from a dictionary Over-the-shoulder attack: password aging (replace passwords after a certain time), user training Automated on-line guessing: Limit the number and/or rate of retries, report suspicious number of retries Read the password file: Use a (salted) one-way hash, prevent users from reading the file Automated offline attacks: Use a slow one-way hash, good passwords OS Security Authentication 9

Attacks against passwords and countermeasures Guessing attack: Avoid short passwords and passwords from a dictionary Over-the-shoulder attack: password aging (replace passwords after a certain time), user training Automated on-line guessing: Limit the number and/or rate of retries, report suspicious number of retries Read the password file: Use a (salted) one-way hash, prevent users from reading the file Automated offline attacks: Use a slow one-way hash, good passwords Spoofing attacks (present a fake login window): Trusted path for login OS Security Authentication 9

Attacks against passwords and countermeasures Guessing attack: Avoid short passwords and passwords from a dictionary Over-the-shoulder attack: password aging (replace passwords after a certain time), user training Automated on-line guessing: Limit the number and/or rate of retries, report suspicious number of retries Read the password file: Use a (salted) one-way hash, prevent users from reading the file Automated offline attacks: Use a slow one-way hash, good passwords Spoofing attacks (present a fake login window): Trusted path for login Eavesdropping attacks (key logging, acoustic attacks): physical security OS Security Authentication 9

/etc/passwd Linux uses the file /etc/passwd to store user login information Each line has 7 fields, separated by :, e.g.: peter:x:1000:1000:peter Schwabe,,,:/home/peter:/bin/bash OS Security Authentication 10

/etc/passwd Linux uses the file /etc/passwd to store user login information Each line has 7 fields, separated by :, e.g.: peter:x:1000:1000:peter Schwabe,,,:/home/peter:/bin/bash 1. field: Username OS Security Authentication 10

/etc/passwd Linux uses the file /etc/passwd to store user login information Each line has 7 fields, separated by :, e.g.: peter:x:1000:1000:peter Schwabe,,,:/home/peter:/bin/bash 1. field: Username 2. field: Password information, x means that the password hash is separately stored in /etc/shadow OS Security Authentication 10

/etc/passwd Linux uses the file /etc/passwd to store user login information Each line has 7 fields, separated by :, e.g.: peter:x:1000:1000:peter Schwabe,,,:/home/peter:/bin/bash 1. field: Username 2. field: Password information, x means that the password hash is separately stored in /etc/shadow 3. field: User ID (assigned to every process started by the user) OS Security Authentication 10

/etc/passwd Linux uses the file /etc/passwd to store user login information Each line has 7 fields, separated by :, e.g.: peter:x:1000:1000:peter Schwabe,,,:/home/peter:/bin/bash 1. field: Username 2. field: Password information, x means that the password hash is separately stored in /etc/shadow 3. field: User ID (assigned to every process started by the user) 4. field: Group ID (more later) OS Security Authentication 10

/etc/passwd Linux uses the file /etc/passwd to store user login information Each line has 7 fields, separated by :, e.g.: peter:x:1000:1000:peter Schwabe,,,:/home/peter:/bin/bash 1. field: Username 2. field: Password information, x means that the password hash is separately stored in /etc/shadow 3. field: User ID (assigned to every process started by the user) 4. field: Group ID (more later) 5. field: Comment describing the user OS Security Authentication 10

/etc/passwd Linux uses the file /etc/passwd to store user login information Each line has 7 fields, separated by :, e.g.: peter:x:1000:1000:peter Schwabe,,,:/home/peter:/bin/bash 1. field: Username 2. field: Password information, x means that the password hash is separately stored in /etc/shadow 3. field: User ID (assigned to every process started by the user) 4. field: Group ID (more later) 5. field: Comment describing the user 6. field: Home directory 7. field: Login program (set to /bin/false or /usr/sbin/nologin for users that are not allowed to log in) OS Security Authentication 10

/etc/shadow Traditionally /etc/passwd stored users password hashes Disadvantage: every user can read all hashes Easy to run offline (dictionary) attacks for every user OS Security Authentication 11

/etc/shadow Traditionally /etc/passwd stored users password hashes Disadvantage: every user can read all hashes Easy to run offline (dictionary) attacks for every user Better approach: store password hashes in /etc/shadow /etc/shadow is readable only for root Most important information per entry (line) Username Password hash + salt (+algorithm) Password expiration information OS Security Authentication 11

/etc/shadow Traditionally /etc/passwd stored users password hashes Disadvantage: every user can read all hashes Easy to run offline (dictionary) attacks for every user Better approach: store password hashes in /etc/shadow /etc/shadow is readable only for root Most important information per entry (line) Username Password hash + salt (+algorithm) Password expiration information Use * or! in the password field to lock the password Locking a password is different from using /bin/false as login program There may be other means to authenticate than the password OS Security Authentication 11

Password hashing algorithms Traditionally Linux used crypt for password hashing Truncate the password to 8 characters, 7 bits each Encrypt the all-zero string with modified DES with this 56-bit key Iterate encryption for 25 times (later: up to 2 24 1) Incorporate a 12-bit (later: 24-bit) salt OS Security Authentication 12

Password hashing algorithms Traditionally Linux used crypt for password hashing Truncate the password to 8 characters, 7 bits each Encrypt the all-zero string with modified DES with this 56-bit key Iterate encryption for 25 times (later: up to 2 24 1) Incorporate a 12-bit (later: 24-bit) salt Use modified DES to prevent attacks with DES hardware Originally computing the hash cost 1 second Too weak nowadays to offer strong protection OS Security Authentication 12

Password hashing algorithms Traditionally Linux used crypt for password hashing Truncate the password to 8 characters, 7 bits each Encrypt the all-zero string with modified DES with this 56-bit key Iterate encryption for 25 times (later: up to 2 24 1) Incorporate a 12-bit (later: 24-bit) salt Use modified DES to prevent attacks with DES hardware Originally computing the hash cost 1 second Too weak nowadays to offer strong protection Sucessors: MD5, bcrypt (based on Blowfish), SHA-2 OS Security Authentication 12

Password hashing algorithms Traditionally Linux used crypt for password hashing Truncate the password to 8 characters, 7 bits each Encrypt the all-zero string with modified DES with this 56-bit key Iterate encryption for 25 times (later: up to 2 24 1) Incorporate a 12-bit (later: 24-bit) salt Use modified DES to prevent attacks with DES hardware Originally computing the hash cost 1 second Too weak nowadays to offer strong protection Sucessors: MD5, bcrypt (based on Blowfish), SHA-2 Password hash string indicates which algorithm to use: $1$: MD5; $2a$, $2b$, $2x$, $2y$: variants of bcrypt $5$: SHA-256; $6$: SHA-512 OS Security Authentication 12

Password hashing algorithms Traditionally Linux used crypt for password hashing Truncate the password to 8 characters, 7 bits each Encrypt the all-zero string with modified DES with this 56-bit key Iterate encryption for 25 times (later: up to 2 24 1) Incorporate a 12-bit (later: 24-bit) salt Use modified DES to prevent attacks with DES hardware Originally computing the hash cost 1 second Too weak nowadays to offer strong protection Sucessors: MD5, bcrypt (based on Blowfish), SHA-2 Password hash string indicates which algorithm to use: $1$: MD5; $2a$, $2b$, $2x$, $2y$: variants of bcrypt $5$: SHA-256; $6$: SHA-512 Better algorithm through https://password-hashing.net/ Winner announced on Nov 2, 2015: ARGON2 OS Security Authentication 12

How about Windows? Traditionally, Windows uses the LM hash (for LanMan hash or LAN manager hash ) Algorithm for LM hash: 1. Restrict password to 14 characters OS Security Authentication 13

How about Windows? Traditionally, Windows uses the LM hash (for LanMan hash or LAN manager hash ) Algorithm for LM hash: 1. Restrict password to 14 characters 2. Convert password to all-uppercase OS Security Authentication 13

How about Windows? Traditionally, Windows uses the LM hash (for LanMan hash or LAN manager hash ) Algorithm for LM hash: 1. Restrict password to 14 characters 2. Convert password to all-uppercase 3. Pad to 14 bytes OS Security Authentication 13

How about Windows? Traditionally, Windows uses the LM hash (for LanMan hash or LAN manager hash ) Algorithm for LM hash: 1. Restrict password to 14 characters 2. Convert password to all-uppercase 3. Pad to 14 bytes 4. Split into two 7-byte halves OS Security Authentication 13

How about Windows? Traditionally, Windows uses the LM hash (for LanMan hash or LAN manager hash ) Algorithm for LM hash: 1. Restrict password to 14 characters 2. Convert password to all-uppercase 3. Pad to 14 bytes 4. Split into two 7-byte halves 5. Use each of the halves as a DES key OS Security Authentication 13

How about Windows? Traditionally, Windows uses the LM hash (for LanMan hash or LAN manager hash ) Algorithm for LM hash: 1. Restrict password to 14 characters 2. Convert password to all-uppercase 3. Pad to 14 bytes 4. Split into two 7-byte halves 5. Use each of the halves as a DES key 6. Encrypt the fixed ASCII string KGS!@#$% OS Security Authentication 13

How about Windows? Traditionally, Windows uses the LM hash (for LanMan hash or LAN manager hash ) Algorithm for LM hash: 1. Restrict password to 14 characters 2. Convert password to all-uppercase 3. Pad to 14 bytes 4. Split into two 7-byte halves 5. Use each of the halves as a DES key 6. Encrypt the fixed ASCII string KGS!@#$% 7. Concatenate the two ciphertexts to obtain the LM hash OS Security Authentication 13

LM Hash weaknesses 14 printable ASCII characters give 2 92 passwords OS Security Authentication 14

LM Hash weaknesses 14 printable ASCII characters give 2 92 passwords Can crack the halves independently: 2 46 for each half OS Security Authentication 14

LM Hash weaknesses 14 printable ASCII characters give 2 92 passwords Can crack the halves independently: 2 46 for each half All characters converted to upper case: 2 43 for each half OS Security Authentication 14

LM Hash weaknesses 14 printable ASCII characters give 2 92 passwords Can crack the halves independently: 2 46 for each half All characters converted to upper case: 2 43 for each half No salt, rainbow tables are feasible OS Security Authentication 14

LM Hash weaknesses 14 printable ASCII characters give 2 92 passwords Can crack the halves independently: 2 46 for each half All characters converted to upper case: 2 43 for each half No salt, rainbow tables are feasible Passwords shorter than 8 characters produce hash ending in 0xAAD3B435B51404EE OS Security Authentication 14

LM Hash weaknesses 14 printable ASCII characters give 2 92 passwords Can crack the halves independently: 2 46 for each half All characters converted to upper case: 2 43 for each half No salt, rainbow tables are feasible Passwords shorter than 8 characters produce hash ending in 0xAAD3B435B51404EE Cracking LM hashes is fairly easy, there are even online services, e.g., http://rainbowtables.it64.com/ OS Security Authentication 14

NT hashes LM hash weaknesses were addressed by NT hash (or NTLM) NTLMv1 uses MD4 to hash passwords NTLMv2 uses MD5 to hash passwords Passwords are still unsalted OS Security Authentication 15

NT hashes LM hash weaknesses were addressed by NT hash (or NTLM) NTLMv1 uses MD4 to hash passwords NTLMv2 uses MD5 to hash passwords Passwords are still unsalted Until Windows XP, LM hashes were still enabled by default for backwards compatiblity OS Security Authentication 15

NT hashes LM hash weaknesses were addressed by NT hash (or NTLM) NTLMv1 uses MD4 to hash passwords NTLMv2 uses MD5 to hash passwords Passwords are still unsalted Until Windows XP, LM hashes were still enabled by default for backwards compatiblity Today, Windows uses multiple different approaches for passwords OS Security Authentication 15

NT hashes http://www.hotforsecurity.com/blog/ windows-8-stores-logon-passwords-in-plain-text-3914.html OS Security Authentication 15

Weak passwords Largest problem with passwords: weak passwords Remember 1987 Mel Brooks movie Spaceballs OS Security Authentication 16

Weak passwords Largest problem with passwords: weak passwords Remember 1987 Mel Brooks movie Spaceballs Most common passwords in 2014 (SplashData list): OS Security Authentication 16

Weak passwords Largest problem with passwords: weak passwords Remember 1987 Mel Brooks movie Spaceballs Most common passwords in 2014 (SplashData list): Place 3: 12345 OS Security Authentication 16

Weak passwords Largest problem with passwords: weak passwords Remember 1987 Mel Brooks movie Spaceballs Most common passwords in 2014 (SplashData list): Place 3: 12345 Place 2: password OS Security Authentication 16

Weak passwords Largest problem with passwords: weak passwords Remember 1987 Mel Brooks movie Spaceballs Most common passwords in 2014 (SplashData list): Place 3: 12345 Place 2: password Place 1: 123456 OS Security Authentication 16

Weak passwords Largest problem with passwords: weak passwords Remember 1987 Mel Brooks movie Spaceballs Most common passwords in 2014 (SplashData list): Place 3: 12345 Place 2: password Place 1: 123456 Exercises in 1st semester course include breaking (unsalted) hash of a 7-character random password. Some students typically manage to do that in a week! OS Security Authentication 16

Authentication by what you have Very common in the physical world, e.g., keys Digital world: Smart cards, USB tokens Private keys (e.g., for SSH) OS Security Authentication 17

Authentication by what you have Very common in the physical world, e.g., keys Digital world: Smart cards, USB tokens Private keys (e.g., for SSH) Can easily combine with password, e.g. on SSH private keys OS Security Authentication 17

Authentication by what you have Very common in the physical world, e.g., keys Digital world: Smart cards, USB tokens Private keys (e.g., for SSH) Can easily combine with password, e.g. on SSH private keys Attacks and countermeasures Stealing (or finding): Protect possession OS Security Authentication 17

Authentication by what you have Very common in the physical world, e.g., keys Digital world: Smart cards, USB tokens Private keys (e.g., for SSH) Can easily combine with password, e.g. on SSH private keys Attacks and countermeasures Stealing (or finding): Protect possession Copying: Tamper-proof hardware, holograms, anti-counterfeiting techniques OS Security Authentication 17

Authentication by what you have Very common in the physical world, e.g., keys Digital world: Smart cards, USB tokens Private keys (e.g., for SSH) Can easily combine with password, e.g. on SSH private keys Attacks and countermeasures Stealing (or finding): Protect possession Copying: Tamper-proof hardware, holograms, anti-counterfeiting techniques Replay attack: device-dependent, use challenge-response OS Security Authentication 17

Authentication by what you are Fingerprint (fake fingerprint, cut off finger) http://www.heise.de/video/artikel/ iphone-5s-touch-id-hack-in-detail-1966044.html OS Security Authentication 18

Authentication by what you are Fingerprint (fake fingerprint, cut off finger) http://www.heise.de/video/artikel/ iphone-5s-touch-id-hack-in-detail-1966044.html Retina scans OS Security Authentication 18

Authentication by what you are Fingerprint (fake fingerprint, cut off finger) http://www.heise.de/video/artikel/ iphone-5s-touch-id-hack-in-detail-1966044.html Retina scans Voice match (distorted by cold, defeated by recordings) OS Security Authentication 18

Authentication by what you are Fingerprint (fake fingerprint, cut off finger) http://www.heise.de/video/artikel/ iphone-5s-touch-id-hack-in-detail-1966044.html Retina scans Voice match (distorted by cold, defeated by recordings) Handwriting (low accuracy, easy to fake) OS Security Authentication 18

Authentication by what you are Fingerprint (fake fingerprint, cut off finger) http://www.heise.de/video/artikel/ iphone-5s-touch-id-hack-in-detail-1966044.html Retina scans Voice match (distorted by cold, defeated by recordings) Handwriting (low accuracy, easy to fake) Keystroking, timing of keystrokes OS Security Authentication 18

Authentication by what you are Fingerprint (fake fingerprint, cut off finger) http://www.heise.de/video/artikel/ iphone-5s-touch-id-hack-in-detail-1966044.html Retina scans Voice match (distorted by cold, defeated by recordings) Handwriting (low accuracy, easy to fake) Keystroking, timing of keystrokes When a password is compromised, change your password. What if your fingerprint is compromised? OS Security Authentication 18

Compromising fingerprints... OS Security Authentication 19

Pluggable authentication modules Local login is not the only program that needs user authentication: SSH (remote login) Graphical login (GDM, LightDM) Screen locks (screensaver) su and sudo (more next lecture) OS Security Authentication 20

Pluggable authentication modules Local login is not the only program that needs user authentication: SSH (remote login) Graphical login (GDM, LightDM) Screen locks (screensaver) su and sudo (more next lecture) Idea: Centralize authentication, make functionality available through library This is handled by Pluggable Authentication Modules (PAM) OS Security Authentication 20

Pluggable authentication modules Local login is not the only program that needs user authentication: SSH (remote login) Graphical login (GDM, LightDM) Screen locks (screensaver) su and sudo (more next lecture) Idea: Centralize authentication, make functionality available through library This is handled by Pluggable Authentication Modules (PAM) Add a new module (e.g., for fingerprint authentication), directly available to all PAM enabled programs OS Security Authentication 20

PAM design Image from http://www.tuxradar.com/content/how-pam-works OS Security Authentication 21

PAM activities PAM knows 4 different authentication-related activities: auth: The activity of user authentication; typically by password, but can also use tokens, fingerprints etc. account: After a user is identified, decide whether he is allowed to log in. For example, can restrict login times. session: Allocates resources, for example mount home directory, set resource usage limits, print greeting message with information. password: Update the user s credentials (typically the password) OS Security Authentication 22

PAM configuration syntax Configuration for program progname is in /etc/pam.d/progname OS Security Authentication 23

PAM configuration syntax Configuration for program progname is in /etc/pam.d/progname PAM control flags requisite: if module fails, immediately return failure and stop required: if module fails, return failure but continue sufficient: if module passes, return pass and stop optional: pass/fail result is ignored Image source: http://www.tuxradar.com/content/how-pam-works OS Security Authentication 23

Examples of PAM modules Name Activities Description pam_unix auth, session, Standard UNIX authentication through password /etc/shadow passwords pam_permit auth, account, Always returns true session, password pam_deny auth, account, Always returns false session, password pam_rootok auth Returns true iff you re root pam_warn auth, account, Write a log message to the system log session, password pam_cracklib password Perform checks of the password strength OS Security Authentication 24

Some PAM config examples Prevent all users from using su (/etc/pam.d/su) auth requisite pam_deny.so OS Security Authentication 25

Some PAM config examples Prevent all users from using su (/etc/pam.d/su) auth requisite pam_deny.so Prevent non-root users to halt (/etc/pam.d/halt) auth sufficient pam_rootok.so auth required pam_deny.so OS Security Authentication 25

Some PAM config examples Prevent all users from using su (/etc/pam.d/su) auth requisite pam_deny.so Prevent non-root users to halt (/etc/pam.d/halt) auth sufficient pam_rootok.so auth required pam_deny.so Enforce passwords with at least 10 characters and at least 2 special characters, use SHA-512 for password hash (/etc/pam.d/passwd): password required pam_cracklib.so minlen=10 ocredit=-2 password required pam_unix.so sha512 OS Security Authentication 25

Authentication over the network Large corporate networks want to keep user information central User is added to one central directory, can log into any machine OS Security Authentication 26

Authentication over the network Large corporate networks want to keep user information central User is added to one central directory, can log into any machine Various simple ways to set up the protocol: Client sends password, server hashes and compares Client sends hash, server compares Server sends hash, client compares OS Security Authentication 26

Authentication over the network Large corporate networks want to keep user information central User is added to one central directory, can log into any machine Various simple ways to set up the protocol: Client sends password, server hashes and compares Client sends hash, server compares Server sends hash, client compares Also more complex ways, e.g., challenge-response OS Security Authentication 26

Authentication over the network Large corporate networks want to keep user information central User is added to one central directory, can log into any machine Various simple ways to set up the protocol: Client sends password, server hashes and compares Client sends hash, server compares Server sends hash, client compares Also more complex ways, e.g., challenge-response Possible disadvantage of central login server: single point of failure OS Security Authentication 26

NTLM and pass the hash Microsoft s LM and NTLM network authentication can send hash from the client, server compares hashes Attacker only needs to obtain the password hash The whole point of storing password hashes is gone Essentially, the hash becomes the password OS Security Authentication 27

NTLM and pass the hash Microsoft s LM and NTLM network authentication can send hash from the client, server compares hashes Attacker only needs to obtain the password hash The whole point of storing password hashes is gone Essentially, the hash becomes the password This attack is known as pass the hash attack OS Security Authentication 27

NTLM and pass the hash Microsoft s LM and NTLM network authentication can send hash from the client, server compares hashes Attacker only needs to obtain the password hash The whole point of storing password hashes is gone Essentially, the hash becomes the password This attack is known as pass the hash attack Conveniently automated in metasploit OS Security Authentication 27

NTLM and pass the hash Microsoft s LM and NTLM network authentication can send hash from the client, server compares hashes Attacker only needs to obtain the password hash The whole point of storing password hashes is gone Essentially, the hash becomes the password This attack is known as pass the hash attack Conveniently automated in metasploit Almost any larger Windows network still has NTLM somewhere OS Security Authentication 27

NIS Network Information Service (NIS) invented by Sun Centrally administer users and hosts Server sends hash to the client, client compares Essentially, the advantage of /etc/shadow is lost NIS is still in use today, but not very common anymore OS Security Authentication 28

LDAP The Lightweight Directory Access Protocol (LDAP) is a network directory information protocol Developed by the IETF Includes means for user authentication OS Security Authentication 29

LDAP The Lightweight Directory Access Protocol (LDAP) is a network directory information protocol Developed by the IETF Includes means for user authentication Different modes involve sending the password to the server OS Security Authentication 29

LDAP The Lightweight Directory Access Protocol (LDAP) is a network directory information protocol Developed by the IETF Includes means for user authentication Different modes involve sending the password to the server Use these modes only over a TLS connection OS Security Authentication 29

LDAP The Lightweight Directory Access Protocol (LDAP) is a network directory information protocol Developed by the IETF Includes means for user authentication Different modes involve sending the password to the server Use these modes only over a TLS connection Even better: integrate LDAP with Kerberos OS Security Authentication 29

Kerberos State-of-the-art network authentication protocol Originally developed at MIT Two main versions: v4 (with some security problems) and v5 Uses challenge-response, symmetric (and asymmetric) crypto OS Security Authentication 30

Kerberos State-of-the-art network authentication protocol Originally developed at MIT Two main versions: v4 (with some security problems) and v5 Uses challenge-response, symmetric (and asymmetric) crypto Included in most UNIX/Linux variants Together with LDAP forms the basis of Microsoft s Active Directory OS Security Authentication 30

Kerberos State-of-the-art network authentication protocol Originally developed at MIT Two main versions: v4 (with some security problems) and v5 Uses challenge-response, symmetric (and asymmetric) crypto Included in most UNIX/Linux variants Together with LDAP forms the basis of Microsoft s Active Directory More in the lecture Cryptography next semester OS Security Authentication 30