Skip to main content

Enumeration

Run Nmap Scan

View Website

Untitled

Directory Bruteforcing (Run Gobuster)

Website Manipulation

Turn on Burp Suite Proxy

Untitled Goto to Proxy > Options

Replacing 302 Found to 200 OK

Untitled Click Add to add a rule Untitled The Response header should change from 302 Found to 200 OK Untitled This should be the result of index.php through response header manipulation.

Generating Account

Untitled Goto ACCOUNTS tab Untitled Create Account Untitled Untitled After the task is done disable the response header manipulation and login to the website with the created credentials Untitled

Enumerating the Website

Untitled Untitled Download the SITEBACKUP.ZIP to do further enumeration later

Searching for any Credentials or Vulnerabilities inside Log Data

Untitled
Nothing special here!

Exploitation

Searching for any Credentials or Vulnerabilities inside siteBackup.zip

Config.php

The code above contains the mysql credentials, unfortuantely mysql is running locally so we don’t have a way to exploit it.

Logs.php

Take a look at the code above. We can see that the php retrieves the delim and passes the information to shell process that is executing python log_process.py
Imagine the code above, we exploit this to make the victim computer requesting for a reverse shell

Turn on Burp Suite and Proxy logs.php

Untitled

Listen to Reverse Shell and Exploit

Untitled
The code above is the code used to make the victim computer request for reverse shell

Privilege Escalation

To M4lware

Previously we gained config.php from siteBackup.zip. We couldn’t get into the system, because Mysql was only available through localhost.

Logging into MySql

Show List of Databases

Accessing Previse Database

Show list of tables

Retrieve all the accounts

The password is in hash format. We need to bruteforce the password to find the hash

Bruteforcing the Hash

You can find the format of the hash below example_hashes [hashcat wiki]

SSH into the system

To Root

Checking Sudo Privilege

Checking access_backup.sh Permissions

We can’t modify access_backup.sh.

access_backup.sh

Here it seems like the code is pretty fine. But, the program gzip’s path is not specified. We can modify the PATH of gzip to trigger our program in root privilege which is named gzip

Listen to Reverse Shell and Exploit

What we are doing here is modifying the environment PATH of the program gzip. We are doing this, because the the code inside access_backup.sh didn’t specify the absolute path for the program. Hence we can make the default gzip to be /tmp/gzip and not /bin/gzip

Reference