Buff HTB

IP

10.10.10.198

initial nmap scan

sudo nmap -p- --min-rate 10000 10.10.10.198 | cut -d"/" -f1 | tr '\n' ','

we have the following ports open on the target

8080

Lets try and get more information of the target

sudo nmap -sCV -p8080 10.10.10.198 -oA nmap_results

results

Starting Nmap 7.94 ( https://nmap.org ) at 2024-01-02 06:16 EST
Nmap scan report for 10.10.10.198
Host is up (0.026s latency).

PORT     STATE SERVICE VERSION
8080/tcp open  http    Apache httpd 2.4.43 ((Win64) OpenSSL/1.1.1g PHP/7.4.6)
|_http-title: mrb3n's Bro Hut
| http-open-proxy: Potentially OPEN proxy.
|_Methods supported:CONNECTION
|_http-server-header: Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 20.43 seconds

Heading over to port 8080 we can see the following

lets get feroxbuster runnnig and see if we can find any hidden web pages

hunting around the website, within the contact.php we do find the application running the web app

we can try to find any vulnerabilities associated with this software, after abit of googling we find

we can utilise the following exploit to gain a shell on the target

we now have a shell on the target machine

we do have limited functionality within this shell Lerts upload nc.exe and upgrade our shell

  1. Lets start a smb server on our local machine

  1. Lets copy nc.exe over to the target (from our shell)

  1. Now lets start a listner

  1. Now lets execute nc.exe and gain our shell

we have our shell

when we check netstat we can see two ports listening only within the local host

  • 3306 MySQL

  • 8888 XAmpp stack

Next lets grab the process ID of port 8888 (6044) and grep (findstr)

the PID does change every couple of seconds so to find it

We can see there is a .exe file being executed, Lets see if we can find it

Looking through the user shaun directory we do find it within the downloads directory

What we can do next is see if we can find any vulnerabilities associated with this program

  • we can see the version number of CloudMe being 1.11.2

Now to exploit this service, we will need to tunnel from our local machine to the target machine , we can use the tool chisel for this

more specifically the .exe executable

We can transfer via our smb server

  1. we will copy the Windows binary to the /programdata directory (where we will be staging in )

  1. Now we will run the Linux binary on our local machine in server mode

  1. Next from our target machine, we will run chisel as the client

  1. Now if we run netstat on our local machine we should we are listening on port 8888

Now that we have chisel set up Lets look at this exploit

The exploit

we can see the following

  • it opens a connection to the target on port 8888

  • it sends a buffer

pretty simple right

we can utilize msfvenom to generate our own payload that will return a stageless (can catch with nc) reverse tcp shell

Now we can change the payload within the existing exploit with our newly created payload we created with msfvenom

Now we can start our nc listener

and we can run the exploit

we now have a shell as administrator on the target machine

Last updated