
Week 4. SolarLab
TL;DR
This is a Windows 10 machine with a SMB share configured to allow guest sessions. In the shared resource we find usernames and passwords, and after a RID bruteforce we get more usernames. A user shell is achieved exploiting CVE-2023-32315 in a Reportlab application running in the host. Regarding escalation, we move laterally exploiting CVE-2023-32315 in OpenFire, then decrypt the administrator password which is stored in the OpenFire database.
KEYWORDS
SMB guest sessions, RID bruteforce, Reportlab, CVE-2023-32315, OpenFire, CVE-2023-3231.
REFERENCES
https://www.cvedetails.com/cve/CVE-2023-33733/
https://github.com/c53elyas/CVE-2023-33733
https://github.com/miko550/CVE-2023-32315
https://hashcat.net/forum/thread-2399.html
ENUMERATION
Port scan.
> nmap $target -p- --min-rate=5000 -Pn --open --reason
Starting Nmap 7.93 ( https://nmap.org ) at 2024-05-12 11:05 EDT
Nmap scan report for 10.10.11.16
Host is up, received user-set (0.043s latency).
Not shown: 65530 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
80/tcp open http syn-ack
135/tcp open msrpc syn-ack
139/tcp open netbios-ssn syn-ack
445/tcp open microsoft-ds syn-ack
6791/tcp open hnm syn-ack
Nmap done: 1 IP address (1 host up) scanned in 26.47 secondsEnumerate the open ports.
Take note of the disclosed subdomain, add to hosts file and continue enumerating. Next step is to check if the host accepts SMB null sessions.
Which is the case. Enumerate the contents of the Documents folder.
Download the details-file.xlsx file, it contains personal data and credentials.
Since guests sessions are enabled, let's brute force the RID to get a list of valid usernames.
We have found user SOLARLAB\blake. If we see how usernames are formed in the .xlsx file, username should be BlakeB
USER
Log in subdomain http://report.solarlab.htb:6791 with credentials blakeb:ThisCanB3typedeasily1@. A Reportlab welcome page appears.
There is a CVE affecting this application, more information here: https://www.cvedetails.com/cve/CVE-2023-33733/. And an associated PoC is available here:here: https://github.com/c53elyas/CVE-2023-33733
Click on "Travel Approval".
Generate request, upload a .png and capture with Burpsuite. Insert a payload after the travel_request parameter as indicated in the PoC.
Start a listener and send the request, a reverse shell is received. It can be used to retrieve the user flag.
SYSTEM
Place a chisel to forward internal ports 9090 and 9091.
Navigate to http://localhost:9090, an OpenFire server welcome page pops up. Add a new user following instructions in: https://github.com/miko550/CVE-2023-32315
Then upload a .jar plugin (taken from the same GitHub repository) to enable a command console. After uploading the plugin, navigate to Server -> Server Settings -> Management Tool, and select "System command". Insert a reverse shell, for example a Powershell base64 encoded payload. A shell as user openfire is received on the listener.
Under this shell you can enumerate the file C:\program files\openfire\embedded-db\openfire.script. This file contains an encrypted OpenFire admin password.
And a blowfish key which is needed to decrypt the key.
To decrypt the password you can use any of the OpenFire password decrypters available online, such as this: https://hashcat.net/forum/thread-2399.html
Once you have the administrator password, just use it login as as Administrator.
You are root.
Last updated