the final nail in wep's coffin - stanford universitysorbo/bittau-wep-slides.pdfpopularity (%)...

30
Introduction Fragmentation Attack Implementation Conclusion 1/19 The Final Nail in WEP’s Coffin Andrea Bittau 1 Mark Handley 1 Joshua Lackey 2 May 24, 2006 1 University College London. 2 Microsoft.

Upload: others

Post on 06-Jul-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

1/19

The Final Nail in WEP’s Coffin

Andrea Bittau1 Mark Handley1 Joshua Lackey2

May 24, 2006

1University College London.2Microsoft.

Page 2: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

2/19

Wired Equivalent Privacy

WEP is the 802.11 standard for encryption.

Pre-shared key for whole network.

Protects data privacy since data is encrypted.

Access control: need key to transmit.

In practice, only half of the networks are encrypted.

In the subset of encrypted networks, WEP is most adopted.

Popularity (%) of WEP and its alternatives based on our survey

Region WEP WPA 802.11i

London 76 20 4Seattle region 85 14 1

Page 3: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

3/19

Goals when attacking WEP

Decrypt data in packets.

Obtain access to the network by being able to transmit data.

Recover the WEP key.

Page 4: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

4/19

Contribution

Today, millions of packets are required to break a WEP key.

Our fragmentation attack allows:

1 Transmitting arbitrary data after eavesdropping a single datapacket on an 802.11 WEP protected network.

2 Real-time decryption given that network is connected toInternet.

Page 5: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

5/19

Outline

1 IntroductionWEP DescriptionWEP Attacks

2 Fragmentation AttackTransmissionDecryption

3 ImplementationPerformance Evaluation

4 Conclusion

Page 6: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

6/19

WEP operation

Data frame format

802.11 Header CRCFrame Body

IV {Initialization Vector

ICV {

CRC32 of user data

User Data

Encryption

IV + key{

seed

RC4

{keystream

0

1

1

1

1

0

=

0

0

0

1

0

1

Plain text

Cipher text

Page 7: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

7/19

History of WEP attacks. . . and how the real problem was ignored

Year 2000. Keystream attacks (independent of WEP key):

Design flaw: WEP allows keystream reuse.

Attacks were thought impractical:

Need plain-text to recover keystream.Need 224 keystreams to decrypt all possible packets.

Year 2001. Weak IV attacks (recover WEP key):

Need millions of packets. Could take hours, and usually, days.

Use EAP-based solutions to re-key, say, every ten minutes.

Year 2006. Our contribution: fragmentation attack.

Keystream attack which may be performed within minutes.

Page 8: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

7/19

History of WEP attacks. . . and how the real problem was ignored

Year 2000. Keystream attacks (independent of WEP key):

Design flaw: WEP allows keystream reuse.

Attacks were thought impractical:

Need plain-text to recover keystream.Need 224 keystreams to decrypt all possible packets.

Year 2001. Weak IV attacks (recover WEP key):

Need millions of packets. Could take hours, and usually, days.

Use EAP-based solutions to re-key, say, every ten minutes.

Year 2006. Our contribution: fragmentation attack.

Keystream attack which may be performed within minutes.

Page 9: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

7/19

History of WEP attacks. . . and how the real problem was ignored

Year 2000. Keystream attacks (independent of WEP key):

Design flaw: WEP allows keystream reuse.

Attacks were thought impractical:

Need plain-text to recover keystream.Need 224 keystreams to decrypt all possible packets.

Year 2001. Weak IV attacks (recover WEP key):

Need millions of packets. Could take hours, and usually, days.

Use EAP-based solutions to re-key, say, every ten minutes.

Year 2006. Our contribution: fragmentation attack.

Keystream attack which may be performed within minutes.

Page 10: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

8/19

Fragmentation attackOutline

Transmission

1 Recover a keystream.

2 Reuse the keystream to send arbitrary data.

��

HHHH

HHH

HjKeystream-based decryption

Resend data through the AP to abuddy on the Internet.

Recover the keystream used forencrypting the packet.

WEP key recovery

Use transmission ability forspeeding up weak IVattacks.

Page 11: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

9/19

TransmissionRecovering a short keystream

If cipher-text & plain-text pair is known, their XOR is a keystream.Known plain-text (LLC/SNAP headers) in IP packets:

802.11 header 0xAA 0xAA 0x03 0x00 0x00 0x00 0x08 0x00

802.11 header Cipher-text

=

8 bytes of keystream

Can recover 8 bytes of keystream by eavesdropping a packet.

Can encrypt (and transmit) 8 bytes of arbitrary data.

Page 12: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

9/19

TransmissionRecovering a short keystream

If cipher-text & plain-text pair is known, their XOR is a keystream.Known plain-text (LLC/SNAP headers) in IP packets:

802.11 header 0xAA 0xAA 0x03 0x00 0x00 0x00 0x08 0x00

802.11 header Cipher-text

=

8 bytes of keystream

Can recover 8 bytes of keystream by eavesdropping a packet.

Can encrypt (and transmit) 8 bytes of arbitrary data.

Page 13: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

10/19

TransmissionSending arbitrarily long data

802.11 supports MAC layer fragmentation.

Transmit arbitrary data in 8 byte chunks.

Fragmentation }Data

abcd efghOriginal plain-text & CRC. 1234

}CRC32

abcd 1983Fragments & CRC.

⊕1234 5678Keystream (IV x).

=

2911 8305Encrypted frags. x

efgh 1914

⊕1234 5678

=

1337 6667x

}IV

Page 14: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

10/19

TransmissionSending arbitrarily long data

802.11 supports MAC layer fragmentation.

Transmit arbitrary data in 8 byte chunks.

Fragmentation }Data

