WEP Cracking

From ivc wiki
Revision as of 20:02, 27 August 2009 by Ivc (talk | contribs) (→‎Tools)
Jump to navigationJump to search

WEP is infamously known as the totally broken wireless security protocol. Severe misapplication of cryptographic primitives were discovered in 2001 and after several cascading discoveries afterwards, it's now possible to crack a WEP protected network in under a minute. WPA is the successor to WEP and features a better but not perfect security protocol.

Background

There are now many sources that describe the vulnerability in detail and APR replay to generate traffic, but this is a short summary. For an throughout explaination on how WEP is implemented and the vulnerabilities, see the link below.

Types of attacks:

  • Passive attacks to decrypt traffic based on statistical analysis.
  • Active attack to inject new traffic from unauthorized mobile stations, based on known plaintext.
  • Active attacks to decrypt traffic, based on tricking the access point.
  • Dictionary-building attack that, after analysis of about a day's worth of traffic, allows real-time automated decryption of all traffic.

Original discoveries and papers:

Wep encryption.png

Way of attack

The following way is current the most efficient method to crack a WEP protected network to find its key. The attack can be performed in under a minute.

  • WEP encryption:
  1. 24-bit unencrypted Initialization Vector + 104-bit key (13 characters/bytes), 128-bit key
  2. Used to generate linear RC4 cipher stream, RC4(IV, Key)
  3. XOR the message using cipher stream
  4. Encrypted network frame
  • ARP replay:
  1. On the basis that the first 12-bytes of ARP packets always stays the same
  2. De-authenticate clients connected to the Access Point or send a fake authentication attack, creating an ARP request
  3. Capture this ARP packet (encrypted)
  4. Continuously re-inject ARP packet back to into the network to stimulate traffic (it's a boardcast packet)
  5. Capture 10-30 000 ARP (and other data) packets
  • Key attack:
  1. Detect reuse of Initialization Vectors (collisions), only 2^24 possibilities
  2. Reverse XOR on first 2-bytes on all packets (KoreK) and 12-bytes on well-known ARP packets
  3. 12-bytes of the RC4 stream cipher is revealed for that specific frame (Initialization Vector + RC4 stream cipher)
  4. Build table of Initialization Vectors and RC4 stream cipher pieces
  5. Use table to gain a statistical factor for each key byte (13 bytes, 104-bit) using the FMS RC4, KoreK, Klein, and the latest PTW attack.
  6. Run trails to test key decryption

Practical attack

This will show how easy it is to attack a WEP protected network. They key length does not matter and it can be done using regular customer-grade equipment.

Tools

All the necessary utilities are included in the Aircrack-ng suite.

  • Monitor and mode setting tools:
    • airmon - Enable monitor mode, find wireless networks, and capture frames
    • kismet - Set adapter monitor mode, survey, and capture frames
  • airodump - Capture raw frames, saves to *.cap files
  • aireplay - Re-inject frames, different attack modes
  • aircrack - WEP/WPA/WPA2 key cracking program

Find wireless network

De-authenticate

Packet re-injection

Crack key

References