Offensive Security’s Proving grounds InfosecPrep Lab Walkthrough

Cyb0rgBytes
3 min readFeb 18, 2024

--

As we approach any penetration testing engagement we start with information gathering, information gathering in Cyber Security is a crucial step that should not be avoided, same goes for enumeration.

There are many tools that can be used for enumeration or information gathering.

Lets start with an nmap scan:

Nmap Scan Initial Results.

from the nmap scan I can see that there is two open ports, port 80 & SSH!

I can see that the web server is running wordpress with version 5.4.2 on port 80 which hints to be vulnerable, the perfect next tool to check the wordpress web server is wpscan!

Lets use it in the next steps and see if we can get a foothold on the webserver.

from the wpscan shown below I can find that there is a file called robots.txt in the web directories:

Finding the robots.txt.

Then next I go to the secrets directory :

Found a Base64 encoded text!

From there I found a base64 encoded text, I use this command to decode it :

echo “base64 encoded text” | base64 — decode

From the decoded text, I found a Private OpenSSH Key:

Found an OpenSSH Private Key Text.

lets give its permission and try to connect:

first of all lets add this SSH Private key to a file and change the required permissions:

chmod 600 id_rsa

next :

Gaining Initial Access to the box through SSH.

for this machine the username is known as OSCP since it’s a infosec prep machine, which makes our job much easier with dealing with it!

after gaining foothold using the ssh private key, our time has come to elevate our privilege, we can start searching for PE vectors using our handy tool Linpeas.sh.

from this screenshot I’ve found that bash and sudo are possible Privilege escalation vectors

Gaining root successfully.
PWN TO OWN!

I got the information on the priv escalation method from this website:

gtfobins website.

GTFOBins is a curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured systems.

Thanks for reading my write-up and stay tuned for the next info sec write-ups!

Cheers!

Cyb0rgBytes Out!

--

--

Cyb0rgBytes
Cyb0rgBytes

Written by Cyb0rgBytes

A Passionate and Defensive Type of Ethical Hacker , booted and ready to secure the world

No responses yet