abcd efghOriginal plain-text & CRC. 1234

}CRC32

abcd 1983Fragments & CRC.

⊕1234 5678Keystream (IV x).

=

2911 8305Encrypted frags. x

efgh 1914

⊕1234 5678

=

1337 6667x

}IV

Page 15: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

10/19

TransmissionSending arbitrarily long data

802.11 supports MAC layer fragmentation.

Transmit arbitrary data in 8 byte chunks.

Fragmentation }Data

abcd efghOriginal plain-text & CRC. 1234

}CRC32

abcd 1983Fragments & CRC.

⊕1234 5678Keystream (IV x).

=

2911 8305Encrypted frags. x

efgh 1914

⊕1234 5678

=

1337 6667x

}IV

Page 16: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

10/19

TransmissionSending arbitrarily long data

802.11 supports MAC layer fragmentation.

Transmit arbitrary data in 8 byte chunks.

Fragmentation }Data

abcd efghOriginal plain-text & CRC. 1234

}CRC32

abcd 1983Fragments & CRC.

⊕1234 5678Keystream (IV x).

=

2911 8305Encrypted frags. x

efgh 1914

⊕1234 5678

=

1337 6667x

}IV

Page 17: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

10/19

TransmissionSending arbitrarily long data

802.11 supports MAC layer fragmentation.

Transmit arbitrary data in 8 byte chunks.

Fragmentation }Data

abcd efghOriginal plain-text & CRC. 1234

}CRC32

abcd 1983Fragments & CRC.

⊕1234 5678Keystream (IV x).

=

2911 8305Encrypted frags. x

efgh 1914

⊕1234 5678

=

1337 6667x

}IV

Page 18: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

11/19

TransmissionRecovering a longer keystream

Discover a longer keystream to avoid sending many tiny packets:

Send a long broadcast frame via multiple smaller fragments.

AP relays it as a single packet. (New cipher & plain-text pair.)

Keystream discovery

Encrypted frags.

IV }x

Data}2911

CRC}

8305 x 1337 6667

De-crypt & reassemble.Calculate entire CRC.

abcd efgh

⊕1234

Keystream for IV y. 3141 5926 5358

=

Relayed payload. 2718 2818 2845y

Page 19: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

11/19

TransmissionRecovering a longer keystream

Discover a longer keystream to avoid sending many tiny packets:

Send a long broadcast frame via multiple smaller fragments.

AP relays it as a single packet. (New cipher & plain-text pair.)

Keystream discovery

Encrypted frags.

IV }x

Data}2911

CRC}

8305 x 1337 6667

De-crypt & reassemble.Calculate entire CRC.

abcd efgh

⊕1234

Keystream for IV y. 3141 5926 5358

=

Relayed payload. 2718 2818 2845y

Page 20: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

11/19

TransmissionRecovering a longer keystream

Discover a longer keystream to avoid sending many tiny packets:

Send a long broadcast frame via multiple smaller fragments.

AP relays it as a single packet. (New cipher & plain-text pair.)

Keystream discovery

Encrypted frags.

IV }x

Data}2911

CRC}

8305 x 1337 6667

De-crypt & reassemble.Calculate entire CRC.

abcd efgh

⊕1234

Keystream for IV y. 3141 5926 5358

=

Relayed payload. 2718 2818 2845y

Page 21: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

11/19

TransmissionRecovering a longer keystream

