• We just launched and are currently in beta. Join us as we build and grow the community.

Relevant: 1 Vulnhub Walkthrough

Anexide

Tool Creator
A Rep
0
0
0
Rep
0
A Vouches
0
0
0
Vouches
0
Posts
79
Likes
200
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 400 XP
Today we are going to solve another boot2root challenge called “Relevant: 1“. It’s available at VulnHub for penetration testing and you can download it from here.

The merit of making this lab is due to @iamv1nc3nt. Let’s start and learn how to break it down successfully.

Level: Intermediate

Penetration Testing Methodology

Reconnaissance

  • Netdiscover
  • Nmap

Enumeration

  • Dirsearch
  • Nmap with scripts WordPress

Exploiting

  • Wp-file-manager 6.7 Remote Code Execution (RCE)

Privilege Escalation

  • Abuse of credentials with weak hashes in hidden files
  • Abuse of sudo
  • Capture the flag

Walkthrough

Reconnaissance

We are looking for the machine with netdiscover

Code:
netdiscover -i ethX

1.png


So, we put the IP address in our “/etc/hosts” file and start by running the map of all the ports with operating system detection, software versions, scripts and traceroute.

Code:
nmap -A –p- 192.168.10.161

2.png


Enumeration

So far it seems all easy, a web service with some links containing credential information in leaks and a QR code to set up a double authentication factor (2FA) . Too beautiful to be true!

3.png


Listing of credentials in public leaks.

4.png


Content of the QR code:

5.png


We log in via SSH, insert the password, insert the double authentication factor and disconnect! The account has disabled the use of this service, so it is a rabbit hole.

6.png


It’s time to launch my favourite fuzzing tool, in my case I used dirsearch. We list that there are WordPress files and directories displayed on the machine.

7.png


Going back to the clue given by the creator of the machine in the description: “
enumerate the box, then enumerate the box differently
“.

Since our only evidence is the remains of WordPress files, we will try with the nmaps scripts for this CMS.

It will list two plugins, among them “wp-file-manager 6.7“.

8.png


Exploiting

After the above list, we look for exploits and vulnerabilities that we can exploit for this version. We found an exploit that allows remote code execution without the need for authentication.

Exploit: https://github.com/w4fz5uck5/wp-file-manager-0day

Execute the exploit and access the server.

9.png


Since visibility is a bit of a problem, we upload a “pentestmonkey” webshell, put a netcat on it and run our webshell.

We execute our two favourite commands to get an interactive shell.

10.png


We read the file “wp-config.php“, but something tells me that the password is not going to help us much either. xD

11.png


We checked the files of the user “h4x0r” and found a “hidden” folder with three dots, in it there is a file called “note.txt” with some credentials in SHA-1 that we must crack.

12.png


We access the online site “hashes.com” and insert our hash and get the password in plain text.

13.png


Privilege Escalation (root)

Now yes, we authenticate with the user “news“, we execute “sudo -l” and we see that we have permissions to execute the binary “node”.

14.png


We take advantage of this to scale privileges in the system as root, for this we will execute the following syntax.

And finally, we will read our deserved flag!

15.png


Author: David UtĂłn is Penetration Tester and security auditor for Web applications, perimeter networks, internal and industrial corporate infrastructures, and wireless networks. Contacted on LinkedIn and Twitter.
 

422,003

310,534

310,543

Top