> 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-vulnerabilities/race-condition-attack/race-condition-rce-pentesting-web.md).

# 競合状態 RCE

競合状態 RCE に関する、Webアプリケーションのペネトレーションテスト、エクスプロイトのワークフロー、ペイロード検証、影響評価、修正の文脈でのメモ。

ここが、私たちが **入力します** 私たちの名前：

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-00efc81177cd0e4f941b5bd51dc4facd053e7c11%2FPasted%20image%2020231115212052.png?alt=media" alt=""><figcaption></figcaption></figure>

この名前 **URLに表示されます** 以下の形式でGETを使います：

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2d03b65f029d1445178712a1a92eb30d5bcaec7c%2FPasted%20image%2020231115212124.png?alt=media" alt=""><figcaption></figcaption></figure>

ここに、侵害を試みるコードがあります。これは一時的な **hello.sh** 指定された名前のファイルを作成します：

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d6fac087e80e607d5040e440156daacfd9a93e6d%2FPasted%20image%2020231115213338.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-1327098d491506239429cdd30b19e3304817feb3%2FPasted%20image%2020231115213535.png?alt=media" alt=""><figcaption></figcaption></figure>

これは、Bashが実行されているため、私たちは **コマンドを実行できます**、ただしこの場合はエラーが発生します：

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9bbdc0deeb4cbb1873e27a5acf08cab77178066f%2FPasted%20image%2020231115214401.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-20d4f7c432a32021596b8458a28ac87a132aff5d%2FPasted%20image%2020231115214956.png?alt=media" alt=""><figcaption></figcaption></figure>

私たちは皆、いくつかの **ミリ秒** スクリプトが実行され、検証される前に、多数のリクエストを送信して **コンテンツを表示することに成功し**:

```bash
whithe true; do cat hello.txt | grep -v "test"; done

```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e2ee5a28518961b406941aadd4f4dd38b15c5432%2FPasted%20image%2020231115215724.png?alt=media" alt=""><figcaption></figcaption></figure>

実際のケースで、私たちが **アクセスできない** 「hello.txt」ファイルに対して、私たちは **curl** 次のように

1. 私たちは設定します **リスナーのリクエストを** 私たちが関心のあるフィールドでフィルタリングし：

```bash
whithe true; do curl -s -X GET 'http://localhost:5000/?action=run' | grep "Check this out" | html2text | xargs; done

```

2. 総当たり攻撃を開始します **条件が満たされるまで**

```bash
whithe true; do curl -s -X GET 'http://localhost:5000/?person=`id`&action=validate'; done

```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7c742ebdcf49ccbdf979b44f0d716a8b4cb9b4ef%2FPasted%20image%2020231115223537.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-vulnerabilities/race-condition-attack/race-condition-rce-pentesting-web.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.
