The client requests that an engineer conducts an external, web app, and internal assessment of the provided virtual environment. The client has asked that minimal information be provided about the assessment, wanting the engagement conducted from the eyes of a malicious actor (black box penetration test).ย The client has asked that you secure two flags (no location provided) as proof of exploitation:
User.txt
Root.txt
Additionally, the client has provided the following scope allowances:
Ensure that you modify your hosts file to reflect internal.thm
Any tools or techniques are permitted in this engagement
Locate and note all vulnerabilities found
Submit the flags discovered to the dashboard
Only the IP address assigned to your machine is in scope
First of all, I added the new host to my known ones:
Then I started performing an Nmap scan with:
Then I went to take a look to the webpage and its code:
Seems to be the default Apache page
So I decided to perform some enumeration with dirsearch ๐:
So I decided to check the /blog section:
It turned out to be a WordPress ๐, so I decided to use wpscan:
I found that the current version is 5.4.2, so I decided to find a CVE for this version.
I didnโt find anything interesting, so I decided to perform a user enumeration for a later brute force attack:
So I logged in as admin :D
Now itโs time to get RCE, so again in WordPress ๐ Iโve got some RCEs detailed:
Basically I uploaded a Reverse shell to the 404.php template and then I looked up for a non-existing post in the blog
I got RCE:
Once stabilized, I decided to take a look inside the /home/, but got no permissions to read aubreanna home directory, so I searched in /var/www/html directory.
As I didnโt find anything, I decided to check /opt/ โcuz itโs a place where you donโt expect to be nothing useful, but I found aubreanna credentials:
So I logged in and got user flag:
Inside the same directory, there is a jenkins.txt, which tells us that jenkins is running:
So I tunneled the connection to my machine via ssh:
Now in my browser I searched for: http://127.0.0.1:8080, which showed me the Jenkins login:
I tried the credentials of the user, but they didnโt work, so I decided to brute-force the login.
First, I caught the petition with Burp
Then I performed a http-form-post attack with Hydra ๐
Once I got in, i decided to perform a RCE detailed in my note Jenkins ๐จโ๐
Basically consists on inserting a reverse shell on the Script Console
Weโve got RCE!
So now, letโs try to find the root password. I looked inside the /opt as before:
So weโve got the root password. After this, we can get the root flag: