Cheesey:Cheeseyjack - Walkthrough [Vulnhub]
Here's my solution for Cheesey:Cheeseyjack.
The machine can be downloaded from here.
Port Scanning
Using Nmap to scan all TCP Ports.
$ nmap -sC -sV -p- 192.168.1.106
Enumeration
Browsing the web.
Using dirb to scan the directories.
$ dirb http://192.168.1.106 -r
From this message, we can take a note on the names- cheese and crab can be user names.
Browsing /project_management.
Since SMB ports are open we run enum4linux against the host to find some useful information.
$ enum4linux -a 192.168.1.106
Interesting. We find 2 users- ch33sem4n and crab.
The author has already given us the hint as- cewl.
We use cewl to generate passwords for us.
$ cewl http://192.168.1.106/project_management > password
We user burp to brute force the password of the user- ch33s3m4n.
We get the password as- qdpm.
We browse the login page and login with the credential-
Email: ch33s3m4n@cheeseyjack.local
Password: qdpm
We navigate to Projects > Add Project
We click the Attachments tab.
Now here we upload the php reverse shell file.
Initial Access
To run the exploit we browse the URL- http://192.168.1.106/project_management/uploads/attachments/
We simply click on file and on the other hand we start the netcat listener.
Privilege Escalation
From www-data > crab.
We find a file- todo.txt under /home/crab directory which gives us a hint- location of crab's ssh private key.
Lets get the key.
Before accessing SSH, we change the permission of the key file.
$ chmod 600 key
$ ssh -i key crab@192.168.1.106
From crab > root.
We check for SUDO rights.
We navigate to /home/crab/.bin directory, create a bash file and place the reverse shell payload in it.
We run the bash file and on the other hand we start the netcat listener.
Comments
Post a Comment