Breach - Vulnlab
Breach - Vulnlab
Overview
What's good yodie family, its ya boy tobeatelitto here back with another banger. Today were
taking a look at Breach; probably my favorite machine in xct's Vulnlab. It involves phishing a user
through a writeable SMB share, kerberoasting the service account for MSSQL, and abusing
silver tickets to escalate privileges and compromise a DC.
Initial Enumeration
Port 88 and the kerberos service is open so the machine is a domain controller. Aside from that
it looks like a standard windows box, although MSSQL is open which could be interesting.
It's probably just a share that the domain users send files to one another from. We can try and
pump it full of file types that can be used to force authentication against our attacker machine
since we have write access, and hopefully some idot will authenticate to us.
On a side note, (and in this situation, doing so unnecessary and irrelevant) you can always
confirm that the users who have directories in the share are valid domain users with kerbrute.
Anyways we generate a bunch of files for our phishing using Greenwolf/ntlm_theft, and
eventually we get a hash back, which we crack. Of course, this (and everything else in this
writeup) is horrible from an OPSEC perspective but whatever im not an operator.
Lateral Movement
With a domain user compromised we have a lot more pathways open to us. We could do a
bloodhound ingest and look for AD abuses, we can look for new SMB shares we may have
access to, we can kerberoast. For the sake of time I'll skip to the correct method forward,
kerberoasting.
Yodie family we have everything we need in the present moment you feel me? All that matters is
that we pursue our purpose and mission; but remember family you won't be striving to succeed
on your mission by wasting time thinking about the past or worrying about the future. You wont
find it scrolling though TikTok or Instagram reyel stuffff. Remember that ever day is not going to
be 100%, so its OK to not be perfect, but you still have to stay focused on the mission
gangington fr fr.
Service accounts (accounts tied to SPNs) are powerful because if someone compromises
them, they can use silver tickets to impersonate any user, in the context of that service.
I will not explain the inner workings of the attack, but xct has a nice blogpost on the theory
behind the attack and ired.team has a nice example of the attack and I recommend you at least
skim them both.
Each service accounts has a different extent to how dangerous they can be, but the MSSQL
service account can lead to the compromise of the machine MSSQL is running on. MSSQL is
running on the DC itself in this case, so have a clear path to both local, and domain admin.
There are 2 extra things we need to create a silver ticket for MSSQL, the NT hash of the service
account, and the domain SID. To get the NT Hash I went here and converted the clear-text
password into the hash, and to get the SID I used enum4linux because I was lazy and didn't
have a bloodhound ingest.
With these, we can use ticketer.py to forge a silver ticket that lets us authenticate as
Administrator in the context of MSSQL.
Anyways there are 2 methods to root from here. It was actually jkr, my second favourite true
german geezer that showed this first method in the vl breach channel. The way was simply to
read the root flag, since MSSQL can read files, and we are allowed to read any files the
Administrator can.
SELECT * FROM OPENROWSET(
BULK N'C:\Users\Administrator\Desktop\root.txt',
SINGLE_CLOB
) as Contents
Back to the box: the first order of business is to get a shell. We are the MSSQL Admin so we can
use xp_cmdshell to execute commands. I like to use hoaxshell because it's pretty stable and
easy to use for when I don't feel like getting out a big C2. Immediately, we see that
SeImpersonate is enabled for our user.
2023/03/27 ToBeatElite