Grandpa HTB

IP

10.10.10.14

initial nmap scan

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

we can see we only have port 80 up and running on the target, Lets run a more in-depth nmap scan and see if we can find anything else on the machine

sudo nmap -sCV -p80 -oA Port_scan 10.10.10.14

results

PORT   STATE SERVICE VERSION
80/tcp open  http    Microsoft IIS httpd 6.0
|_http-title: Under Construction
|_http-server-header: Microsoft-IIS/6.0
| http-webdav-scan: 
|   Public Options: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
|   WebDAV type: Unknown
|   Server Type: Microsoft-IIS/6.0
|   Server Date: Sat, 30 Dec 2023 02:16:39 GMT
|_  Allowed Methods: OPTIONS, TRACE, GET, HEAD, COPY, PROPFIND, SEARCH, LOCK, UNLOCK
| http-methods: 
|_  Potentially risky methods: TRACE COPY PROPFIND SEARCH LOCK UNLOCK DELETE PUT MOVE MKCOL PROPPATCH
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

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

We can see the following

  • We have a Microsoft IIS server version 6.0 (outdatted)

  • the WebDAV protocol is enabled meaning this enables users the ability share, copy, move and edit etc files through the web server

Lets check out the web server

we can see the following

we can see the website administrator has not created a defualt page

for good measures well use feroxbuster and see if we can find anything interesting

  • /images

Since we now webdav is enabled, this seems like a good place to find a attack vector

we have the supported methods, we found in our nmap scan

  • TRACE: Echoes back the received request, can be useful for debugging

  • COPY: Copies a resource from one location to another

  • PROPFIND: Retrieves properties of a resource

  • SEARCH: Performs a search based on a given query

  • LOCK: Locks a resource, preventing other processes from modifying it.

  • UNLOCK: Releases a lock on a resource

  • DELETE: Deletes a specified resource

  • PUT: Uploads a specific resource

  • MOVE: Moves a resource from one location to another

  • MKCOL: Creates a new collection (e.g a directory)

  • PROPPATCH: Modifies the properties or a resource

we can do some basic enumeration

Lets check if we can upload a file and what exttentions the target will allow us to

we can use davtest

we can see we have a successful connection to the webdav server, but we cannot upload (PUT) anything to the server to the server

We did find CVE-2017-7269arrow-up-right after a bit of reading, this could be our attack vector

Quick google search we find a working exploit

For this to work we need to set up a netcat listner and run the exploit

  1. start a listner

  1. run the exploit

we now have a shell on the target

Lets gather some information of the system

we can see we are dealing with an old machines that has not been updated for some time, we can feed this to wesng and see if there are any exploits we can utilise

  • we now have a file of possible exploits we can run on the target

We also utilise windows-exploit suggestor as i have had the best luck from it

we have te following results

Lets get some information about our current user

Possible attack (juicy potato)

Lets try ms15-051 using the following exploit code

Once we have downloaded the code and unzipped it onto our local machine we need to transfer this to our target machine

  1. Lets start a smb server on our local machine

  1. Lets copy the exploit to our target machine

Transfered over no problem we just now need netcat for windows so we can start another shell

transfer over netcat via smb

While trying run the exploit, ran into some problems

Since we have the SeImpersonatePrivilege enabled and it is a Windows server 2003 we can use the following exploit 'churrasco.exe` to perform some token manipulation

Lets download our files again

  • quick note I had problems with nc.exe and the only version I found that worked was /usr/share/seclists/SecLists-master/Web-Shells/FuzzDB/nc.exe (seclists nc.exe version)

now once we run the exploit

we can see we have established another shell as the user

Last updated