> 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/authentication/username-enumeration-via-response-timing.md).

# レスポンス時間を利用したユーザー名列挙

レスポンス時間を利用したユーザー名列挙の PortSwigger Web Security Academy ラボ向けノート。攻撃フロー、ペイロードテスト、Burp Suite による検証、および是正策の文脈を含みます。

### レスポンス時間によるユーザー名列挙

このラボは、レスポンス時間に基づくユーザー名列挙に対して脆弱です。これを解決するには、有効なユーザー名を特定し、パスワードに対してブルートフォース攻撃を行い、その後アカウントページにアクセスする必要があります。

```bash
あなたの認証情報: wiener:peter
```

### **初期分析**

多数のパスワードを試すと、アプリケーションは試行回数が過剰に検出されたことを示すエラーメッセージを表示します。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-18e4eee134747be67f320dc7e8362dc65968a908%2F%7B94C85D5E-85D5-4FD4-A779-8BCC8351A49E%7D.png?alt=media" alt="" width="477"><figcaption></figcaption></figure>

この保護を回避するため、次のヘッダーを追加します:

```bash
X-Forwarded-For: 127.0.0.2
```

### **レスポンス時間の測定**

非常に長い **パスワード** ユーザー向けに `wiener`:

{% code overflow="wrap" %}

```bash
username=wiener&password=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
```

{% endcode %}

すると、応答が **3秒** で返ってくることが確認できます。

一方、同じリクエストを無効なユーザー名\*\*で送信すると、応答は **ほぼ瞬時**:

```bash
username=dwdwd&password=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
```

この違いにより、有効な **username** ものと無効なものを区別できます。

#### **Intruderでのリスト**

Intruderでは、 **Pitchfork** 手法を使用します。

* 1つ目の位置: の一覧 **ユーザー名** テスト対象

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-197dcb9591365ae17191442c5a8886be433599ac%2F%7B6B917060-177C-43FB-BC6C-A9A265F7CEFA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

2つ目の位置: の一覧 **異なるIPアドレス** を `X-Forwarded-For`

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d04b41d186f46f44b1b240c2812a9c6587bb362f%2F%7B4501EB8A-7BA4-4D12-A530-6A2BCF8616AF%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-bb65673524388490f1db31021b3246baa6780b5a%2F%7B0E72DC9F-1194-4CC3-BE7B-27566B70ACC9%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

このフィールド **応答が完了** が分析されます:

有効なユーザーに関連するレスポンスは、応答時間が著しく長くなります（Apacheでははるかに大きい値が示されます）。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c15e53d3534008714c11158246a43fbb571d8cc5%2F%7B863369CA-5117-4A5C-8AE6-F62933497E92%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-4748af9aab774dc58ed5e790387038593c0c6afb%2F%7BC272F45E-E8D1-463F-9DD9-995AB7B1B41C%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

パスワード **chelsea** を使った試行では異なる応答が返ります: **302 Found**。これは認証が成功したことを示しています。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-aaa7587356864b4fb30b590ba5c9c9a4b5027b5b%2F%7B122670AB-B019-411C-BF83-2B4DA65EB3EF%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-e6e8b8d15f2bf424b2259fea3884765f23561860%2F%7B815C9DA3-77D7-4CCE-8B13-27F346874840%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/authentication/username-enumeration-via-response-timing.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.
