WEP: Dead Again, Part 1 by Michael OssmannSource. 14/12/2004
Introduction
Is WEP that bad?
The way things were
Figure 1 Figure 1. Kismet in action. The second thing working against your packet collection efforts is that only certain "interesting" or "weak" IVs are vulnerable to attack. Kismet also tells you how many of these have been gathered, although it may not use the same counting methodas the various cracking tools. To make matters more difficult, wireless manufacturers responded to the FMS attack by filtering out the majority of weak IVs that their access points and wireless cards transmit. Unless your target network is using old equipment, chances are you'll have to collect no less than ten million encrypted packets to crack a WEP key using these older tools. In early 2002, h1kari released a tool called dwepcrack (part of the bsd-airtools package) that improved upon the existing implementations of the FMS attack. Although dwepcrack did a good job of advancing the practical implementation of statistical WEP cr ptanalysis, its improvements were only incremental.
Tools that changed everything
Aircrack
Figure 2 Figure 2. aircrack succeeds.
How many packets does it take?
How long does it take?
Figure 3 Figure 3. aircrack execution times.
If the default fudge factor (two) fails,
I usually double it for each subsequent attack on the same data set.
By terminating any attack that takes longer than five or ten minutes,
I have had good luck finding a successful fudge factor fairly quickly.
WepLab
Comparing the tools
128 bit Cracking Time in Seconds
Data Weak Unique | aircrack AirSnort WepLab dwepcrack
Packets IVs IVs aircrack (4) | WepLab (95) WEPCrack
23457438 8560 16775533 Failed 245 92 Failed 244 Failed Error
21016149 1807 16775167 Failed 249 41 Failed 247 Failed Failed
19584364 9340 16275925 Failed 230 114 Failed 229 Failed Failed
15690079 8694 12860342 Failed 184 90 Failed 179 Failed Error
15628308 5505 12361369 Failed 176 70 Failed 174 Failed Failed
11743639 8473 11743639 Failed 154 69 Failed 153 Failed Error
11739339 3037 11693841 Failed 150 Failed Failed 151 Failed Failed
7829104 1001 5031233 Failed 74 Failed Failed 77 Failed Error
7799213 5225 7779299 Failed 87 37 Failed 101 Failed Failed
4175159 1554 4069824 52 51 Failed Failed 54 Failed Failed
3914568 767 3914568 Failed Failed Failed Failed Failed Failed Error
3914553 3958 3914553 48 49 Failed Failed 56 Failed Error
3884657 1490 3864743 48 46 Failed Failed 52 Failed Failed
978652 986 978652 Failed Failed Failed Failed 11 Failed Error
978633 371 978633 Failed 12 Failed Failed 13 Failed Error
977219 264 974902 Failed 9 Failed Failed 13 Failed Failed
684992 143 684992 8 8 Failed Failed 11 Failed Error
683605 238 681288 Failed 18 Failed Failed 13 Failed Failed
587184 117 587184 Failed 27 Failed Failed Long Failed Error
489293 103 489293 8 7 Failed 5 5 Failed Error
489286 115 489286 15 16116 Failed Failed Long Failed Error
391465 78 391465 5 13 Failed Failed Long Failed Error
391433 78 391433 Failed 6 Failed Failed 6 Failed Error
293596 65 293596 Failed 5 Failed Failed Long Failed Error
293579 65 293579 Failed Failed Failed Failed Failed Failed Error
Table 1. 128 bit WEP Cracking Times (in seconds).
Although aircrack was successful with the greatest number of data sets, it did not perform as well as I expected with the default fudge factor. In fact, beyond about four million packets, its success rate with default options noticeably declined with the addition of more packets. This problem was easily remedied, however, by increasing the fudge factor. A fudge factor of four was successful in nearly every case. In the few cases in which a fudge factor of four did not work, I was able to find a successfu setting in the five to twenty range. WepLab's nearly complete failure with default options was surprising, but a little experimentation resulted in a --perc setting of 95% that rivaled even aircrack's best results. For some data sets, WepLab was more successful than aircrack; for others, aircrack was the winner. Overall, both tools yielded outstanding results with minor tweaking, though aircrack edged out WepLab in the smaller data sets. AirSnort's success rate matched my expectations quite closely, cracking nearly every key with ten million or more packets but failing most of the time when using a smaller data set. AirSnort's speed beat out aircrack and WepLab in every case. Of course, an extra minute or two is rarely a concern, so the superior cracking ability of the KoreK attacks with far less required input puts WepLab and aircrack well above AirSnort in my book. The most unexpected results were the total failures of WEPCrack and dwepcrack with all data sets. WEPCrack came up with as many as eleven out of thirteen correct bytes but always included incorrect bytes in its final result. Lacking a process to verify the correctness of a key, WEPCrack produced a false positive result every time. dwepcrack failed in every case, complaining of either "insufficient ivs," the inexplicable error, "unable to find a valid data packet in logfile," or, for my largest data set, "File too large." As the tests were performed under Linux, perhaps dwepcrack would be more successful in its native BSD environment.
Don't ignore the obvious
The complete toolbox
Concluding part one
Notes:
Tool information and links:
aircrack
- version: 2.1
- sample invocation: aircrack -n 128 packets.pcap
- sample invocation: aircrack -f 4 -n 128 packets.pcap
- source: http://www.cr0.net:8040/code/network/aircrack/
AirSnort
- version: 0.2.6
- sample invocation: airsnort
- 128 bit crack breadth: 2 (default)
- source: http://airsnort.shmoo.com/
Auditor Security Collection
- version: 081004-01
- source: http://remote-exploit.org/?page=auditor [got it]
- download here
dwepcrack
- version: 0.4
- sample invocation: dwepcrack -s -w packets.pcap
- sample invocation: dwepcrack -b packets.pcap
- source: http://www.e.kth.se/~pvz/wifi/
- notes: also tried binary from Auditor Security Collection with identical results
John the Ripper
- version: 1.6
- source: http://www.openwall.com/john/
- wiki : en.wikipedia.org/wiki/John_the_Ripper
Kismet (scanning tool)
- version: Kismet-2004-10-R1
- source: http://www.kismetwireless.net/
WepAttack
- version: 0.1.3
- sample invocation: john -w:words.txt -rules -stdout | wepattack -m n64 -f packets.pcap
- source: http://wepattack.sourceforge.net/
WEPCrack
- version: 0.1.0
- sample invocation: pcap-getIV.pl -b 13 -f packets.pcap; WEPCrack.pl
- source: http://wepcrack.sourceforge.net/
WepLab
- version: 0.1.3
- sample invocation: weplab -rpackets.pcap --key 128 testers.pcap
- sample invocation: john -w:words.txt -rules -stdout | weplab -y --key 64 --attacks 1 testers.pcap
- source: http://weplab.sourceforge.net/
Ideally, the input data sets would come from a variety of source networks with varied hardware and WEP keys. Although the results are not fully comprehensive, the spot checks against various networks generally agree with the test results. |
WEP: Dead Again, Part 2 by Michael OssmannSource. 08/03/2005 New url.
Introduction
Rapid traffic generation
No wireless network based on WEP provides protection against replay attacks. With the right tools, you can take any captured packet and reinject it back onto the network. The packet will be correctly encrypted even though you have no idea of its contents. Then again, you may have a pretty good guess as to its contents based on traffic analysis. You might choose something that is likely to be an ARP request, hoping that it will generate a response from another host on the network. If you're right, you could replay the same packet hundreds or even thousands of times per second, forcing that host to spew an enormous stream of responses, individually encrypted with different IVs. This method described is exactly the method used by aireplay, a tool that comes with aircrack [ref 3]. A screenshot of aireplay is shown below in Figure 1. As we discovered in part one, both aircrack and WepLab [ref 4] are capable of cracking WEP keys after collecting just a few hundred thousand packets. With a successful aireplay attack, you can generate that many packets in just a few minutes. Therefore, people who say that re-keying every 10 minutes makes WEP unbreakable are dead wrong. Per-session, per-user keys also don't stand a chance against this attack. WEP is truly dead. . . again. Figure 1. Aireplay at work.The Auditor Security Collection live cd-rom makes it relatively easy to try aireplay because it includes aircrack's patched hostap driver by default, but you will need two wireless cards with at least several inches distance between their antennas. You may find it easier to use two laptops, one with a Prism2 card to replay captured packets, and a second to capture all the new traffic that is generated. Be prepared to spend some time finding an appropriate packet to replay; you may need to save individual packets with Ethereal and feed them to aireplay. Another tool that implements a similar attack has been around for much longer in the BSD world. Part of OpenBSD's Wnet, reinj performs the same attack as aireplay and does it all with just one Prism2 card (as does the latest beta of aireplay). Whichever tool you use to generate traffic, I recommend WepLab or aircrack for cracking the WEP key.
Encrypted packet injection
Figure 2. Wepwedgie injecting pings. To try out WEPWedgie, you'll need a system running a Linux 2.4 kernel, a Prism2 card, and Abaddon's AirJack [ref 7] driver. Unfortunately the Auditor CD's 2.6 kernel isn't supported by AirJack, so you'll have to prepare a system on your own. You might find the Wi-Fi Dog of War [ref 8] instructions helpful to get AirJack working.
Single packet decryption
Figure 3. Chopchop decrypting a single packet. You can use the Auditor CD and a single Prism2 card to try chopchop. Use the switch-to-wlanng script that Auditor provides, pop the card out and then back in again, and the linux-wlan-ng driver will be working, complete with KoreK's injection modificatios.
The next generation
Conclusion
Tools and links [1] Auditor Security Collection: http://remote-exploit.org/?page=auditor [2] Ethereal: http://www.ethereal.com/ [3] aircrack: http://www.cr0.net:8040/code/network/aircrack/ [4] WepLab: http://weplab.sourceforge.net/ [5] WEPWedgie: http://sourceforge.net/projects/wepwedgie/ [6] Linksys recommends shared key authentication: http://www.linksys.com/splash/wirelessnotes.asp [7] AirJack: http://sourceforge.net/projects/airjack/ [8] Wi-Fi Dog of War Mini How-To: http://www.geekspeed.net/~beetle/download/wifi_dog.html [9] chopchop: http://www.netstumbler.org/showthread.php?t=12489
About the author
|
Voy a poner una recetilla para sacar la clave WEP con Aircrack-ng, como apoyo a Video: hackear WEP en 10 minutos (url bad) (url ok) y Video: hackear WEP en 10 minutos (II), ya que se basan en Aircrack y no en Aircrack-ng, y de paso añadir a la receta la posibilidad de usar Aircrack-ptw.
Los pasos se pondran con ath0, wifi0 y ath1 como interfaces (tarjetas Atheros), sustituyendose para cada caso por la que corresponda.
1. Lo primero tener correctamente instalados los drivers para nuestra tarjeta, para poderla poner en modo monitor e inyectar trafico, esto ya depende del chipset que tenga la tarjeta, en mi caso es Atheros y el driver es MadWifi. Aqui teneis una buena pagina para ver que chipset usa cada tarjeta, asi como el driver, pudiendo filtrar por fabricante, chipset, etc : Linux wireless LAN support
2. Una vez configurada la tarjeta y funcionando, habra que ponerla en modo monitor, normalmente:
en caso de que este método no sirva (con atheros no es valido este metodo):
Esto creara una nueva interfaz ath1 que sera la que usemos a partir de ahora (para otros Drivers/Chipsets la que corresponda). Opcionalmente podemos poner un canal.
3. Ver que redes/clientes hay al alcance; para ello usaremos airodump-ng de la siguiente manera:
De esta forma veremos que redes/clientes hay para todos los canales.
4. Fijamos el objetivo, y miramos su bssid o mac y el canal en el que trabaja; para capturar especificamente para esa red:
Si se quiere restringir la captura a una red determinada, porque hay varias redes en el mismo canal, y queremos que la captura sea solo de una de ellas:
Siendo XX:XX:XX:XX:XX:XX la MAC del AP objetivo y N el canal en el que está. La captura la haremos sin el -ivs, para que guarde los paquetes enteros, con vistas a poder usar aircrack-ptw que necesita que la captura se haga de esta forma.
5. Una vez que tenemos trabajando airodump-ng en un terminal, y tenemos algun cliente conectado a esa red (se ve en airodump-ng), abrimos otro terminal para la inyeccion de paquetes con aireplay:
Siendo XX:XX:XX:XX:XX:XX la MAC del AP objetivo y YY:YY:YY:YY:YY:YY la del cliente conectado a esa red. Ahora deberiamos notar un incremento en la velocidad de captura de datos por parte de airodump-ng, en cuanto aireplay-ng capture y reinyecte paquetes ARP.
6. En cuanto tengamos unos cuantos paquetes capturados (80k-100k segun cada uno) podemos poner a trabajar a aircrack-ng o usar aircrack-ptw que necesita menos datos capturados para sacar la clave.
-i 1 es para decirle que el indice de clave sera 1 (1-4) que es lo normal, esto lo podemos quitar si queremos. Por defecto busca contraseñas de 128bits; si es de 64 tambien la sacara pero tardara algo mas. Si se quiere indicar que la clave es de 64bits, podemos poner el parametro -n 64.
Para aircrack-ptw:
Pues ya esta, esta es la receta. Si todo va bien, tendremos la clave, tanto en Hexadecimal como en ASCII.
Aclaración: las opciones -channel, -bssid y -arpreplay van con doble guión delante (por si no se ve bien).
To display the AP's visible around you, use the command :
To enter WPA key, use
and wpa_supplicant.conf contents is :
The value of psk will need to be modified according to the output of:
The use of a hex psk will speed up association.
aireplay-ng injects specially generated ARP-request packets into an existing wireless network in order to generate traffic. By sending these ARP-request packets again and again, the target host will respond with encrypted replies, thus providing new and possibly weak IVs.
aircrack-ng - a 802.11 WEP / WPA-PSK key cracker
Es millor fer servir aircrack-ptw
Comandes auxiliars : lspci, startx, dmesg, iwlist, yast,
Drivers : T42/Intel BG = ipw2200 (device eth1) ; RAP/Canyon = rt2400 (device ra0) ; T400 = Intel 5100 AGN
Xarxes que veig :
WEP-64 bits => 5 chars alfa, 10 hex; WEP-128 bits => 13 chars alfa, 26 hex.
WifiSlax boot :
A vegades no es deix posar en mode tafaner :
Solucio : fer-ho amb el adaptador apagat.
When we capture it, we shall see:
Tutorial: How to Crack WPA/WPA2
If you want to have an unbreakable wireless network at home, use WPA/WPA2 and a 63 character password composed of random characters including special symbols
Tutorial: How to crack WEP with no wireless clients + "Alternate Solution".
Seguridad Wi-Fi – WEP, WPA y WPA2 : PDF, url.
Diccionaris : Rainbow Tables for WPA-PSK Cracking (33,54 GB)