Discover a longer keystream to avoid sending many tiny packets:

Send a long broadcast frame via multiple smaller fragments.

AP relays it as a single packet. (New cipher & plain-text pair.)

Keystream discovery

Encrypted frags.

IV }x

Data}2911

CRC}

8305 x 1337 6667

De-crypt & reassemble.Calculate entire CRC.

abcd efgh

⊕1234

Keystream for IV y. 3141 5926 5358

=

Relayed payload. 2718 2818 2845y

Page 22: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

11/19

TransmissionRecovering a longer keystream

Discover a longer keystream to avoid sending many tiny packets:

Send a long broadcast frame via multiple smaller fragments.

AP relays it as a single packet. (New cipher & plain-text pair.)

Keystream discovery

Encrypted frags.

IV }x

Data}2911

CRC}

8305 x 1337 6667

De-crypt & reassemble.Calculate entire CRC.

abcd efgh

⊕1234

Keystream for IV y. 3141 5926 5358

=

Relayed payload. 2718 2818 2845y

Page 23: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

12/19

DecryptionKeystream expansion

Decrypt data locally in linear time with respect to its length:

If n bytes of keystream were known, n bytes of data could bedecrypted. Base case: 8 bytes of keystream are known.

Guess keystream byte n + 1 and verify it. Send a broadcastusing extended keystream. If AP relayed it, guess is correct.

Continue keystream expansion for whole length of packet.

Decryption example

Known keystream 00

Known keystream 01

Known keystream 01 00

AP

Page 24: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

13/19

DecryptionResending data to our Internet buddy

To decrypt data in real-time, resend it to the Internet.

1 Eavesdrop a payload to decrypt.

2 Send two 802.11 fragments: an IP header with our buddy asdestination, and the original encrypted payload as a fragment.

3 AP will decrypt and send it in clear-text to our Internet buddy.

Decrypting with an Internet buddy

IP, data DestinationSource

Attacker

IP, dataIP

AP

Buddy

IP {IP, Data}

Page 25: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

14/19

Fragmentation attackSummary

To encrypt data:

1 Eavesdrop a data packet.

2 Cipher-text ⊕ known plain-text = 8 bytes of keystream.

3 Transmit data in multiple 8 byte fragments.

To decrypt data:

1 Eavesdrop packet to decrypt.2 Send two 802.11 fragments:

1 An IP header destined to a buddy on the Internet.2 A fragment containing the original eavesdropped payload.

3 Internet buddy will receive the payload in clear-text.

Page 26: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

15/19

Implementation

Hardware: Atheros chipset.

Software radio. Ideal for packet injection.

Supports 802.11{a,b,g}.

Software:

FreeBSD. Added packet injection support to ath driver.

wesside. Proof-of-concept fragmentation attack tool.

Page 27: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

16/19

wesside

1 Eavesdrops data packet and uses fragmentation to transmit.

2 Determines the network IP via keystream expansion.

3 Contacts buddy on Internet instructing him to flood the WiFi.

4 Recovers WEP key via weak IV attack (using aircrack).

Operation of wesside

APAttacker

FragmentationData packet

Weak IVWEP key

Buddy onInternet

Flood request

Flood

Page 28: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

17/19

Performance

Fragmentation attack, after eavesdropping one packet:

Recover 1500 bytes of keystream: < 2 seconds.

Decrypt network’s IP: < 30 seconds.

CDF of cracked keys via weak IV

0

25

50

75

100

0 2 4 6 8 10 12 14 16

28 65 93 121 148 176 204 232

Per

cent

age

of c

rack

ed k

eys

Number of packets (millions)

Attack Time (min)

40-bit keys104-bit keys

Page 29: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

18/19

Lessons

Fragmentation attack:

May be performed instantly. Frequent re-keying (EAP) doesnot mitigate the problem. Migrate to 802.11i.

Non-solution: ship hardware with no fragmentation support.

Solution: ship hardware with no WEP support.

WEP history:

Attacks evolve over time. In 2000, theoretical issues wereidentified. Today, we provide a practical exploit for them.

Theoretical guidelines must be followed. Perfect example ofdamage incurred by keystream reuse and no authentication.

Page 30: The Final Nail in WEP's Coffin - Stanford Universitysorbo/bittau-wep-slides.pdfPopularity (%) of WEP and its alternatives based on our survey Region WEP WPA 802.11i London 76 20 4

IntroductionFragmentation Attack

ImplementationConclusion

19/19

Conclusion

Do not use WEP—teach about its failures.

Future Work: The First Nail in WPA’s Coffin. . .