Driver Write-up - HTB

Recon

Starting off with an all port syn scan:

sudo nmap -sS -Pn -n -p- 10.10.11.106 -oN all_syn_scan.txt 

#Output:
PORT     STATE SERVICE
80/tcp   open  http
135/tcp  open  msrpc
445/tcp  open  microsoft-ds
5985/tcp open  wsman

Now taking these and running a full vulnerability scan over it:

PORTS=$(grep "open" all_syn_scan.txt | awk -F '/' '{print $1}' | tr '\n' ',' | sed 's/,$//'); sudo nmap -sVC -Pn -n -p $PORTS 10.10.11.106 -oN nmap_svc_scan.txt

PORT     STATE SERVICE      VERSION
80/tcp   open  http         Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
| http-methods: 
|_  Potentially risky methods: TRACE
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
| http-auth: 
| HTTP/1.1 401 Unauthorized\x0D
|_  Basic realm=MFP Firmware Update Center. Please enter password for admin
135/tcp  open  msrpc        Microsoft Windows RPC
445/tcp  open  microsoft-ds Microsoft Windows 7 - 10 microsoft-ds (workgroup: WORKGROUP)
5985/tcp open  http         Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
Service Info: Host: DRIVER; OS: Windows; CPE: cpe:/o:microsoft:windows

HTTP and SMB seem to be our enumeration targets.

Enumeration

SMB:

Starting off with a quick smbclient null session:

It gets denied. Let's go on HTTP and see what's up.

HTTP:

We get a login form, our real hekerman instincts type admin:admin and we get access! 📀

Well, after checking the web app, I found that it has upload function.

I checked for upload directory, but nothing. Although there is a clue.

FOOTHOLDING

So, there is someone permanently opening these firmware files we send. I tried various methods with msfvenom and nc, but no shell was coming. So I realized, it must be .scf!

You might ask yourself why scf? Well when someone browses to a directory and a .scf is in it, it automatically reads it. It has been originally designed for Windows 95/98 for shortcut purposes.

So create our malicious .scf file:

Turn up Responder:

Upload the file on the web app.

Receive the hash!

Add the hash to a file and load-up hashcat on it:

Cracked! tony:liltony. Remember WinRM is on, so let's use it to connect.

PrivEsc

Checking the powershell history, we can see:

Now, let's check Printer Drivers:

Smells like PrintNightmare.

I got this PoCarrow-up-right.

Craft a payload with msfvenom:

Set-up a netcat listener.

Now, turn on smb server:

Run the PoC:

Mine threw some errors, but:

Last updated