> 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/linux-easy/delivery-hackthebox-writeup.md).

# Delivery HackTheBox Writeup

Writeup zur HackTheBox-Easy-Linux-Maschine Delivery mit Abdeckung von Virtual-Hosting-Enumeration, Missbrauch des Support-Ticket-Systems, Zugriff auf MatterMost, Informationsleck, mit praktischer Enumeration, Ausnutzung,

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

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

* Virtuelle Hosting-Enumeration
* Missbrauch des Support-Ticket-Systems
* Zugriff auf MatterMost
* Informationsleck
* Datenbank-Enumeration - MYSQL
* Hashes knacken
* Arbeiten mit Hashcat-Regeln, um Passwörter zu erstellen
* Arbeiten mit sucrack, um das Passwort eines Benutzers herauszufinden
  {% 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-79ad628220f3b172b553e1dc5ce6b3400861b925%2F%7B1C1F20B5-D840-4482-B0D2-8A05EADEA5E0%7D.png?alt=media" alt="" width="563"><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-b9bf9ee46870fbf2b852a30c03f74eb47b3d3221%2Fimage%20(750).png?alt=media" alt="" width="563"><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 -Pn --min-rate 5000 -vvv 10.10.10.222 -oG allPorts
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8a74350f3eb119a8afbc3b7d2819280420081066%2F%7B91218D2F-9795-451B-A2D3-A7DA3C8D2E7B%7D.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 (22,80,8085)

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3c4ab49ed40299ac3a2a48dff61cbded587ddee5%2F%7BC0B865A9-8259-4251-8974-92367092021F%7D.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 -p22,80,8065 10.10.10.222 -oN targeted
```

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

### Port 80:

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dd8d6212f4c55c0d8aae0f42acd1d8d497ffeccf%2F%7B7E0DE2F5-EC9E-4BD4-91C5-B604E84601EC%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Identifizierung von Informationen mit WhatWeb:**

Das Ausführen von WhatWeb enthüllt einen Benutzer **jane** mit der E-Mail-Adresse **<jane@untitled.tld>**.

```bash
whatweb 10.10.10.222
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ef7311d43754d35ef1fdcf99bcc463e04cd6ece9%2F%7BA379B407-C232-4203-BE82-1B31B7164832%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Wir finden außerdem eine Domain **delivery.htb** und eine Subdomain **helpdesk.delivery.htb**.

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

**Konfiguration der Datei /etc/hosts**

Wir fügen die IP-Adresse des Ziels unserer `/etc/hosts` Datei hinzu, um lokale DNS-Auflösungen zu erleichtern.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ea165e2aca091b10679d66b67ae5190fad15adb2%2F%7B929EEA18-AAD2-4AF3-A7A0-BDD4BF829C7A%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## **Support Center - HelpDesk :**

Das `helpdesk.delivery.htb` Die Subdomain ermöglicht das Erstellen von Support-Tickets. Wir versuchen, ein Konto mit den folgenden Informationen zu erstellen:

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2ffd217d03f72db81c67d2f5ff2ea6ab2e6d9c5e%2F%7BD0BF59CE-783B-4519-9920-BFD438BE8AC4%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Ein Ticket eröffnen**

* `jordan@delivery.com`

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-60b0971cd95ec0b95870385c73d16f17feb6d9f0%2F%7BE9D3738A-F8BD-442F-A91B-AD3077C4FDAA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Ein neues Ticket wird eröffnet, und wir erhalten eine E-Mail mit einer Kennung:

* **E-Mail** : <7990131@delivery.htb>
* **Ticket-ID**: 7990131

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2a05ab9277d075949b8335bae7d2eb3b499a121a%2F%7B744DC8C7-DE38-4AE0-8091-C986BC92526A%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Beim Prüfen des Tickets verwenden wir unsere eigene E-Mail-Adresse (**<jordan@delivery.com>**), obwohl wir es nicht erstellt haben, sowie die Nummer des erhaltenen Tickets (**7990131**).

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

Dies ermöglicht uns den Zugriff auf das zugehörige Postfach.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-0d04d5aee74f7725b3ce5f99479dd88d4706cb51%2F%7BF765C4C1-6CC7-4158-8A2F-8BFD11836AE4%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### Port 8065 - Mattermost

**Entdeckung von Mattermost:**

Port **8065** hostet ein **Mattermost** CMS.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d03beed59a0fe2b08233f92c0ea79307e535800d%2F%7B74803BDD-4207-423C-8AC2-DD0756456E5B%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Versuch, ein Konto zu erstellen:**

Wir versuchen, ein Konto zu erstellen, und verwenden dann die E-Mail-Adresse: <7990131@delivery.htb> Name: jordan1 Passwort Jordan1234#

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-14ed6fb9f657eb4cd89d2ba69fa2a30a8d685221%2F%7B08E0C8B3-F7E1-43BA-B28A-8CAAA206B347%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Wir erhalten eine Verifizierungsnachricht mit einem **token** um das Konto zu aktivieren:

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-80e4bccfe75fa0f66111bae824df89aed37670e6%2F%7BF545C6A6-80E3-49A4-BC01-CCDCEEC92F19%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```
http://delivery.htb:8065/do_verify_email?token=hs36amqfpkm3hcguxsmrton83e7a9k7xp595rga6zhwzd35awf1krpftfqink3go&email=7990131%40delivery.htb 
```

{% endcode %}

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-227fca13f3d9885b9a577961d587a2c5fbd4ac5e%2F%7B0231EB37-8E78-4441-AEC8-73D3796A5582%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Nach der Validierung melden wir uns mit unseren Zugangsdaten an und greifen auf das Mattermost **Verwaltungsoberfläche**.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-da7e288869b98202ba8c4018ff15d937e0493c4a%2F%7B9A62E0C9-F9A7-4243-AB2C-A76090AC0618%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Wiederherstellung von Zugangsdaten**

In dem **"Switch Channels"** Bereich finden wir eine Nachricht mit einem Benutzernamen und Passwort:

* **Benutzername**: `maildeliverer`
* **Passwort**: Youve/\_G0t/\_Mail!

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

Anschließend versuchen wir eine SSH-Verbindung mit diesen Zugangsdaten:

```bash
ssh maildeliverer@delivery.htb
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-646566bd8126b49ca038c67d77c8051e8cc885f7%2F%7B508B9289-B626-4B26-8F8B-41372EE0148E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### 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-e514e780cc3a8d545d8177da4591fc08a9725da2%2F%7B53F43C13-99E5-4DE3-8182-78E8398EAD51%7D.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## **Privilegieneskalation**

Wir gehen zum Root des Systems, im `/var/www/html/osticket` Ordner und filtern nach dem Wort **Passwort**:

```bash
grep -ir "password"
```

Wir finden nichts Interessantes.

Wir suchen nun nach Informationen für **Mattermost** durch das Filtern der laufenden Prozesse:

```bash
ps -faux
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-50dad9f9d5b851685ef9893776491ebdecd1ac58%2F%7B5CC7E834-B210-45C9-9EF2-31FCC3A089A5%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Wir bemerken, dass Mattermost installiert ist in `/opt` und finden eine **config.json** 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-52b8f00521f15fd4ed8b618dbff4f0583d4f0971%2Fimage%20(745).png?alt=media" alt=""><figcaption></figcaption></figure>

Beim Öffnen entdecken wir Zugangsdaten für die SQL-Datenbank:

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

* Benutzername: `mmuser`
* Passwort: `Crack_The_MM_Admin_PW`

### Verbindung zu MySQL

Wir verwenden diese Zugangsdaten, um eine Verbindung zur Datenbank herzustellen:

```bash
mysql -u mmuser -p
```

Wir listen die Datenbanken auf:

```sql
show databases;
use mattermost
```

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

Wir listen die verfügbaren Tabellen auf und beschreiben die Struktur der **Benutzer** Tabelle:

```sql
show tables;
describe Users;
```

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

Schließlich wählen wir den **Benutzername** und **Passwort** Spalten:

```sql
select Username, Password from Users;
```

Anschließend finden wir den **Hash des Root-Passworts:**

`$2a$10$VM6EeymRxJ29r8Wjkr8Dtev0O.1STWb4.4ScG.anuu7v0EFJwgjjO`

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

### 1. Brute Force - Hash

Wir verwenden **hashid** um den Hash-Typ zu identifizieren:

```bash
hashid hash
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8448e0fe7b5464461840cdfa5e400bc18bc52aec%2F%7B1694F1C2-3C17-42FB-9D7D-9BF0B3B59F4C%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Der Hash wird als **bcrypt**.

Mit **John the Ripper**, wir werden einen Brute-Force-Angriff starten, indem wir den **bcrypt** Format:

```bash
john --format=bcrypt hash -w /usr/share/wordlists/rockyou.txt
```

Es funktioniert jedoch nicht mit **rockyou.txt**, kein Passwort gefunden.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-817634bd743225fbfa7615f86df4ce121ba09fff%2F%7B38E73751-9A32-4FF2-8775-74B6670BA6A1%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Beim Beobachten des Gruppenchats bemerken wir, dass sie direkt sagen, dass das Passwort **"PleaseSubscribe!"** wiederverwendet wird. Dieses Passwort erscheint nicht in **rockyou.txt**, aber ein Hacker könnte **hashcat** verwenden, um Varianten zu generieren.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8b663765f8ae1a6da874930ff669e4ba5ea7fea4%2F%7BE041B89E-F414-4042-9D2A-D44922A37A3B%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### Passwortvarianten - Hashcat

**Generierung von Varianten mit Hashcat**

Mit **hashcat**, wir werden Variationen des Passworts erstellen:

```bash
hashcat --stdout -r /usr/share/hashcat/rules/best64.rule password
```

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

Wir werden dann versuchen, den Hash mit **hashcat** und das neue Wörterbuch:

```bash
hashcat -m 3200 -a 0 hash passwords
```

Das gefundene Passwort ist: **PleaseSubscribe!21**

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

### 2. Brute-Force auf "su" - sucrack

Wir werden einen Angriff gegen **su**:

```bash
sucrack -w 20 -u root passwords
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-aa63c15efc8aa14c8aa278bec6dab271b1f171be%2F%7B13E1E46B-97BA-494D-A41B-77447BA3BFCB%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Es sagt uns, dass das Passwort korrekt ist: **PleaseSubscribe!21**

Wir melden uns erfolgreich an als **root**.

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

### root.txt-Flagge :)

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ad23ad300c58f5976ba5d5f1cc18f111f1b89fa1%2Fimage%20(744).png?alt=media" alt="" width="530"><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-007cdc3dcb7f5c727487ac11fd1c5efda78991ee%2F%7BC516A959-09B3-4DAB-B667-FB312770BC66%7D.png?alt=media" alt="" width="498"><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/linux-easy/delivery-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.
