Wlan
Wlan
Wlan
Description
aircrack is the 802.11 WEP and WPA-PSK keys cracking program that can recover this keys once enough encrypted packets have been captured with airodump-ng. This part of the aircrack-ng suite can perform various statistical attacks to discover WEP keys with small amounts of captured data. For cracking WPA-PSK bruteforce and dictionary methods are included.
Screenshot
LEGEND 1 = Keybyte 2 = Depth of current key search 3 = Byte the IVs leaked 4 = Votes indicating this is correct
Usage
aircrack-ng [options] <capture file(s)>
You can specify multiple input files (either in .cap or .ivs format). Also, you can run both airodumpng and aircrack-ng at the same time: aircrack-ng will auto-update when new IVs are available. Heres a summary of all available options: Option Param. -a -e -b -p -q -c -t -h -d amode essid bssid nbcpu none none none none start Description Force attack mode (1 = static WEP, 2 = WPA-PSK). If set, all IVs from networks with the same ESSID will be used. This option is also required for WPA-PSK cracking if the ESSID is not broadcasted (hidden). Select the target network based on the access points MAC address. On SMP systems: # of CPU to use. Enable quiet mode (no status output until the key is found, or not). (WEP cracking) Restrict the search space to alpha-numeric characters only (020 0x7F). (WEP cracking) Restrict the search space to binary coded decimal hex characters. (WEP cracking) Restrict the search space to numeric characters (030-039) These keys are used by default in most Fritz!BOXes. (WEP cracking) Set the beginning the WEP key (in hex), for debugging purposes.
-m
maddr
(WEP cracking) MAC address to filter WEP data packets. Alternatively, specify -m ff:ff:ff:ff:ff:ff to use all and every IVs, regardless of the network. (WEP cracking) Specify the length of the key: 64 for 40-bit WEP, 128 for 104-bit WEP, etc. The default value is 128. (WEP cracking) Only keep the IVs that have this key index (1 to 4). The default behaviour is to ignore the key index. (WEP cracking) By default, this parameter is set to 2 for 104-bit WEP and to 5 for 40-bit WEP. Specify a higher value to increase the bruteforce level: cracking will take more time, but with a higher likelyhood of success. (WEP cracking) There are 17 korek statistical attacks. Sometimes one attack creates a huge false positive that prevents the key from being found, even with lots of IVs. Try -k 1, -k 2, ... -k 17 to disable each attack selectively. (WEP cracking) Disable last keybytes brutforce. (WEP cracking) Enable last keybyte bruteforcing (default). (WEP cracking) Enable last two keybytes bruteforcing. (WEP cracking) Disable bruteforce multithreading (SMP only). (WEP cracking) This is an experimental single bruteforce attack which should only be used when the standard attack mode fails with more than one million IVs (WPA cracking) Path to a wordlist or - without the quotes for standard in (stdin).
-n
nbits
-i
index
-f
fudge
-k
korek
Usage Examples
The simplest case is to crack a WEP key. If you want to try this out yourself, here is a test file. The key to the test file matches the screen image above, it does not match the following example. aircrack-ng 128bit.ivs Where:
If there were multiple networks contained in the file then you are given the option to select which one you want. By default, aircrack-ng assumes 128 bit encryption. The cracking process starts and once cracked, here is what it looks like:
Aircrack-ng 0.7 r130 [00:00:10] Tested 77 keys (got 684002 IVs) KB 0 1 2 3 4 5 6 7 8 9 10 11 depth 0/ 1 0/ 3 0/ 2 0/ 1 0/ 2 0/ 1 0/ 1 0/ 1 0/ 1 0/ 1 0/ 1 0/ 1 byte(vote) AE( 199) 29( 27) 2D( 66( 41) F1( 33) 4C( 5C( 89) 52( 60) E3( FD( 375) 81( 40) 1D( 24( 130) 87( 110) 7B( E3( 222) 4F( 46) 40( 92( 208) 63( 58) 54( A9( 220) B8( 51) 4B( 14(1106) C1( 118) 04( 39( 540) 08( 95) E4( D4( 372) 9E( 68) A0( 27( 334) BC( 58) F1( 13) 23) 22) 26) 32) 45) 51) 41) 41) 87) 64) 44) 7C( 00( 10( 99( 4F( 7F( 64( 1B( 13( E2( 9F( BE( 12) 19) 20) 26) 25) 28) 35) 39) 30) 79) 55) 42) FE( 9F( F3( D2( D7( DB( 51( 3B( 43( E5( DB( 79( 12) 19) 18) 23) 20) 27) 26) 23) 28) 59) 51) 39) FF( C7( 8B( 33( F4( E0( 53( 9B( 99( 0A( 38( 3B( 6) 18) 15) 20) 18) 27) 25) 23) 25) 44) 40) 37) 39( 64( 8E( 2C( 17( 5B( 75( FA( 79( CC( 9D( E1( 5) 9) 15) 19) 15) 25) 20) 23) 20) 35) 40) 34) 2C( 7A( 14( 05( 8A( 71( 0E( 63( B1( 02( 52( E2( 3) 9) 13) 17) 15) 25) 18) 22) 17) 32) 39) 34) 00( 7B( D2( 0B( CE( 8A( 7D( 2D( 86( C7( A1( 31( 0) 9) 11) 17) 15) 25) 18) 19) 15) 31) 38) 33) 08( F6( 47( 35( E1( 65( D9( 1A( 97( 6C( 54( BF( 0) 9) 10) 17) 15) 23) 18) 17) 15) 30) 36) 33)
This key can then be used to connect to the network. Now onto cracking WPA/WPA2 passphrases. Aircrack-ng can crack either types. aircrack-ng -w password.lst *.cap Where:
-w password.lst is the name of the password file. Remember to specify the full path if the file is not located in the same directory. *.cap is name of group of files containing the ivs. Notice in this case that we used the wildcard * to include multiple files.
Notice in this case that since there are multiple networks we need to select which one to attack. We select number 2. The program then responds:
Aircrack-ng 0.7 r130 [00:00:03] 230 keys tested (73.41 k/s) KEY FOUND! [ biscotte ] Master Key : CD D7 9A 5A CF B0 70 C7 E9 D1 02 3B 87 02 85 D6 39 E4 30 B3 2F 31 AA 37 AC 82 5A 55 B5 55 24 EE 55 F9 FB 6F 0B DE 65 76 FC 89 D6 5B 4F 67 13 8C 24 A6 A9 D3 84 6D 9F DF F4 2B 2C 13 9A 8E 65 2F 38 46 E4 BC B3 2C A6 DA D0 07 08 6A 89 47 F2 6E 83 6A 5A D9 D2 CE 67 62 49 08 97 CD
: 52 27 B8 3F 73 7C 45 A0 05 97 69 5C 30 78 60 BD
Usage Tips
How to make guesses for which option to use
Primarily, you just see the beginning of the key: The votes for the first 5 keybytes are very good, so you can assume they are at least 99.5% correct, and these bytes are for example: 75:47:99:22:50 then it is quite obvious, that the whole key may consist only of numbers, like the first 5 bytes, so it MAY improve your cracking speed when using -t option to only try such keys. If the bytes are 37:30:31:33:36 (all numeric) it is sure a good idea to use -h option. And if the first few bytes are something like 74:6F:70:73:65, you enter them in your hexeditor, and you see, this could be the beginning of some word, then it seems like an ASCII key is used, thus you activate -c option to check only printable ASCII keys.
Other Tips
To specify multiple multiple files at a time you can either use a wildcard such as * or specify each file individually. IE aircrack-ng -w password.lst wpa.cap wpa2.eapol.cap Determining the WPA/WPA2 passphrase is totally dependent on finding a dictionary entry which matches the passphrase. So a quality dictionary is very important. You can search the Internet for dictionaries to be used. There are many available. As you have seen, if there are multiple networks in your files you need to select which one you want to crack. Instead of manually do a selection, you can specify which network you want by essid or bssid on the command line. This is done with the -e or -b parameters. Another trick is to use John the Ripper to create a specific passwords for testing. Lets say you know the passphrase is the street name plus 3 digits. Create a custom rule set in JTR and run something like this:
john --stdout --wordlist=specialrules.lst --rules | aircrack-ng -e test -a 2 -w - /root/capture/wpa.cap
Usage Troubleshooting
Error message Please specify a dictionary (option -w): This means you have mispelt the file name of the dictionary or it is not in the current directory. If the dictionary is located in another directory, you must provide the full path to the dictionary.
Airdecap-ng
Description
With airdecap-ng you can decrypt WEP/WPA/WPA2 capture files. As well, it can be used to strip the wireless headers from an unencrypted wireless capture.
Usage
airdecap-ng [options] <pcap file>
Description dont remove the 802.11 header access point MAC address filter WPA/WPA2 Pairwise Master Key in hex target network ascii identifier target network WPA/WPA2 passphrase target network WEP key in hexadecimal
Usage Examples
The following removes the wireless headers from an open network (no WEP) capture:
airdecap-ng -b 00:09:5B:10:BC:5A open-network.cap
Usage Tips
For ESSIDs which contain spaces, put the ESSID in quotes: this contains spaces.
Usage Troubleshooting
None at this time.
Airmon-ng
Description
This script can be used to enable monitor mode on wireless card interfaces. It may also be used to shut down (stop) interfaces as well. Entering the airmon-ng command without parameters will show the interface status.
Usage
usage: airmon-ng <start|stop> <interface> [channel] Where:
<start|stop> indicates if you wish to start or stop the interface. (Mandatory) <interface> specifies the interface. (Mandatory) [channel] optionally set the card to a specific channel.
Usage Examples
Typical Uses
To start wlan0 in monitor mode: airmon-ng start wlan0 To start wlan0 in monitor mode on channel 8: airmon-ng start wlan0 8 To stop wlan0: airmon-ng stop wlan0 To check the status: airmon-ng
If you want to use ath0 (which is already used): airmon-ng stop ath0 And the system will respond:
Interface wifi0 ath0 Chipset Atheros Atheros Driver madwifi-ng madwifi-ng VAP (parent: wifi0) (VAP destroyed)
You can see ath0 is gone. To start ath0 in monitor mode: airmon-ng start wifi0 System responds:
Interface wifi0 ath0 Chipset Atheros Atheros Driver madwifi-ng madwifi-ng VAP (parent: wifi0) (monitor mode enabled)
You can see ath0 is in monitor mode. If ath1/ath2 etc. is running then stop them first prior to all the commands above:
airmon-ng stop ath1
You can set the channel number by adding it to the end: airmon-ng start wifi0 9
Usage Tips
To confirm that the card is in monitor mode, run the command iwconfig. You can then confirm the mode is monitor and the interface name. For the madwifi-ng driver, the access point field from iwconfig shows your the MAC address of the wireless card. To determine the current channel, enter iwlist <interface name> channel. If you will be working with a specific access point, then the current channel of the card should match that of the AP. In this case, it is a good idea to include the channel number when running the initial airmon-ng command.
Usage Troubleshooting
Nothing at this time.
Aireplay-ng
Description
Aireplay-ng is used to inject frames. The primary function is to generate traffic for the later use in aircrack-ng for cracking the WEP and WPA-PSK keys. There are different attacks which can cause deauthentications for the purpose of capturing WPA handshake data, fake authentications, Interactive packet replay, hand-crafted ARP request injection and ARP-request reinjection. With the packetforge-ng tool its possible to create arbitrary ARP request frames. Most drivers needs to be patched to be able to inject, dont forget to read Installing drivers.
0: 1: 2: 3: 4: 5:
Deauthentication Fake authentication Interactive packet replay ARP request replay attack KoreK chopchop (CRC prediction) Fragmentation
Can obtain the full packet length of 1500 bytes xor. This means you can subsequently pretty well create any size of packet. Even in cases where less then 1500 bytes are collected, there is sufficient to create ARP requests. May work where chopchop does not. Is extremely fast. It yields the xor stream extremely quickly when successful.
Cons
Need more information to launch it - IE IP address info. Quite often this can be guessed. Better still, aireplay-ng assumes source and destination IPs of 255.255.255.255 if nothing is specified. This will work successfully on most APs. So this is a limited con. Setup to execute the attack is more subject to the device drivers. For example, Atheros does not generate the correct packets unless the wireless card is set to the mac address you are spoofing. You need to be physically closer to the access point since if any packets are lost then the attack fails.
Chopchop Pros
May work where fragmentation does not work. You dont need to know any IP information.
Cons
Cannot be used against every access point. The maximum xor bits is limited to the length of the packet you chopchop against. Much slower then the fragmentation attack
Usage Troubleshooting
This item applies to all modes of aireplay-ng. Make sure there are no other VAPs running. There can be issues when creating a new VAP in monitor mode and there was an existing VAP in managed mode. You should first stop ath0 then start wifi0:
airmon-ng stop ath0 airmon-ng start wifi0
or
wlanconfig ath0 destroy wlanconfig ath create wlandev wifi0 wlanmode monitor
Deauthentication
Description
This attack sends disassocate packets to one or more clients which are currently associated with a particular access point. Disassociating clients can be done for a number of reasons:
Recovering a hidden ESSID. This is an ESSID which is not being broadcast. Another term for this is cloaked. Capturing WPA/WPA2 handshakes by forcing clients to reauthenticate Generate ARP requests (Windows clients sometimes flush their ARP cache when disconnected)
Of course, this attack is totally useless if there are no associated wireless clients.
Usage
aireplay-ng -0 1 -a 00:14:6C:7E:40:80 -c 00:0F:B5:34:30:30 ath0
Where:
-0 means deauthentication 1 is the number of deauths to send (you can send muliple if you wish); 0 means send them continuously -a 00:14:6C:7E:40:80 is the MAC address of the access point -c 00:0F:B5:34:30:30 is the MAC address of the client to deauthenticate; if this is omitted then all clients are deauthenticated ath0 is the interface name
Usage Examples
Typical Deauthentication
First, you determine a client which is currently connected. You need the MAC address for the following command: aireplay-ng -0 1 -a 00:14:6C:7E:40:80 -c 00:0F:B5:34:30:30 ath0 Where:
-0 means deauthentication 1 is the number of deauths to send (you can send muliple if you wish) -a 00:14:6C:7E:40:80 is the MAC address of the access point -c 00:0F:B5:34:30:30 is the MAC address of the client you are deauthing ath0 is the interface name
Here the explaination of the above commands: airodump-ng -c 6 bssid 00:14:6C:7E:40:80 -w out ath0 Where:
-c 6 is the channel to listen on bssid 00:14:6C:7E:40:80 limits the packets collected to this one access point -w out is the file prefix of the file name to be written ath0 is the interface name
-0 means deauthentication attack 5 is number of groups of deauthentication packets to send out -a 00:14:6C:7E:40:80 is MAC address of the access point -c 00:0F:B5:AB:CB:9D is MAC address of the client to be deauthenticated ath0 is the interface name
Here is what the output looks like from aireplay-ng -0 5 -a 00:14:6C:7E:40:80 -c 00:0F:B5:AB:CB:9D ath0
12:55:56 12:55:56 12:55:57 12:55:58 12:55:58 Sending Sending Sending Sending Sending DeAuth DeAuth DeAuth DeAuth DeAuth to to to to to station station station station station -----STMAC: STMAC: STMAC: STMAC: STMAC: [00:0F:B5:AB:CB:9D] [00:0F:B5:AB:CB:9D] [00:0F:B5:AB:CB:9D] [00:0F:B5:AB:CB:9D] [00:0F:B5:AB:CB:9D]
After sending the ten batches of deauthentication packets, we start listening for ARP requests with attack 3. The -h option is mandatory and has to be the MAC address of an associated client. If the driver is wlan-ng/, you should run the airmon-ng script (unless you know what to type) otherwise the card wont be correctly setup for injection.
Usage Tips
It is usually more effective to target a specific station using the -c parameter. The deauthentication packets are sent directly from your PC to the clients. So you must be physically close enough to the clients for your wireless card transmissions to reach them.
Usage Troubleshooting
None at this time.
Fake authentication
This attack is only useful when you need an associated MAC address in attacks 2, 3, 4 (-h option) and there is currently no associated client. However it is genereally better to use the MAC address of a real client (like here, 00:09:5B:EB:C5:2B) in attacks 2, 3 and 4. The fake auth attack does NOT generate ARP requests. Also, subsequent attacks will likely perform better if you update the MAC address of the card, so that it properly sends ACKs:
ifconfig ath0 down ifconfig ath0 hw ether 00:11:22:33:44:55 ifconfig ath0 up aireplay-ng -1 0 -e 'the ssid' -a 00:13:10:30:24:9C -h 00:11:22:33:44:55 ath0 12:14:06 Sending Authentication Request 12:14:06 Authentication successful 12:14:06 Sending Association Request 12:14:07 Association successful :-)
With patched madwifi-old CVS 2005-08-14, its possible to inject packets while in Managed mode (the WEP key itself doesnt matter, as long as the AP accepts Open-System authentication). So, instead of running attack 1, you may just associate and inject / monitor through the athXraw interface:
ifconfig ath0 down hw ether 00:11:22:33:44:55 iwconfig ath0 mode Managed essid 'the ssid' key AAAAAAAAAA ifconfig ath0 up sysctl -w dev.ath0.rawdev=1 ifconfig ath0raw up airodump-ng ath0raw out 6
Then you can run attack 3 or 4 (aireplay-ng will automatically replace ath0 with ath0raw below):
aireplay-ng -3 -h 00:11:22:33:44:55 -b 00:13:10:30:24:9C ath0 aireplay-ng -4 -h 00:10:20:30:40:50 -f 1 ath0
Some access points require to reassociate every 30 seconds, otherwise our fake client is considered disconnected. In this case, setup the periodic re-association delay:
aireplay-ng -1 30 -e 'the ssid' -a 00:13:10:30:24:9C -h 00:11:22:33:44:55 ath0
If this attacks seems to fail (aireplay-ng keeps sending authentication requests), MAC address filtering may be in place. Also make sure that:
The driver is properly patched and installed. The card is configured on the same channel as the AP. The BSSID and ESSID (-a / -e options) are correct. If Prism2, make sure the firmware was updated.
You can also use attack 2 to manually replay WEP-encrypted ARP request packets, which size is either 68 or 86 bytes (depending on the operating system):
aireplay-ng -2 -b 00:13:10:30:24:9C -d FF:FF:FF:FF:FF:FF -m 68 -n 68 -p 0841 -h 00:09:5B:EB:C5:2B ath0 aireplay-ng -2 -b 00:13:10:30:24:9C -d FF:FF:FF:FF:FF:FF -m 86 -n 86 -p 0841 -h 00:09:5B:EB:C5:2B ath0
Another good idea is to capture some traffic and then have a look at it with Wireshark. If two packets are looking like a request and a response (One client sends a packet and very short time later the receiver is answering to it) then it is a good idea to try to reinject the request packet to get answers.
Usage
Basic usage:
aireplay-ng -3 -b 00:13:10:30:24:9C -h 00:11:22:33:44:55 ath0
Where:
-3 means standard arp request replay -b 00:13:10:30:24:9C is the access point MAC address -h 00:11:22:33:44:55 is the source MAC address (either an associated client or from fake authentication) ath0 is the wireless interface name
Replaying a previous arp replay. This is a special case of the interactive packet replay attack. It is present here since it is complementary to the ARP requeste replay attack.
aireplay-ng -2 -r replay_arp-0219-115508.cap ath0
Where:
-2 means interactive frame selection -r replay_arp-0219-115508.cap is the name of the file from your last successful ARP replay
Usage Example
For all of these examples, use airmon-ng to put your card in monitor mode first. You cannot inject packets unless it is in monitor mode. For this attack, you need either the MAC address of an associated client , or a fake MAC from attack 1. The simplest and easiest way is to utilize the MAC address of an associated client. This can be obtain via airodump-ng. The reason for using an associated MAC address is that the access point will only accecpt and repeat packets where the sending MAC address is associated. You may have to wait for a couple of minutes, or even longer, until an ARP request shows up. This attack will fail if there is no traffic. Enter this command:
aireplay-ng -3 -b 00:14:6c:7e:40:80 -h 00:0F:B5:88:AC:82 ath0
Then when the attack is in progress, the zeroes show the actual counts as in the full sample above. You can also confirm this by running airodump-ng to capture the IVs being generated. It should show the data count increasing rapidly for the specific access point. The second example we will look at is reusing the captured ARP from the example above. You will
notice that it said the ARP requests were being saved in replay_arp-0219-123051.cap. So rather then waiting for a new ARP, we simply reuse the old ones with the -r parameter:
aireplay-ng -2 -r replay_arp-0219-123051.cap ath0
At this point, if you have not already done so, start airmon-ng to capture the IVs being generated. They data count should be inscreasing rapidly.
Usage Tips
When you are testing at home, to generate an ARP packet to initiate the ARP injection, simply ping a non-existent IP on your network.
Usage Troubleshooting
See Tutorial: I am injecting but the IVs don't increase!
KoreK chopchop
This attack, when successful, can decrypt a WEP data packet without knowing the key. It can even work against dynamic WEP. This attack does not recover the WEP key itself, but merely reveals the plaintext. However, some access points are not vulnerable at all. Some may seem vulnerable at first but actually drop data packets shorter that 60 bytes. If the access point drops packets shorter than
42 bytes, aireplay tries to guess the rest of the missing data, as far as the headers are predictable. If an IP packet is captured, it additionally checks if the checksum of the header is correct after guessing the missing parts of it. This attack requires at least one WEP data packet. 1. First, we decrypt one packet
aireplay-ng -4 ath0
If this isnt successful, in most cases the access point just drops the data because it does not know the MAC which is sending it. In this case we have to use the MAC adress of a connected client which is allowed to send data over the network:
aireplay-ng -4 -h 00:09:5B:EB:C5:2B ath0
3. Then, forge an ARP request The source IP (192.168.1.100) doesnt matter, but the destination IP (192.168.1.2) must respond to ARP requests. The source MAC must belong to an associated station, in case the access point is filtering unauthenticated traffic.
packetforge-ng replay_dec-0627-022301.xor 1 00:13:10:30:24:9C 00:09:5B:EB:C5:2B 192.168.1.100 192.168.1.2 arp.cap
See ChopchopTheory
Fragmentation Attack
Description
This attack, when successful, can obtain 1500 bits of PRGA (pseudo random generation algorithm). This attack does not recover the WEP key itself, but merely obtains the PRGA. The PRGA can then be used to generate packets with packetforge-ng which are in turn used for various injection attacks. It requires at least one data packet needs to be received from the access point in order to initiate the attack. Basically, the program obains a small amount of keying material from the packet then attempts to send ARP and/or LLC packets with known content to the access point (AP). If the packet is successfully echoed back by the AP then a larger amount of keying information can be obtained from the returned packet. This cycle is repeated a several times until 1500 bits of PRGA are obtained or sometimes less then 1500 bits. The original paper by Andrea Bittau at http://www.toorcon.org/2005/slides/abittau/paper.pdf provides a much more detailed technical description of the technique.
Usage
aireplay-ng -5 -b 00:14:6C:7E:40:80 -h 00:0F:B5:AB:CB:9D ath0 Where:
-5 means run the fragmentation attack -b 00:14:6C:7E:40:80 is access point MAC address -h 00:0F:B5:AB:CB:9D is source MAC address of the packets to be injected ath0 is the interface name
-b bssid : MAC address, Access Point -d dmac : MAC address, Destination -s smac : MAC address, Source -m len : minimum packet length -n len : maximum packet length -u type : frame control, type field -v subt : frame control, subtype field -t tods : frame control, To DS bit -f fromds : frame control, From DS bit -w iswep : frame control, WEP bit
-k IP : set destination IP in fragments - defaults to 255.255.255.255 -l IP : set source IP in fragments - defaults to 255.255.255.255
Usage Example
Notes:
The source MAC address used in the attack must be associated with the access point. To do this, you can use fake authentication or use a MAC address of existing wireless client. For madwifi-ng drivers (Atheros chipset), you must change MAC address of your card to the MAC address you will injecting with otherwise the attack will not work.
Essentially you start the attack with the following command then select the packet you want to try:
aireplay-ng -5 -b 00:14:6C:7E:40:80 -h 00:0F:B5:AB:CB:9D ath0 Waiting for a data packet... Read 96 packets... Size: 120, FromDS: 1, ToDS: 0 (WEP) BSSID Dest. MAC Source MAC 0x0000: 0x0010: 0x0020: 0x0030: 0x0040: 0x0050: 0x0060: 0x0070: = = = 00:14:6C:7E:40:80 00:0F:B5:AB:CB:9D 00:D0:CF:03:34:8C 0201 cf03 b1e0 2a70 f7f3 66a2 1544 933f 000f 348c 92a8 49cf 5953 030f bd82 af2f b5ab e0d2 039b eef8 1234 472d ad77 740e cb9d 4001 ca6f f9b9 5727 2682 fe9a 0014 0000 cecb 279c 146c 3957 cd99 6c7e 2b62 5364 9020 eeaa 8429 a43c 4080 7a01 6e16 30c4 a594 9ca5 52a1 .B..........l~@. ....4...@...+bz. mm.......o..Sdn. ..*pI.....'.. 0. p...YS.4W'.l.... .Uf...G-&.9W.).. Q.D...w.....<R. ...?./t.
You have successfully obtained the PRGA which is stored in the file named by the program. You can now use packetforge-ng to generate one or more packets to be used for various injection attacks.
Packetforge-ng
Description
The purpose of packetforge-ng is to create encrypted packets that can subsequently be used for injection. You may create various types of packets such as arp requests, UDP, ICMP and custom packets. The most common use is to create ARP requests for subsequent injection. To create an encrypted packet, you must have a PRGA (pseudo random genration algorithm) file. This is used to encrypt the packet you create. This is typically obtained from aireplay-ng chopchop or fragmentation attacks.
Usage
Usage: packetforge-ng <mode> <options>
Forge options:
-p <fctrl> : set frame control word (hex) -a <bssid> : set Access Point MAC address -c <dmac> : set Destination MAC address -h <smac> : set Source MAC address -j : set FromDS bit -o : clear ToDS bit -e : disables WEP encryption -k <ip[:port]> : set Destination IP [Port] -l <ip[:port]> : set Source IP [Port] -t ttl : set Time To Live -w <file> : write packet to this pcap file
Source options:
-r <file> : read packet from this raw file -y <file> : read PRGA from this file
Modes:
arp : forge an ARP packet (-0) udp : forge an UDP packet (-1) icmp : forge an ICMP packet (-2) custom : build a custom packet (-9)
Usage Example
Here is an example of how to generate an arp request packet. First, obtain a xor file (PRGA) with either the aireplay-ng chopchop or fragmentation method. Then use the following command:
packetforge-ng -0 -a 00:14:6C:7E:40:80 -h 00:0F:B5:AB:CB:9D -k 192.168.1.100 -l 192.168.1.1 -y fragment0124-161129.xor -w arp-request
Where:
-0 indicates you want a arp request packet generated -a 00:14:6C:7E:40:80 is the Access Point MAC address -h 00:0F:B5:AB:CB:9D is the source MAC address you wish to use -k 192.168.1.100 is the destination IP. IE In an arp it is the Who has this IP -l 192.168.1.1 is the source IP. IE In an arp it is the Tell this IP -y fragment-0124-161129.xor -w arp-packet
Assuming you are experimenting with your own access point, arp request packet generated above can be decrypted with your own key. So to see that packet we just created can be decrypted: Enter airdecap-ng -w <access point encryption key> arp-request The results look like this:
Total number of packets read Total number of WEP data packets Total number of WPA data packets Number of plaintext data packets Number of decrypted WEP packets Number of decrypted WPA packets 1 1 0 0 1 0
To view the packet that was just decrypted, enter tcpdump -n -vvv -e -s0 -r arp-request-dec The results look like this:
reading from file arp-request-dec, link-type EN10MB (Ethernet) 18:09:27.743303 00:0f:b5:ab:cb:9d > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 192.168.1.100 tell 192.168.1.1
Which is exactly what we expected. Now you can inject this arp request packet as follows aireplayng -2 -r arp-request ath0.
Use this packet ? y Saving chosen packet in replay_src-0124-163529.cap You should also start airodump-ng to capture replies. End of file.
By entering y above, the packet you created with packetforge-ng is then injected.
Usage Tips
Most access points really dont care what IPs are used for the arp request. So as a result you can use 255.255.255.255 for source and destination IPs. So the packetforge-ng command becomes:
packetforge-ng -0 -a 00:14:6C:7E:40:80 -h 00:0F:B5:AB:CB:9D -k 192.168.1.100 -l 192.168.1.1 -y fragment0124-161129.xor -w arp-request
Usage Troubleshooting
A common mistake people make is to include either or both -j and -o flags and create invalid packets. These flags adjust the FromDS and ToDS flages in the packet generated. Unless you are doing something special and really know what you are doing, dont use them. In general, they are not needed.
Airtun-ng
Description
Airtun-ng is a virtual tunnel interface creator. There are two basic functions:
Allow all encrypted traffic to be monitored for wireless Intrusion Detection System (wIDS) purposes. Inject arbitrary traffic into a network.
In order to perform wIDS data gathering, you must have the encryption key and the bssid for the network you wish to monitor. Airtun-ng decrypts all the traffic for the specific network and passes it to a traditional IDS system such as snort.
Traffic injection can be two bidirectional if you have the full encyption key. It is outgoing unidirectional if you have the PRGA obtained via chopchop or fragmentation attacks. The prime advantage of airtun-ng over the other injection tools in the aircrack-ng suite is that you may use any tool subsequently to create, inject or sniff packets. Airtun-ng only runs on linux platforms.
Usage
usage: airtun-ng <options> <replay interface>
-x nbpps : maximum number of packets per second (optional) -a bssid : set Access Point MAC address (mandatory) -i iface : capture packets from this interface (optional) -y file : read PRGA from this file (optional / one of -y or -w must be defined) -w wepkey : use this WEP-KEY to encrypt packets (optional / one of -y or -w must be defined) -t tods : send frames to AP (1) or to client (0) (optional / defaults to 0)
Scenarios
wIDS
The first scenario is wIDS. Start your wireless card in monitor mode then enter:
airtun-ng -a 00:14:6C:7E:40:80 -w 1234567890 ath0
Where:
-a 00:14:6C:7E:40:80 is the MAC address of the access point to be monitored -w 1234567890 is the encryption key ath0 is the interface currently running in monitor mode
You notice above that it created the at0 interface. Switch to another console sesssion and you must now bring this interface up in order to use it:
ifconfig at0 up
This interface (at0) will receive a copy of every wireless network packet. The packets will have been decrypted with the key you have provided. At this point you may any tool to sniff and analyze the traffic. For example, tcpdump or snort.
WEP injection
The next scenario is where you want to inject packets into the network. Do exactly the same steps as in the first scenario except define a valid IP address for the network when you bring the at0 interface up:
You can confirm this by entering ifconfig at0 and checking the output.
at0 Link encap:Ethernet HWaddr 36:CF:17:56:75:27 inet addr:192.168.1.83 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::34cf:17ff:fe56:7527/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:192 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:500 RX bytes:25113 (24.5 KiB) TX bytes:516 (516.0 b)
At this point you can use any tool you want and send traffic via the at0 interface to wireless clients. Please note by default the FromDS flag is set. Meaning packets are flagged as going to the wireless clients. If you wish to communicate via the AP or wired clients, specify the option -t 1 when you start airtun-ng. IMPORTANT NOTE: The normal rules apply to injection here as well. For example, being associated with the AP, having the wireless card MAC match the injected source, etc. You have to remember to also set the at0 MAC address. An interesting use of this scenario is that it allows you to use a WEP encrypted network with a driver that supports injection, but no WEP encryption, as not all drivers support 256bit wep or 512bit WEP keys or WPA (once it is implemented) and so on.
PRGA injection
The next scenario is where you want to inject packets into the network but do not have the full WEP key. You only have the PRGA obtain via a chopchop or fragmentation attack. In this case you may only inject packets outbound. There is no way to decrypt inbound packets since you do not have the full WEP key. Start your wireless card in monitor mode then enter:
airtun-ng -a 00:14:6C:7E:40:80 -y fragment-0124-153850.xor ath0
Notice that the PRGA files was specified via the -y option. The system responds (notice it correctly states no reception):
created tap interface at0 WEP encryption by PRGA specified. No reception, only sending frames through ath0. FromDS bit set in all frames.
From here you can define a valid IP address for the network when you bring the at0 interface up:
ifconfig at0 192.168.1.83 netmask 255.255.255.0 up
You can confirm this by entering ifconfig at0. Again, at this point you can use any tool you want and send traffic via the at0 interface to wireless clients.
So youll get two tunnel interfaces (at0 and at1), each pointing to another AP. if they dont use the same private subnet range, then you can use them at the same time. IE You are connected to more than one AP. In theory, you could do this for even more then two APs, but the quality of the link would be even worse when hopping on 3 channels.
Usage Tips
This tool is extremely powerful and utilizes advanced concepts. Please make sure you have built your knowledge and experience with the other tools in the aircrack-ng suite prior to using it.
Usage Troubleshooting
Windows platforms - I cant find the airtun-ng tool!. Answer: airtun-ng only runs on linux.
Tools
WZCook
It recovers WEP keys from XPs Wireless Zero Configuration utility. This is experimental software, so it may or may not work depending on your Service Pack level. WZCOOK can also display the PMK (Pairwise Master Key), a 256-bit value which is the result of the passphrase hashed 8192 times together with the ESSID and the ESSID length. The passphrase itself cant be recovered however, knowing the PMK is enough to connect to a WPA-protected wireless network with wpa_supplicant (see the Windows README). Your wpa_supplicant.conf configuration file should look like:
network={ ssid="my_essid" pmk=5c9597f3c8245907ea71a89d[...]9d39d08e
If you dont use WZC service, but you use USR Utility, get this registry value and try it here:
HKey_Current_User/Software/ACXPROFILE/profilename/dot11WEPDefaultKey1
ivstools
This tool handle .ivs files. You can either merge or convert them.
Merge
Use merge option to merge multiple .ivs files. Example:
ivstools --merge dump1.ivs dump2.ivs dump3.ivs out.ivs
It will merge dump1.ivs, dump2.ivs and dump3.ivs into out.ivs. You can merge more than 2 files, output file must be the last argument. Note: aircrack-ng is able to open multiple files (pcap or ivs)
Convert
Use convert option to convert a pcap file (by default, they have .cap extension) to a .ivs file. Example:
ivstools --convert out.cap out.ivs
It will save out.cap IVs to out.ivs Note: Kismet produce pcap files (the extension is .dump), that can be converted WARNING: pcap2ivs from aircrack, and aircrack-ng up to v0.2.1 have a bug which creates broken captures. You should not use pcap2ivs from those versions. If you have a broken IVs file from using the broken versions, then try using FixIvs to recover it.
FAQ
What tutorials are available ?
The Tutorials page has many tutorials specific to the aircrack-ng suite. If your question is not answered on this FAQ page, be sure to check out these other resources:
Open System Authentication: This is the default mode. All clients are accepted by the AP, and the key is never checked meaning association is always granted. However if your key is incorrect you wont be able to receive or send packets (because decryption will fail), so DHCP, ping etc. will timeout. Shared Key Authentication: The client has to encrypt a challenge before association is granted by the AP. This mode is flawed and leads to keystream recovery, so its never enabled by default.
The NetGear Wireless Basics Manual has a good description of WEP Wireless Security including diagrams of the packet flows.
Actually, TKIP (WPA1) is not vulnerable: for each packet, the 48-bit IV is mixed with the 128-bit pairwise temporal key to create a 104-bit RC4 key, so theres no statistical correlation at all. Furthermore, WPA provides counter-measures against active attacks (traffic reinjection), includes a stronger message integrity code (michael), and has a very robust authentication protocol (the 4-way handshake). The only vulnerability so far is a dictionnary attack, which fails if the passphrase is robust enough. WPA2 (aka 802.11i) is exactly the same as WPA1, except that CCMP (AES in counter mode) is used instead of RC4 and HMAC-SHA1 is used instead of HMAC-MD5 for the EAPOL MIC. Bottom line, WPA2 is a bit better than WPA1, but neither are going to be cracked in the near future.
http://ftp.se.kde.org/pub/security/tools/net/Openwall/wordlists/ ftp://ftp.ox.ac.uk/pub/wordlists/
It will merge test1.cap, test2.cap and test3.cap into out.cap You may use the ivstools program to merge .ivs files (part of aircrack-ng package)
Be aware that the example above does not work with every driver. The easier way is to use the macchanger package. The documentation and download is at: http://www.alobbs.com/macchanger This link tends to be slow or not answer. You can do an Internet search for macchanger or here are some alternate links:
Here are scripts which use the macchanger package and work well with madwifi-ng drivers: Script 1 - Invoked with macc.sh XX:XX:XX:XX:XX:XX
#!/bin/sh cardctl eject cardctl insert wlanconfig ath0 destroy ifconfig wifi0 up ifconfig wifi0 down macchanger wifi0 -m $1 wlanconfig ath0 create wlandev wifi0 wlanmode monitor
Script 2
#!/bin/sh # Change the following variables to match your requirements FAKEMAC="00:14:6C:71:41:32" IFACE="ath0" WIFACE="wifi0" # # The interface is brought up and down twice otherwise # it causes a system exception and the system freezes # ifconfig $IFACE down wlanconfig $IFACE destroy wlanconfig $IFACE create wlandev $WIFACE wlanmode monitor ifconfig $IFACE up ifconfig $IFACE down macchanger $WIFACE -m $FAKEMAC wlanconfig $IFACE destroy wlanconfig $IFACE create wlandev $WIFACE wlanmode monitor ifconfig $IFACE up ifconfig $IFACE iwconfig echo " " echo "The wireless card MAC has been set to $FAKEMAC" echo " "
macmakeup Technitium MAC Address Changer ChangeMacAddress (There is cost for this product)
Troubleshooting Tip: A normal MAC address looks like this: 00:09:5B:EC:EE:F2. The first half (00:09:5B) of each MAC address is the manufactuer. The second half (EC:EE:F2) is unique to each network card. Many access points will ignore invalid MAC addresses. So make sure to use a valid wireless card manufacturer code when you make up MAC addresses. Otherwise your packets may be ignored.
DSSS / CCK 1M, 2M, 5.5M, 11M OFDM (a/g) 6M, 9M, 12M, 24M, 36M, 48M, 54M
How can I force loading of the orinoco driver instead of Hostap or force Hostap/wlan-ng instead of orinoco ?
You have to edit pcmcia-cs configs. See /etc/pcmcia/config and related files in that directory. Example (force HostAP instead of orinoco):
Find your cards name. In my case a DWL-650. If you dont find it, find a card that has the same pciid of yours (you can also add an entry in config.opts if you want to do it cleanly) In bind, replace orinoco_cs by hostap_cs Save changes and close the file Unplug all pcmcia cards using cardctl eject Restart pcmcia service
/etc/init.d/pcmcia restart
Your card cannot inject packets (see Install drivers) Bad driver (try reinstalling them. BTW, upgrade them to the latest version) Driver not patched (also see Install drivers). Pay attention, drivers given with your distro are NOT patched. Youre too far, the access point or the client cannot get your packets Signal is too weak (dont forget that WiFi uses radio waves) The client or the access point is protected
You are standing too far from the access point. There is no traffic on the target wireless network. There is some G traffic but youre capturing in B mode. Something is wrong with your card (firmware problem ?) By the way, beacons are just unencrypted announcement packets. Theyre totally useless for WEP cracking.
Be closer (but not too much, it will be explained later) to the Access Point. Decrease the speed for injection and/or the bitrate with which your card is operating. (iwconfig <interface> rate 1M) Your driver may be not patched or not up to date. You should always take the latest CVS/SVN revision if it exist (see Drivers). See also previous question.
I have more than one million IVs, but aircrack-ng doesn't find the key !
Possible reasons:
Out of luck: you must capture more IVs. Usually, 104-bit WEP can be cracked with about one million IVs, but sometimes more IVs are needed. If all votes seem equal, or if there are many negative votes, then the capture file is corrupted, or the key is not static (EAP/802.1X in use ?). A false positive prevented the key from being found. Try to disable each korek attack (-k 1 .. 17), raise the fudge factor (-f) or try the experimental bruteforce attacks (-x / -y).
Also, it can be a firmware problem. Old firmwares have trouble with test mode 0x0A (used by the HostAP / wlan-ng injection patches), so make sure yours is up to date (see Prism2 flashing for instructions). The recommended station firmware version is 1.7.4. If it doesnt work well (kismet or airodump-ng stalls after capturing a couple of packets), try STA 1.5.6 instead (either s1010506.hex for old Prism2 cards, or sf010506.hex for newer ones). On a side note, test mode 0x0A is somewhat unstable with wlan-ng. If the card seems stuck, you will have to reset it, or use HostAP instead. Injection is currently broken on Prism2 USB devices with wlan-ng.
I have an Atheros card, and the madwifi patch crashes the kernel / aireplay-ng keeps saying enhanced RTC support isn't available
There are quite a few problems with some versions of the Linux 2.6 branch (especially before 2.6.11 was released) that will cause a kernel panic when injecting with madwifi. Also, on many 2.6 kernels enhanced RTC support is just broken. Thus, is it highly recommended to use either Linux 2.6.11.x or newer.
Why do I have bad speeds when i'm too close to the access point?
Problem: The wireless card behaves badly if the signal is too strong. If Im too close (1-2m) to the access point, I get high quality signal but actual transmission rates drop (down to 5-11Mbps or less). The net result is TCP throughput of about 600KB/s. This is called antenna and receiver saturation. The signal coming in to the preamplifier is too strong and clips the input of the amplifier, causing signal degradation. This is a normal phenomenon with most 802.11 hardware.
Why when i use aircrack-ng over a .ivs file i get lots of random BSSID ?
If the .ivs file was generated using pcap2ivs from aircrack (any version) or aircrack-ng (up to 0.2.1). It is corrupted by a bug in those versions. You should upgrade to aircrack-ng 0.3 or more. You can try to recover part of the information using FixIvs.
Why aircrack-ng stalls while reading a .ivs file and does not start cracking ?
Your .ivs file may have been corrupted if you used pcap2ivs. Read previous point.
Is VMware supported?
At this point, there is only sketchy unconfirmed information about the aircrack-ng suite running under VMware. One thing about doing VMware, you cant use PCMCIA cards with fedora (and maybe other distros) that is running inside of VMWare (at least last the last time the forums at remoteexploit were reviewed). You should be able to make use of internal cards and some USB wireless cards but you limited on your antenna choices at that point. Some people modify their USB cards to allow for external antenna. If anyone has hands-on experience, please post the Forum so the information may be shared with everyone.