CNS Lecture 3 - 2
Total Page:16
File Type:pdf, Size:1020Kb
In the news CNS •gcc 4.1 has stackguard Lecture 3 •Problem in OpenSSL with SHA public key of 3 and padding CVE-2006-4339 see cve.mitre.org •Bank of Ireland will refund phishing losses (160K euros) •authentication •Spammer conviction upheld (9 years in prison) •passwords •Microsoft Publisher could allow remote execution •hash functions MD5, SHA, RIPEMD-160, Whirlpool Cost-benefit analysis for the attacker (Clark & Davis ’95) fun things you can do with hashish hashing Hacking Tip 7345: Mb + Pb > Ocp + OcmPaPc Mb monetary benefit to attacker Reverse engineer a “fixed” P psychological benefit to attacker application or DLL and assignments b develop an exploit ☺ Ocp cost of committing the crime root:.6PcYNUPBpzxw:0:0::/root:/bin/csh Ocm cost of conviction to the attacker toor::0:0::/root:/bin/csh alice:nfVWnUWaAuDSE:500:500:Alice:/home/alice:/bin/csh Pa probability of arrest mallory:yyv4LsfKaOHAE:503:500:Mallory:/home/mallory:/bin/csh bob:nfVWnUWaAuDSE:501:500:Bob:/home/bob:/bin/csh Pc probability of conviction eve:xxP6v.rTrWTb2:505:500:Eve:/home/eve:/bin/csh CNS Lecture 3 - 2 authentication You are here … Attacks & Defenses Cryptography Applied crypto • verifying an identity • • people authentication Risk assessment •Random numbers •SSH • Viruses • password schemes Why authentication? •Hash functions •PGP •access control • Unix security • challenge/response •authorization • • authentication MD5, SHA,RIPEMD S/Mime • token based •auditing • Network security •Classical + stego •SSL • public key systems Firewalls,vpn,IPsec,IDS • biometrics •Number theory •Kerberos • Forensics • host/message authentication •Symmetric key •IPsec DES, Rijndael, RC5 •Crypto APIs •Public key •Coding securely CNS Lecture 3 - 3 RSA, DSA, D-H,ECC CNS Lecture 3 - 4 Design criteria Authenticating people people identify people by face • strength (resistance to attacks) computer verifying who you are voice • speed ID reference • ease of use • what you know • accuracy (false positives) • what you have • manageability • what you are • reliability Best: at least two of the above CNS Lecture 3 - 5 CNS Lecture 3 - 6 1 Is it you? Smart cards What you know •password •PIN What you are … biometrics •Social security number • memory (cash card) •facial verification (picture ID) •Mother’s maiden name • secret-key crypto cards •retinal scanner don’t know when you’ve lost/shared it! •fingerprint reader • public-key crypto cards •hand geometry reader (Olympics/customs) (FORTEZZA) verification, not identifcation What you have • need RS-232 reader or PCMCIA or • voiceprints •ATM card USB or smartdisk • keystroke timing •dongle (bootup, software protect) • • need card loading/init device handwriting •SecurID (server, modified login) concerns: expense, false accept/reject •crypto calculator (challenge/response) • ISO standards •smart card/disk excellent for storing private keys You know when you've lost it or biometric data combine with what you know: PIN or signature Provide both logical and physical special readers / software mods access control (DoD) CNS Lecture 3 - 7 CNS Lecture 3 - 8 Smart card features Authentication scorecard • reader powered (9600 baud) • tamper-resistant (self-destruct) • 8-bit CPU, 8KB ROM, 3K EEPROM, RAM • Write/Erase Cycles: 10,000 • Data life (storage) : 10 years crypto co-processor (FORTEZZA pcmcia) • 160-bit CPU • mod arithmetic • crypto software (RSA, skipjack) Smart card readers (RS-232, USB, PCMCIA) • login supported by linux, Windows CNS Lecture 3 - 9 CNS Lecture 3 - 10 Authentication protocols Athentication protocols USER HOST database ----- name, password --> clear, crypt, hash Our ncp asnmt 3? one-way ----- name, securid# --> server software • password • challenge/response **USER's machine*** • public-key --------name ------> clear/hashed <------ R -------- challenge (nonce) --------- (R)key ------> (encrypt or keyed-hash) two-way (mutual authentication) • trusted intermediary (Kerberos) -------name (time) -----> clear/hashed key Our ncp asnmt 4 • public-key -----------name ------> (Novell 3) hash of key H(key) <------------- R ------- challenge issues ----- H(R,H(key)) ------> • secrets on server • vulnerabilities of protocol -- cleartext, replay, dictionary attack, other? ---------name-----> KDC (clear) (more later, Kerberos) <------(ticket)key ---- • performance of protocol -----name---> NT (hash of key), LAN mgr • cost (user/server) <------------R--- challenge -----(R) -------> • convenience H(key) CNS Lecture 3 - 11 CNS Lecture 3 - 12 2 Mutual authentication Authentication vulnerabilities **USER's machine*** HOST • eavesdropping (sniffers) ------name ----> clear/crypt • password database <--------R1 ------- • replay (need random numbers, good time stamp, sequence number) ------(R1)key --------> --------R2 -----------> • offline guessing (dictionary attack, know R1 and (R1)key) <-------(R2)key --------- • Network session maybe hijacked after authentication! • later: KDC (Kerberos) can provide mutual authentication • authentication can be done with public/private keys too (later) CNS Lecture 3 - 13 CNS Lecture 3 - 14 Passwords -- what you know Strong passwords • easy to remember • special characters, numbers, upper/lower case • hard to guess • would like 64 bits of randomness, so: • historical: military, espionage –with 6-bit alphabet would need 11 characters –pronouncable, need 16 characters password vulnerabilities –choose your own, need 32 characters • easy to guess • human mind is not a good password storage device • read file where passwords are stored • eavesdropper/sniffer “Yes, I use my dog's name as my password. • sys mgr may know/decrypt My dog's name is 4X(!m,q@V-2 • off-line search and I change his name every 90 days.” • strong passwords: inconvenient, people write them down! CNS Lecture 3 - 15 CNS Lecture 3 - 16 Password storage UNIX passwords root:ab7er6hjkjase:0:0:root:/root:/bin/csh bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin • clear text (secret file, security through obscurity -- Ha!) • 8 characters (truncated) ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin nobody:x:99:99:Nobody:/:/sbin/nologin 56 ntp:x:38:14:ntp:/etc/ntp:/sbin/nologin • encrypted • 2 possibilities (7-bit ASCII) apache:x:48:48:Apache:/var/www:/bin/false nscd:x:28:28:NSCD Daemon:/:/bin/false ldap:x:55:55:LDAP User:/var/lib/ldap:/bin/false • encrypted on authentication server (kerberos, securid server) • assigned by sys mgr xfs:x:43:43:X Font Server:/etc/X11/fs:/bin/false gdm:x:42:42::/var/gdm:/sbin/nologin • hashed (one-way encrypted or hash function) • change with passwd dunigan:x:23673:20:TomDunigan:/home/dunigan:/bin/csh • hashed and shadowed • hashed and encoded in /etc/passwd –Hopefully shadowed • portable hash string • newer OS's provide MD5 encoding, longer phrases CNS Lecture 3 - 17 CNS Lecture 3 - 18 3 Unix passwords Password vulnerabilities • user enters name and password • host hashes password and compares • ask user • 13 character string (Dqd2z5wN/3xyE) • guess • 2 character salt (random, 4096) • (void) time(&salt); brute force (1000 MIP years) saltc[0] = salt & 077; • dictionary attack (CRACK) saltc[1] = (salt>>6) & 077; • eavesdrop (sniffer) ... asciify return(crypt(pwbuf,salt)); • shoulder surfing • failed attempts not logged (WWW) salt • trojan horse/library •reduces identical password encodings •discourages pre-hashed dictionary •does not affect time to search for one password crypt() •uses 25 iterations of modified DES (EP is different, thwart DES hardware), • encrypts 0 using salt/pwbuf as "key", • encode 64-bit cipher output to 6-bit alphanumerics CNS Lecture 3 - 19 CNS Lecture 3 - 20 CRACK -- p1Ssw0rd crack3r countermeasures • shadow file • • Dictionary and variations, guess and verify enforce strong passwords • widely available (others: John the Ripper, plus crackers for Windows password databases) – Minimum length • can use multiple machines (parallel) – combo of numerics, alphabetics, special characters • Tries variations of user names, gecos field then dictionary – Language models (Markov ) • rule based ../Scripts/dicts.rules – CRACK-like dictionary tests • caps, substitution, reverse, add a number Bloom filter Hashi(wordj)=y ( y [0,N-1] ) # Pluralise every significant one of the above N-bit “hash” table, reject if tabley is set # MORE-THAN 2, NOT-CONTAIN ANY NON-ALPHA, LOWERCASE, PLURALISE – OS generate list >2!?Alp • scan for weak passwords (CRACK) # Any alphaword >2 & <8 chars long, append a digit or simple punctuation • password aging # since few ppl add non alpha chars to a already non-alpha word • # MORE-THAN 2, LESS-THAN 8, NOT ANY NON-ALPHA, LOWERCASE, APPEND <whatever> eliminate dormant accounts >2<8!?Al0 • log failures (?) >2<8!?Al1 • disable after n failures (?) >2<8!?Al2 Markov model >2<8!?Al3 • trusted hosts (rlogin) • ssh public/private key # Lowercase every pure alphabetic word and reverse it •language letter transition # MORE-THAN 2, NOT-CONTAIN ANY NON-ALPHA, LOWERCASE, REVERSE • Kerberos probabilities (digrams, trigrams) >2!?Alr Don't use re-usable passwords! •Reject if password fits model Lots of password cracking software for various applications CNS Lecture 3 - 21 CNS Lecture 3 - 22 One-time passwords SecurID • SecurID or SafeWord tokens • 2-factor authentication (card and PIN) • challenge/response (SecureNet, SNK) • need to issue cards (battery life?)… costs $$ • need ACE server (DB of username + card secret) • code-book • need to modify login/su on enterprise servers to use ACE server • Skey (OPIE)