top of page
Search

DEV WALKTHROUGH

  • Writer: Strider Gearhead
    Strider Gearhead
  • Feb 19, 2023
  • 3 min read

This machine is named as DEV

Firstly we will open the vm and get the ip address.

1. Command: dhclient

2. Ip a

After getting the ip address we will run the nmap scan to know that which ports are open and what services are running on.

Command: nmap -T4 -A <target ip>

Result of nmap scan:

ree

As we can see port 80 is open:

ree

In this bolt document section:

ree

We can see that bolt cms is running, so this could be interesting.

We also saw that port 8080 is also open, so let’s see what’s there:

ree

Now we will do directory fuzzing with the tool named as ffuf.

To install ffuf: sudo apt install ffuf

To do directory fuzzing the commad is: ffuf -w <path/to/wordlist>:FUZZ -u<http://target ip>/FUZZ

ree

We will also do directory fuzzing on port 8080.

Command: : ffuf -w <path/to/wordlist>:FUZZ -u <http://target ip:8080>/FUZZ

ree

We found some directories in port 8080:

ree

dev directory looks interesting, let’s see what’s there:

ree

We can see that here is login page.

We have also saw in the nmap scan that nfs(network file share) was there, So let’s list the directories which are mounted in nsf.

Command: showmount -e <target ip>

-e means export

ree

Here we can see there is a directory /srv/nfs.

So let’s mount that file into our system.

Firstly we will make directory in mnt directory:

Command: mkdir /mnt/dev

Now we will mount the file from target into our system.

Commad: mount -t nfs <target ip:srv/nfs> /mnt/dev/

-t means type

ree

Here we can see that there is a zipped file. So let’s unzip this file.

ree

Here it is asking for the password but we don’t have any password. So let’s bruteforce it. We will use the tool fcrackzip for bruteforcing the password to unzip this file.

Command to install fcrackzip: sudo apt install fcrackzip

Command for using fcrackzip: fcrackzip -v -u -D -p /usr/share/wordlist/rockyou.txt

ree

Here we got the password:

ree

Now we will unzip it.

Command: unzip save.zip

ree

We can see that here are two files.

Todo.txt:

ree

And an id_rsa file. Previously we saw that there was a login page on port 8080 so let’s go there and create an account.

If we will search on google about boltwire exploit so we will found and LFI(Local File Inclusion) exploit

ree

Here we can see that if we use this in the port 8080 url then we can see /etc/passwd.

So lets do this.

ree

ree

Here we can see a user Jeanpaul so we can login on the behalf of Jeanpaul through ssh coz we also have id_rsa file.

Command: ssh -i id_rsa jeanpaul@<target ip>

ree

Here it is asking for phrase for the key, but we don’t have this right now, so now we will do bruteforce to crack the password for this.

We saw in directory fuzzing on port 80

ree

There are different directory, let’s check all of them manually.

ree

We can see that here is a config file, so let’s explore config file.

ree

Here is an interesting file. Let’s open this file and explore it.

ree

Here we get some credentials, now we will use this password as phrase to login through ssh

ree


We have successfully logged in. So now we have to escalate our privilege as root to get the flag.

Now if we will check the commands we can run as sudo,

Command: sudo -l

ree

Here we can see that we can run zip as sudo. Now we will go to gtfobins to check the command for zip as sudo to get root access.

ree

We can use this command to get root access.

Command: TF=$(mktemp -u)

sudo zip $TF /etc/hosts -T -TT 'sh #'

Now we have gained the root access.


And here is the flag.

ree



CONGRATULATIONS YOU HAVE SOLVED THIS MACHINE AND IF YOU LIKE THIS WRITEUP KINDLY LET ME KNOW IN THE COMMENT.








 
 
 

Comments


bottom of page