Air Crack
Air Crack
Air Crack
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
Then aircrack adds this to his table. In our screenshot above, we can see, that at keybyte 0 the byte
0xAE has collected some votes, 50 in this case. So, mathematically, it is more possible that the key
starts with AE than with 11 (which is almost half as possible).
With this information, aircrack starts checking the most possible key and then searches its way
through the possibility table. If you tell aircrack to use fudge factor 2 (default, -f 2) it takes the
votes of the most possible byte, and checks all other possibilities which are at least half as possible
as this one.
You have the votes like in the screen shot above. For the first byte: AE(50) 11(20) 71(20) 10(12)
84(12)
Now you decide to use fudge factor 3, it takes the vote from the most possible byte AE(50):
50 / 3 = 16.666666
Aircrack will test all keys with vote > 16.6666, resulting in
AE, 11, 71
When aircrack is testing keys with AE, it shows 0 / 3, if it has all keys tested with that byte, it
switches to the next one and displays:
Usage
aircrack-ng [options] <capture file(s)>
You can specify multiple input files (either in .cap or .ivs format). Also, you can run both airodump-
ng and aircrack-ng at the same time: aircrack-ng will auto-update when new IVs are available.
If set, all IVs from networks with the same ESSID will be used. This option is also
-e essid
required for WPA-PSK cracking if the ESSID is not broadcasted (hidden).
-b bssid Select the target network based on the access points MAC address.
-q none 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 -
-c none
0x7F).
-t none (WEP cracking) Restrict the search space to binary coded decimal hex characters.
-d start (WEP cracking) Set the beginning the WEP key (in hex), for debugging purposes.
(WEP cracking) MAC address to filter WEP data packets. Alternatively, specify -m
-m maddr
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
-n nbits
WEP, etc. The default value is 128.
(WEP cracking) Only keep the IVs that have this key index (1 to 4). The default
-i index
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
-f fudge 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
-k korek 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) This is an experimental single bruteforce attack which should only
-y none
be used when the standard attack mode fails with more than one million IVs
-w words (WPA cracking) Path to a wordlist or - without the quotes for standard in (stdin).
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:
Opening 128bit.ivs
Read 684002 packets.
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
KB depth byte(vote)
0 0/ 1 AE( 199) 29( 27) 2D( 13) 7C( 12) FE( 12) FF( 6) 39( 5) 2C( 3) 00( 0) 08( 0)
1 0/ 3 66( 41) F1( 33) 4C( 23) 00( 19) 9F( 19) C7( 18) 64( 9) 7A( 9) 7B( 9) F6( 9)
2 0/ 2 5C( 89) 52( 60) E3( 22) 10( 20) F3( 18) 8B( 15) 8E( 15) 14( 13) D2( 11) 47( 10)
3 0/ 1 FD( 375) 81( 40) 1D( 26) 99( 26) D2( 23) 33( 20) 2C( 19) 05( 17) 0B( 17) 35( 17)
4 0/ 2 24( 130) 87( 110) 7B( 32) 4F( 25) D7( 20) F4( 18) 17( 15) 8A( 15) CE( 15) E1( 15)
5 0/ 1 E3( 222) 4F( 46) 40( 45) 7F( 28) DB( 27) E0( 27) 5B( 25) 71( 25) 8A( 25) 65( 23)
6 0/ 1 92( 208) 63( 58) 54( 51) 64( 35) 51( 26) 53( 25) 75( 20) 0E( 18) 7D( 18) D9( 18)
7 0/ 1 A9( 220) B8( 51) 4B( 41) 1B( 39) 3B( 23) 9B( 23) FA( 23) 63( 22) 2D( 19) 1A( 17)
8 0/ 1 14(1106) C1( 118) 04( 41) 13( 30) 43( 28) 99( 25) 79( 20) B1( 17) 86( 15) 97( 15)
9 0/ 1 39( 540) 08( 95) E4( 87) E2( 79) E5( 59) 0A( 44) CC( 35) 02( 32) C7( 31) 6C( 30)
10 0/ 1 D4( 372) 9E( 68) A0( 64) 9F( 55) DB( 51) 38( 40) 9D( 40) 52( 39) A1( 38) 54( 36)
11 0/ 1 27( 334) BC( 58) F1( 44) BE( 42) 79( 39) 3B( 37) E1( 34) E2( 34) 31( 33) BF( 33)
Now onto cracking WPA/WPA2 passphrases. Aircrack-ng can crack either types.
-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.
Opening wpa2.eapol.cap
Opening wpa.cap
Read 18 packets.
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:
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
Transcient Key : 33 55 0B FC 4F 24 84 F4 9A 38 B3 D0 89 83 D2 49
73 F9 DE 89 67 A6 6D 2B 8E 46 2C 07 47 6A CE 08
AD FB 65 D6 13 A9 9F 2C 65 E4 A6 08 F2 5A 67 97
D9 6F 76 5B 8C D3 DF 13 2F BC DA 6A 6E D9 62 CD
EAPOL HMAC : 52 27 B8 3F 73 7C 45 A0 05 97 69 5C 30 78 60 BD
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:
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>
Usage Examples
The following removes the wireless headers from an open network (no WEP) capture:
Usage Tips
For ESSIDs which contain spaces, put the ESSID in quotes: this contains spaces.
Usage Troubleshooting
None at this time.
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:
Usage Examples
Typical Uses
To start wlan0 in monitor mode: airmon-ng start wlan0
Enter iwconfig:
lo no wireless extensions.
System responds:
lo no wireless extensions.
System responds:
System responds:
lo no wireless extensions.
If ath1/ath2 etc. is running then stop them first prior to all the commands above:
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.
Attack 0: Deauthentication
Attack 1: Fake authentication
Attack 2: Interactive packet replay
Attack 3: ARP request replay attack
Attack 4: KoreK chopchop (CRC prediction)
Attack 5: Fragmentation
Fragmentation vs. Chopchop
Here are the differences between the fragmentation and chopchop attacks
Fragmentation
Pros
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
Cons
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.
or
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:
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 is what the ouput looks like:
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:
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:
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):
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:
If this attacks seems to fail (aireplay-ng keeps sending authentication requests), MAC address
filtering may be in place. Also make sure that:
You could use it, for example, to attempt the any data re-broadcast attack, which only works if the
AP actually reencrypts WEP data packets:
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):
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.
Description
The classic ARP request replay attack is the most effective way to generate new initialization vectors
(IVs), and works very reliably. The program listens for an ARP packet then retransmits it back to the
access point. This, in turn, causes the access point to repeat the ARP packet with a new IV. The
program retransmits the same ARP packet over and over. However, each ARP packet repeated by
the access point has a new IVs. It is all these new IVs which allow you to determine the WEP key.
ARP is address resolution protocol: A TCP/IP protocol used to convert an IP address into a physical
address, such as an Ethernet address. A host wishing to obtain a physical address broadcasts an
ARP request onto the TCP/IP network. The host on the network that has the address in the request
then replies with its physical hardware address.
Usage
Basic usage:
Where:
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.
Where:
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.
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:
BSSID = 00:14:6C:7E:40:80
Dest. MAC = FF:FF:FF:FF:FF:FF
Source MAC = 00:0F:B5:88:AC:82
0x0000: 0841 0000 0014 6c7e 4080 000f b588 ac82 .A....l~@.......
0x0010: ffff ffff ffff 7092 e627 0000 7238 937c ......p..'..r8.|
0x0020: 8011 36c6 2b2c a79b 08f8 0c7e f436 14f7 ..6.+,.....~.6..
0x0030: 8078 a08e 207c 17c6 43e3 fe8f 1a46 4981 .x.. |..C....FI.
0x0040: 947c 1930 742a c85f 2699 dabe 1368 df39 .|.0t*._&....h.9
0x0050: ca97 0d9e 4731 ....G1
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.
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:
tcpdump -s 0 -n -e -r replay_dec-0627-022301.cap
reading from file replay_dec-0627-022301.cap, link-type [...]
IP 192.168.1.2 > 192.168.1.255: icmp 64: echo request seq 1
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.
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.
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:
BSSID = 00:14:6C:7E:40:80
Dest. MAC = 00:0F:B5:AB:CB:9D
Source MAC = 00:D0:CF:03:34:8C
0x0000: 0842 0201 000f b5ab cb9d 0014 6c7e 4080 .B..........l~@.
0x0010: 00d0 cf03 348c e0d2 4001 0000 2b62 7a01 ....4...@...+bz.
0x0020: 6d6d b1e0 92a8 039b ca6f cecb 5364 6e16 mm.......o..Sdn.
0x0030: a21d 2a70 49cf eef8 f9b9 279c 9020 30c4 ..*pI.....'.. 0.
0x0040: 7013 f7f3 5953 1234 5727 146c eeaa a594 p...YS.4W'.l....
0x0050: fd55 66a2 030f 472d 2682 3957 8429 9ca5 .Uf...G-&.9W.)..
0x0060: 517f 1544 bd82 ad77 fe9a cd99 a43c 52a1 Q.D...w.....<R.
0x0070: 0505 933f af2f 740e ...?./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.
Where:
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:
To view the packet that was just decrypted, enter tcpdump -n -vvv -e -s0 -r arp-request-dec
Which is exactly what we expected. Now you can inject this arp request packet as follows aireplay-
ng -2 -r arp-request ath0.
The program will respond as follows:
BSSID = 00:14:6C:7E:40:80
Dest. MAC = FF:FF:FF:FF:FF:FF
Source MAC = 00:0F:B5:AB:CB:9D
0x0000: 0841 0201 0014 6c7e 4080 000f b5ab cb9d .A....l~@.......
0x0010: ffff ffff ffff 8001 6c48 0000 0999 881a ........lH......
0x0020: 49fc 21ff 781a dc42 2f96 8fcc 9430 144d I.!.x..B/....0.M
0x0030: 3ab2 cff5 d4d1 6743 8056 24ec 9192 c1e1 :.....gC.V$.....
0x0040: d64f b709 .O..
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.
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.
Usage
usage: airtun-ng <options> <replay interface>
Scenarios
wIDS
The first scenario is wIDS. Start your wireless card in monitor mode then enter:
Where:
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:
ifconfig at0 192.168.1.83 netmask 255.255.255.0 up
You can confirm this by entering ifconfig at0 and checking the output.
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.
Notice that the PRGA files was specified via the -y option.
From here you can define a valid IP address for the network when you bring the at0 interface 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.
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:
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.
Convert
Use convert option to convert a pcap file (by default, they have .cap extension) to a .ivs file.
Example:
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
The Forum
User Documentation by platform (Linux, Windows)
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.
The major problem with WEP is that the shared key is appended to the IV; the result is directly used
to feed RC4. This overly simple construction is prone to a statistical attack, since the first ciphertext
bytes are strongly correlated with the shared key (see Andrew Roos paper). There are basically two
counter-measures against this attack:
There has been some disinformation in the news about the flaws of TKIP:
For now, TKIP is reasonably secure but it is also living on borrowed time since it still relies on the
same RC4 algorithm that WEP relied on.
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/
From the command line you may use the mergecap program to merge .cap files (part of the
Wireshark/Ethereal package or the win32 distribution):
You may use the ivstools program to merge .ivs files (part of aircrack-ng package)
Wireshark 0.99.5 and above can decrypt WPA as well. Go to Edit Preferences Protocols IEEE
802.11, select Enable decryption, and fill in the key according to the instructions in the
preferences window. You can also select Decryption Keys... from the wireless toolbar if its
displayed.
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:
http://mirrors.usc.edu/pub/gnu/macchanger/
http://ftp.gnu.org/gnu/macchanger/
http://ftp.azc.uam.mx/mirrors/gnu/macchanger/
Here are scripts which use the macchanger package and work well with madwifi-ng drivers:
#!/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.
On Ethernet, ARP packets when received are typically 60 bytes long. When this is then relayed by a
wireless access point, they are 86 bytes. This is, of course, because of the wireless headers. If a
wireless client sends an ARP, they are typically 42 bytes long and they become 68 when relayed by
the AP.
Edit /etc/pcmcia/config
Add a new device if doesnt already exist
device "hostap_cs"
class "network" module "hostap_cs"
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
http://centricle.com/tools/ascii-hex/
http://www.mikezilla.com/exp0012.html
http://www.vortex.prodigynet.co.uk/misc/ascii_conv.html
Possible reasons:
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.
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).
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.
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.
Is it a driver problem or is it my network hardware?
Neither, really. Its a physics problem. The only solution is to either decrease transmission power,
use an antenna with a lower gain factor, or move the access point farther away from the station.
You should use wired ethernet when youre close to the access point. If you dont want or you dont
have a wire, you can also decrease output power of your Access point or your card.
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 remote-
exploit 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.