release the kraken - mathy vanhoef · release the kraken: new kracks in the 802.11 standard mathy...

43
Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef @vanhoefm Toronto, Canada, 16 October 2018

Upload: others

Post on 24-May-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Release the Kraken:New KRACKs in the 802.11 Standard

Mathy Vanhoef — @vanhoefm

Toronto, Canada, 16 October 2018

Page 2: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

2

Key reinstallations in

the 4-way handshake

Page 3: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

WPA2: 4-way handshake

Used to connect to any protected Wi-Fi network

3

Negotiates fresh PTK:

pairwise transient key

Mutual authentication

Page 4: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

WPA2: Encryption algorithm

4

Plaintext data

Nonce reuse implies keystream reuse (in all WPA2 ciphers)

Nonce

MixPTK(session key)

Nonce(packet number)

Packet key

Page 5: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

5

KRACK Attack

Page 6: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

6

KRACK Attack

Page 7: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

7

KRACK Attack

PTK = Combine(shared secret,

ANonce, SNonce)

Page 8: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

8

KRACK Attack

Block Msg4

Page 9: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

9

KRACK Attack

Block Msg4

Page 10: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

10

KRACK Attack

PTK is installed &

nonce set to zeroBlock Msg4

Page 11: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

11

KRACK Attack

Page 12: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

12

KRACK Attack

Page 13: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

13

KRACK Attack

In practice Msg4

is sent encrypted

Page 14: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

14

KRACK Attack

Page 15: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

15

KRACK Attack

Key reinstallation:

nonce again reset!

Page 16: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

16

KRACK Attack

Page 17: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

17

KRACK Attack

Next frame reuses

previous nonce!

Page 18: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

18

KRACK Attack

Keystream

Decrypted!

Page 19: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Practical

Obstacles

19

Page 20: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Rejected Msg3

20

Page 21: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Rejected Msg3

21

Plaintext Msg3

rejected

Page 22: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Rejected Msg3

22

Plaintext Msg3

rejected

Solution: generate

encrypted Msg3

Page 23: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

23

Page 24: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

24

Page 25: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

25

Page 26: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

26

Page 27: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

27

Page 28: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

28

Page 29: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

29

Page 30: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

30

Page 31: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

31

Page 32: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

32

Msg3 is now

encrypted

Page 33: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

33

Page 34: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Flawed countermeasure

34

Page 35: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

802.11’s official countermeasure

“When the Key, Address, Key Type, and Key ID

parameters identify an existing key, the MAC

shall not change the current transmitter

TSC/PN/IPN counter or the receiver replay

counter values associated with that key.”

35

Page 36: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Bypassing 802.11’s countermeasure

Group key transported in two frames

› EAPOL-Key frames

› WNM-Sleep frames

We can mix these frames

› WNM-Sleep installs new key

› Then EAPOL-Key reinstall old key

Can reinstall the group key

36

Page 37: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Details are non-trivial

WNM & Group HS

37

group HS & WNM 4-way HS & WNM

Page 38: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Implementation

Specific Flaws

38

Page 39: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Can we replay Message 4?

› Yes, certain MediaTek Drivers accept replayed Msg4’s

› Used in 100+ devices many vulnerable products

39

ASUS RT-AC51U TP-Link RE370K

Page 40: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Are PTK rekeys implemented properly?

Rekey is a new 4-way handshake

› Same messages exchanged as in initial 4-way handshake

› But new ANonce and SNonce is used

macOS:

› Patched default KRACK attack

› But reused the SNonce during a rekey

› SNonce reuse patched in macOS 10.13.3

40

Page 41: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Exploiting macOS’s SNonce reuse

Adversary can replay old handshake

› Need to inject encrypted message 1

› Feasible under specific conditions

› Causes key reinstallation

41

Page 42: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Conclusion

› We made attacks more practical

› Bypassed official countermeasure

› Handling group keys is hard

› Keep auditing devices & protocols!

42

Page 43: Release the Kraken - Mathy Vanhoef · Release the Kraken: New KRACKs in the 802.11 Standard Mathy Vanhoef —@vanhoefm Toronto, Canada, 16 October 2018

Questions?krackattacks.com/followup.html

Thank you!