![]() |
How To Crack WEP and WPA Wireless NetworksCracking WEP, WPA-PSK and WPA2-PSK wireless security using aircrack-ng2008-11-21 (updated: 2013-02-25) by Philip Tags: aircrack, Wireless, Wi-Fi, WPA, WEP, WPA2, NIC, hash, wordlist, security, SSID, channel, crack, hack, reaver, WPS, vulnerability ![]() Introduction With the popularity of wireless networks and mobile computing, an overall understanding of common security issues has become not only relevant, but very necessary for both home/SOHO users and IT professionals alike. This article is aimed at illustrating current security flaws in WEP/WPA/WPA2. Successfully cracking a wireless network assumes some basic familiarity with networking principles and terminology, as well as working with command-line tools. A basic familiarity with Linux can be helpful as well. Disclaimer: Attempting to access a network other than your own, or one you have permission to use is illegal insome U.S. jurisdictions. Speed Guide, Inc. are not to be held liable for any damages resulting from the use or misuse of the information in this article. To successfully crack WEP/WPA, you first need to be able to set your wireless network card in "monitor" mode to passively capture packets without being associated with a network. This NIC mode is driver-dependent, and only a relatively small number of network cards support this mode under Windows. One of the best free utilities for monitoring wireless traffic and cracking WEP/WPA-PSK keys is the aircrack-ng suite, which we will use throughout this article. It has both Linux and Windows versions (provided your network card is supported under Windows). The aircrack-ng site has a comprehensive list of supported network cards available here: NIC chipset compatability list. If your network card is not supported under Windows, one can use a free Linux Live CD to boot the system. BackTrack is probably the most commonly used distribution, since it runs from a Live CD, and has aircrack-ng and a number of related security auduting tools already installed. For this article, I am using aircrack-ng on another Linux distro (Fedora Core) on a Sony Vaio SZ-680 laptop, using the built-in Intel 4965agn network card. If you're using the BackTrack CD aircrack-ng is already installed, with my version of linux it was as simple as finding it with:
The aircrack-ng suite is a collection of command-line programs aimed at WEP and WPA-PSK key cracking. The ones we will be using are:
1. Setup (airmon-ng) As mentioned above, to capture network traffic wihtout being associated with an access point, we need to set the wireless network card in monitor mode. To do that under linux, in a terminal window (logged in as root), type:
Note: You can use the su command to switch to a root account. Other related Linux commands:
2. Recon Stage (airodump-ng) This step assumes you've already set your wireless network interface in monitor mode. It can be checked by executing the iwconfig command. Next step is finding available wireless networks, and choosing your target:
WEP is much easier to crack than WPA-PSK, as it only requires data capturing (between 20k and 40k packets), while WPA-PSK needs a dictionary attack on a captured handshake between the access point and an associated client which may or may not work.
3. Capture Data (airodump-ng) To capture data into a file, we use the airodump-ng tool again, with some additional switches to target a specific AP and channel. Most importantly, you should restrict monitoring to a single channel to speed up data collection, otherwise the wireless card has to alternate between all channels. Assuming our wireless card is mon0, and we want to capture packets on channel 6 into a text file called data:
Notes: You typically need between 20,000 and 40,000 data packets to successfully recover a WEP key. One can also use the "--ivs" switch with the airodump-ng command to capture only IVs, instead of whole packets, reducing the required disk space. However, this switch can only be used if targeting a WEP network, and renders some types of attacks useless.
4. Increase Traffic (aireplay-ng) - optional step for WEP cracking An active network can usually be penetrated within a few minutes. However, slow networks can take hours, even days to collect enough data for recovering the WEP key. This optional step allows a compatible network interface to inject/generate packets to increase traffic on the wireless network, therefore greatly reducing the time required for capturing data. The aireplay-ng command should be executed in a separate terminal window, concurrent to airodump-ng. It requires a compatible network card and driver that allows for injection mode. Assuming your network card is capable of injecting packets, in a separate terminal window try:
Notes: To test whether your nic is able to inject packets, you may want to try: aireplay-ng -9 wlan0. You may also want to read the information available -here-. To see all available replay attacks, type just: aireplay-ng
5. Crack WEP (aircrack-ng) WEP cracking is a simple process, only requiring collection of enough data to then extract the key and connect to the network. You can crack the WEP key while capturing data. In fact, aircrack-ng will re-attempt cracking the key after every 5000 packets. To attempt recovering the WEP key, in a new terminal window, type:
Notes: If your data file contains ivs/packets from different access points, you may be presented with a list to choose which one to recover. Usually, between 20k and 40k packets are needed to successfully crack a WEP key. It may sometimes work with as few as 10,000 packets with short keys.
6. Crack WPA or WPA2 PSK (aircrack-ng) WPA, unlike WEP rotates the network key on a per-packet basis, rendering the WEP method of penetration useless. Cracking a WPA-PSK/WPA2-PSK key requires a dictionary attack on a handshake between an access point and a client. What this means is, you need to wait until a wireless client associates with the network (or deassociate an already connected client so they automatically reconnect). All that needs to be captured is the initial "four-way-handshake" association between the access point and a client. Essentially, the weakness of WPA-PSK comes down to the passphrase. A short/weak passphrase makes it vulnerable to dictionary attacks. To successfully crack a WPA-PSK network, you first need a capture file containing handshake data. This can be obtained using the same technique as with WEP in step 3 above, using airodump-ng. You may also try to deauthenticate an associated client to speed up this process of capturing a handshake, using:
Note the last two numbers in brackets [ 5:62 ACKs] show the number of acknowledgements received from the client NIC (first number) and the AP (second number). It is important to have some number greater than zero in both. If the first number is zero, that indicates that you're too far from the associated client to be able to send deauth packets to it, you may want to try adding a reflector to your antenna (even a simple manilla folder with aluminum foil stapled to it works as a reflector to increase range and concentrate the signal significantly), or use a larger antenna.
Once you have captured a four-way handshake, you also need a large/relevant dictinary file (commonly known as wordlists) with common passphrases. See related links below for some wordlist links. You can, then execute the following command in a linux terminal window (assuming both the dictionary file and captured data file are in the same directory):
Additional Notes: Cracking WPA/WPA2 usually takes many hours, testing tens of millions of possible keys for the chance to stumble on a combination of common numerals or dictionary words. Still, a weak/short/common/human-readable passphrase can be broken within a few minutes using an offline dictionary attack. My record time was less than a minute on an all-caps 10-character passphrase using common words with less than 11,000 tested keys! A modern laptop can process over 10 Million possible keys in less than 3 hours. WPA hashes the network key using the wireless access point's SSID as salt. This prevents the statistical key-grabbing techniques that broke WEP, and makes hash precomputation more dificult because the specific SSID needs to be added as salt for the hash. There are some tools like coWPAtty that can use precomputed hash files to speed up dictionary attacks. Those hash files can be very effective (sicne they're much less CPU intensive and therefore faster), but quite big in size. The Church of WiFi has computed hash tables for the 1000 most common SSIDs against a million common passphrases that are 7Gb and 33Gb in size...
7. Crack WPA using the WPS Vulnerability (Reaver) Many Wi-Fi devices are aslo vulnerable to a WPS (Wi-Fi Protected Setup) vulnerability described in US-CERT TA12-006A Alert. WPS provides simplified mechanisms to secure wireless networks, most often using a PIN as a shared secret to authenticate clients and share the WEP/WPA/WPA2 passwords and keys. The external PIN exchange mechanism is susceptible to brute-force attacks that allow for bypassing wireless security in a relatively short time (few hours). The only remedy is to turn off WPS, or use an updated firmware that specifically addresses this issue. A free Linux open-source tool called Reaver is able to exploit the WPS vulnerability. To launch an attack:
An attack using Reaver typically takes between 4 and 8 hours (provided WPS requests are not being limited by the AP), and returns the SSID, WPS PIN and WPA passphrase for the target network. Note that some routers may lock you out for a few minutes if they detect excessive failed WPS PIN attempts, in such cases it may take over 24 hours. Notes:
Troubleshooting Tips Even with the above tools properly installed, it is common to get a few errors/warnings during the attacks, usually related to timeouts, poor signal, or interface driver not supporting monitor/injection modes. Here are some points to consider: 1. Is your adapter properly set in monitor mode ?
Final Thoughts As demonstrated above, WEP cracking has become increasingly easier over the years, and what used to take hundreds of thousands packets and days of capturing data can be accomplished today within 15 minutes with a mere 20k data frames. Simply put, cracking WEP is trivial. WPA/WPA2-PSK encryption is holding its ground if using a strong, long key. However, weak passphrases are vulnerable to dictionary attacks. WPA/WPA2 may be on borrowed time as well, according to some recent news. The WPS vulnerability renders even WPA/WPA2 secured wireless networks very vulnerable. An extensive list of vulnerable devices is available here: google docs spreadsheet. Note that some routers (including most popular Cisco/Linksys models) will NOT turn off WPS even if turned off via the radio button in their web admin interface. You may be able to turn it off using third-party firmware, such as DD-WRT (which does not support WPS).
Related Links
User Reviews/Comments:
rate:
avg:
![]() ![]() ![]() ![]() ![]() ![]() ![]()
This is informative reading for anybody interested in WiFi security. Thanks for the info - this is not purely useful to people wanting to crack, i'm in the business of securing networks, and trying to break them is the best way to test their resilience.
Does anybody seriously believe that not placing this information on this site will stop hackers?? if you do you need a reality check.
I am using CommView to build packets and create the dump file. I am told I can use aircrack ng GUI.exe to do the actual key cracking but I can not get aircrack to work. The window comes up, I choose my dump file and then hit launch and I get an error msg that the program can not be executed. Any suggestions...Im on Windows 7...THANKS ??
Complaining about free information on the internet is not going to get you far.
The whole reason we actually HAVE decent encryption available to us, is because others have used these techniques, forcing makers to include better encryption systems. Otherwise, you wouldn't KNOW about it (like you do now) but you would be vulnerable to being hacked by those few who DO know about it. The whole point of decent security is that it is regularly tested using all the best tools against it. An analogy would be that if the knowledge that simple locks could be easily bypassed to enter houses was not publicized, then the more secure locks we have nowadays would never be in existence. Hoping no-one will figure out how to break your security, is never going to be as secure as having real security, that has been tested against the best attacks that anyone currently knows.
Dear Philip
I have 2 Zyxel PLA401 powerline adapters connecting a Dlink DSL 2780 router to a EchoLife HG532 router which I have turned into a wireless access point, following these and others' instructions. I have switched off DCHP and WAN on the WAP, and set the WAP static IP address to 192.168.1.2 outside the range of the IP range that the Dlink DCHP router offers. My problem is that the DCHP server will not allocate any IP addresses to any client connected to the WAP, but if I set the clients to static IP addresses, all works fine. Its annoying, since I have Kobo ereaders which will not allow you to create static IP addresses, and the main router is not powerful enough to cover the whole house. Any ideas what might be going wrong? Thank you in advance for your time. Thanks Damian
How to use it in windows 7 i am not able to use any of the above mentioned procedure.
Though i captured packet data using microsoft network monitor in cap format but wasn't able to decode it in aircrack please guide me thorough these problems to succesfull gettin a password of WEP security. Thanking you Anonymous
Well, if you've got a good Router, and all Security enabled on your PC or Network/Firewall, any of these attempts can be blocked... even if some Hacker manages to acquire your SSID and Password/Key for Wifi. Just activate/enable 'Whitelisted Devices only' within your Router settings, while ensuring your Router is hard-wired to your PC... and Admin Functions within Router are set to the hard-wired PC/device only (remote Admin management disabled). Even if someone has your SSID and PW/Key, they can't access your Network unless their Device is authorized on the /Whitelist within your Router Admin Security area. They'd have to physically break-in to your house/building, then somehow log-on to your PC, then know how to log-on to your Router in order to access Admin Functions... and, this is when they get shot or caught on camera/alarm systems (even battery-operated non-Wifi SD card cameras... motion-activated), let alone a hard-wired security-cam/alarm system.
MAC Hardware addresses can be spoofed to mimic your whitelisted ones. It's true that they'd have to know your MAC address, but these days people have a number of WiFi devices with access to network resources, and their hardware id's are easily visible to anyone within range. If you have wired-only admin area that's great, but if they get on your WiFi they may be able to see network shares, install trojans/backdoors on networked PCs, and such.
|