Simple
Last updated
Was this helpful?
Last updated
Was this helpful?
A web server on port 80 is open
It is running with CMS Made Simple v2.2.4 in the footer
Since it's a web server, I'll run directory busting
After some time running, it found /admin
and looks interesting. I tried logging in with default credentials but nothing works.
Since we have the version, let's take a look with searchsploit. And it turns out the version of CMS Made Simple it has is vulnerable to SQL Injection.
I run the script with the following parameters
After some time running, we got the following information.
Log in using this credential on /admin
Go to Content > File Manager, we will upload a reverse shell here
Create your own PHP reverse shell, but in this example I will use this awesome shell: https://github.com/ivan-sincek/php-reverse-shell
Rename your shell to <shellname>.txt
and upload your shell
Now we need to rename our shell to .php extension, to do that you have to create a copy of your shell and name it with .php extension. Make your your target directory is on /uploads
Now we have successfully, uploaded our reverse shell.
Set a netcat listener and visit /uploads/shellname.php. And you should received your shell right away.
Let's transfer linpeas.sh to target machine
Transfer the bash script with wget
Run linpeas.sh
The binary systemctl
has suid
flag, we can use this to gain root shell.
Create shell.service in any writable folder with the following content, and edit the IP Address and port accordingly.
Create a softlink with the file you have created.
Set a netcat listener, and run the following command to trigger the exploit
Sweet, now you're root! :D