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

Sunset: decoy Vulnhub Walkthrough

Yezuz

Cryptographic Vulnerability Auditor
Y Rep
0
0
0
Rep
0
Y Vouches
0
0
0
Vouches
0
Posts
68
Likes
143
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
Today we are going to solve another boot2root challenge called “Sunset: decoy”. It’s available at Vulnhub for penetration testing. This is easy for the intermediate level lab. The credit for making this lab goes to whitecr0wz. Let’s start and learn how to break it down successfully.

Level: Easy/Intermediate

Since these labs are available on the Vulnhub website. Let’s download the lab file from here.

Penetration Testing Methodology

Reconnaissance

  • Netdiscover
  • Nmap

Enumeration

  • Web server backup

Exploiting

  • Zip2john & John The Ripper

Privilege Escalation

  • Pspy64
  • Crontab abuse and chkrootkit vulnerability

Capture the flag

Walkthrough

Reconnaissance

As always we identify the host’s IP with the “Netdiscover” tool:

1.png


To work more comfortably, I’ll put the IP address in /etc/hosts.

2.png


So, let’s start by listing all the TCP ports with nmap.

Code:
nmap –sV -sC -p- 192.168.10.186

3.png


Enumeration

We access the web service and download the file “save.zip“.

4.png


We tried to unzip the file, but it’s password protected.

5.png


For this mission, we will use “zip2john” which will help us to extract the hash from the .zip file and later we will attack it with “John The Ripper” and the dictionary “rockyou.txt“.We will obtain the password “manual” and use it to decompress the file, this time with success.

6.png


Exploiting

In the content of the .zip, we found a backup of several system files. We read the “shadow” file, copy the two hashes into a file called “users.hash” and crack this one with John The Ripper and the “rockyou.txt” dictionary.

7.png


We connect through the SSH service, this time we will add
-t “bash –noprofile”
to escape from the restricted bash. In there, we will read the user flag.

8.png


Privilege Escalation (root)

We listed the files and found a binary called “honeypot.decoy“. We run it, use option 5 and see a warning that it will run in a minute.

9.png


It is time to run pspy64, we check that a binary is running as root every 60 seconds.

10.png


We looked for information about the version of this binary and found an exploit that allows to scale privileges as root.

11.png


Simply create a file called “update” and insert a reverse shell. We will give it execution permissions and wait 60 seconds with a netcat listening on port 4444 in our Kali.

12.png


After some time, we will have a session as root and we will be able to read the flag.

13.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.
 

432,289

312,550

312,559

Top