Machine Info
Spoiler
User
Reconnaissance
We are going to start by running our nmap scan:
| |
CS-Cart

We do perform as well a directory enumeration as always.
| |
We see many interesting 200 responses but we focus on the admin page. When trying “default credentials” we manage to actually authenticate as admin.admin creds
admin:admin

We have successfully authenticated and we take a bit of time to browse the options that the admin has. We do see options to upload files and backup the database. We also find the version of the website which is 1.3.3.
Looking it up online we see a popular authenticated RCE for CS-Cart 1.3.3. We will jump straight to the exploit.
In order to exploit this we need to get a PHP shell and upload it in the Template editor. The .php extension is not allowed so we will use .phtml.
We are going to use a reverse php shell from revshells.com

After we upload it we start up our listener and we move to http://[victim]/skins/rev.phtml to trigger it.
| |
That is how we get a shell and we can get the local.txt.
Root
Root Paranoia
www-data had too wide access which the ssh service didn’t allow with its strict mode turned on.We browsed for a while around and we did find the database credentials.
| |
Furthermore a local DB was indeed running and we were able to authenticate but nothing was interesting was found.
We then run linpeas.sh and we managed to find that the /root directory was accessible but we couldn’t read the flag nor was any key available.
| |
We did find though a pcap file which it made sense of course to investigate.
| |
From our search we managed to get a set of credentials. Specifically brett:ilovesecuritytoo as we can see from the hex editor above. But we couldn’t use them nowhere! This was a bit frustrating to say the least.
Later, we explored many exploits but none worked for us. Linux kernel and many software were ancient but nothing worked for our purposes since we didn’t have any user password.
We tried many different ideas but it seemed that we were stuck….
And then we saw from the linpeas output a hint to try on all known users the username as password! So basically it gave us the idea of bruteforcing but we tried something for patrick user and it worked!
Patrick's password
| |
With patrick user we can just elevate our privileges to root as it is permitted.
| |
