60
2FA, WTF?

2FA, WTF? - Phil Nash - Codemotion Amsterdam 2016

Embed Size (px)

Citation preview

Page 1: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

2FA, WTF?

Page 2: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

HACKERS

Page 3: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

ARE

Page 4: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

EVERYWHERE

Page 5: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016
Page 6: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016
Page 7: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016
Page 8: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

Phil Nash@philnashh�p://[email protected]

Page 9: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

2FA, WTF?

Page 10: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

TWO FACTORAUTHENTICATION

Page 11: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

Two Factor Authen�ca�on

2FA is a security process in which a user providestwo different forms of iden�fica�on in order toauthen�cate themself with a system.

The two forms must come from different categories.Normally something you know and something youhave.

Page 12: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

WHY?

Page 13: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

MAT HONAN

Page 14: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

Mat Honan's Hackers' Timeline

1.  Found Gmail address on his personal site2.  Entered address in Gmail and found his @me.comback up email

3.  Called Amazon to add a credit card to file4.  Called Amazon again to reset password and gotaccess

5.  4:33pm: called Apple to reset password6.  4:50pm: reset AppleID password and gained accessto email

Page 15: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

Mat Honan's Hackers' Timeline

7.  4:52pm: reset Gmail account password8.  5:01pm: wiped iPhone9.  5:02pm: reset Twi�er password10.  5:05pm: wiped MacBook and deleted Google

account11.  5:12pm: posted to Twi�er taking credit for the hack

Page 16: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

@MAT

Page 17: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

WHY?

Page 18: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016
Page 19: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

ASHLEY MADISON

Page 20: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

Ashley Madison Top 10 Passwords1.  1234562.  123453.  password4.  DEFAULT5.  1234567896.  qwerty7.  123456788.  abc1239.  NSFW10.  1234567

Page 21: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

Ashley Madison Top 10 Passwords1.  123456 ‐ 120,511 users2.  12345 ‐ 48,452 users3.  password ‐ 39,448 users4.  DEFAULT ‐ 34,275 users5.  123456789 ‐ 26,620 users6.  qwerty ‐ 20,778 users7.  12345678 ‐ 14,172 users8.  abc123 ‐ 10,869 users9.  NSFW ‐ 10,683 users10.  1234567 ‐ 9,468 users

Source: h�p://qz.com/501073/the‐top‐100‐passwords‐on‐ashley‐madison/

Page 22: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

HOW?

Page 23: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

User Registra�on Flow

1.  Visit registra�on page2.  Sign up with username and password3.  User is logged in

Page 24: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

User Log In Flow

1.  Visit login page2.  Enter username and password3.  System verifies details4.  User is logged in

Page 25: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

SMS

Page 26: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

User Registra�on Flow

1.  Visit registra�on page2.  Sign up with username, password and phone nunber3.  User is logged in

Page 27: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

User Log In Flow

1.  Visit login page2.  Enter username and password3.  System verifies details4.  Verifica�on code sent to user by SMS5.  User enters verifica�on code6.  System verifies code7.  User is logged in

Page 28: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

PROS/CONS

Page 29: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

SOFT TOKEN

Page 30: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

User Registra�on Flow

1.  Visit registra�on page2.  Sign up with username, password3.  Generate a secret for the user4.  Share the secret somehow5.  User is logged in

Page 31: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

User Log In Flow

1.  Visit login page2.  Enter username and password3.  System verifies details4.  User opens auth app5.  User finds app verifica�on code and enters on site6.  System verifies code7.  User is logged in

Page 32: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

SECRETS

Page 33: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

HOTP/TOTP

Page 34: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

HOTP

HOTP(K,C) = Truncate(HMAC(K,C)) & 0x7FFFFFFF

HOTP-Value = HOTP(K,C) mod 10d

Page 35: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

h�ps://github.com/guyht/notp

Page 36: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

TOTP

Page 37: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

DEMO

Page 38: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

SHARING  SECRETS

Page 39: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

QR code

otpauth://TYPE/LABEL?PARAMETERS

otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example

Page 40: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016
Page 41: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

PROS/CONS

Page 42: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

CAN IT BEBETTER?

Page 43: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

FRIENDS DON'T LETFRIENDS WRITE THEIROWN AUTHENTICATION

FRAMEWORKS

Page 44: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

FRIENDS DON'T LETFRIENDS WRITE THEIROWN TWO FACTOR

AUTHENTICATIONFRAMEWORKS

Page 45: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016
Page 46: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

User Registra�on Flow

1.  Visit registra�on page2.  Sign up with username, password and phone nunber3.  System registers User with Authy4.  User is logged in

Page 47: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

User Log In Flow

1.  Visit login page2.  Enter username and password3.  System verifies details4.  Authy prompts user5.  User finds app verifica�on code and enters on site6.  System verifies code with Authy7.  User is logged in

Page 48: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

THE FUTURE

Page 49: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

PUSHNOTIFICATIONS

Page 50: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

0:21

Page 51: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

PROS/CONS

Page 52: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

SUMMARY

Page 53: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

USERS AREBAD WITHPASSWORDS

Page 54: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

OTHERWEBSITES AREBAD WITHPASSWORDS

Page 55: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

2FA CAN BEPUSH, TOKEN

OR SMS

Page 56: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

2FA IS FORYOUR USERS

Page 57: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016
Page 58: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

THANKS!

Page 59: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

Use code PNASH20 for 20% off �ckets

Page 60: 2FA, WTF? -  Phil Nash - Codemotion Amsterdam 2016

Thanks!@philnashh�p://[email protected]