V3NU5💀AL13N:~#

Hack Enumerate Harder!. Eat. Sleep. Repeat.

View on GitHub

⬅ Back to Homepage

WHALE

image

DIFFICULTY= medium

OS = Linux

Nmap scan

image

adding the domain to /etc/hosts echo "ip bluewhale.net" >> /etc/hosts

so, visiting the site shows it’s running wordpress

image

let’s enumerate the wordpress using wpscan aggressive detection

wpscan --url http://bluewhale.net/ --plugins-detection aggressive -t 120

image

it gives us a vulnerable plugin; the plugin is vulnerable to arbitrary file read

so, we can exploit it using this

doing that,we should be able to read the wordpress config file wp-config

bluewhale.net/wp-content/plugins/post-pdf-export/dompdf/dompdf.php?input_file=php://filter/read=convert.base64-encode/resource=../../../../wp-config.php

reading it gives us the gives us the base64 encoded chars.

decoding it shows the mysql credential

image

let’s login to mysql with it mysql -u wordpress -h bluewhale.net -p and input the password

image image

as u can see we have the first flag already

let’s proceed by checking the wp_users table

image

and yeah we have the credentials for the wordpress login

so, instead of cracking the password hash we can actually change the password to our desired own for easier loggin(cool trick right?) lol

UPDATE wp_users SET user_pass = MD5('hacked') WHERE ID = 1;

image

so, we can now login to wordpress and proceed

image

login and upload a reverse shell using the add plugin feature image

and let’s access our shell in the upload directory image

getthe reverse shell and stablize it

image

Privilege escalation

Enumerating further i got the ssh private key for the user whale in the whale home directory .bak cool :)

image

so we can now ssh into the box as user whale

image

so let’s read the FLAG58 which we ain’t able to read before.

image

so, running the command id shows the user whale is in docker group which we can escalate our privilege to root using it. image

read more about the docker group privilege escalation here

following the steps should give us root

image

Thanks.

Tags: Dompdf,Arbitrary file read,Docker