Cherry:1 - Walkthrough [Vulnhub]
Here's my solution for Cherry:1
The machine can be downloaded from here.
Nmap
Scanning for all TCP ports.
$ nmap -sC -sV -p- 192.168.1.105

We find 4 ports open.
Enumeration
Browsing the web (HTTP) hosted on port 7755.
Checking the source of the page, did not reveal any hints.

We scan for directories using dirb.
$ dirb http://192.168.1.105:7755/ -r

Interesting, we browse /backup.

Browsing /command.php, looks like a blank page. But if see size of the file we can assume that there should be something.
So lets get the file.
$ wget http://192.168.1.105:7755/backup/command.php
$ cat command.php

We see a passthru() function. A passthru() function is similar to exec() function which can be used to execute commands.
We browse /command.php?backup=ls, seems we are able to execute the command successfully.
Executing- whoami.

Executing cat /etc/passwd.
Getting Access
We see that the commands are workings fine, lets get the reverse shell.
Before executing the reverse shell payload we browse the site to url encode it.

We execute the payload and on the other hand we start the netcat listener.

We successfully get the reverse shell.

Privilege Escalation
Checking for SUID permissions.

Lets escalate and get the root flag.
Comments
Post a Comment