Reconnaissance
First, I added the new host to my known ones:
Then, I performed a Nmap scan:
So I checked the website and got asked for some credentials:
I always try some basic combinations and in this case admin:admin
worked!:
After inspecting the source code, I found the version in use of ActiveMQ (5.15.15) inside /admin
:
Weaponization
I searched in Google for โactivemq 5.15.15 exploitโ and found CVE-2023-46604
Exploitation
I followed the instructions of the exploit:
I got a reverse shell :D
After stabilizing, we can now read the user flag
Privilege escalation
If we run sudo -l
:
So I found a way to escalate privileges by using this script:
- First go to the home directory of an interactive session (
cd ~
)
Then run the exploit:
Store the SSH Private Key then use it to connect to the host:
Now we are root and can read root flag
Machine pwned!