> 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/deserialization-attack/php-deserialization-rce-pentesting-web.md).

# PHP デシリアライズ RCE

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

## デシリアライズ（PHP）

pingを送信できるウェブサイトを見つけました **pingを送信する**:

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5e16e8fd5f084cdb0a2ae04ca094bd86a5cb032d%2FPasted%20image%2020231002234359.png?alt=media" alt="" width="563"><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-93fd74e84469abae072c02fc08de9eefe3518510%2FPasted%20image%2020231002235146.png?alt=media" alt="" width="563"><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-b4e97364323522e72533c66ffeb9e50cb2216f03%2FPasted%20image%2020231002235212.png?alt=media" alt="" width="530"><figcaption></figcaption></figure>

私たちは自分たちの **攻撃者のIPアドレス** に ping を送信し、リクエストを〜で傍受します [Burp](/ja/hacking-tools/web/burpsuite.md):

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

その **PHP** 私たちが直面しているコードは次のようなものです：

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

コードを解析した結果、変更することで **$isValid** に `true` そしてリバースシェルを **ipAddress** ある **;** コマンド実行が引き起こされるはずです：

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

次に、私たちは **シリアライズする** ファイルを再び〜で **PHP**:

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

次の **Netcat**、ポートで待ち受けます **443** そしてシェルを受け取ります：

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b9dcf3fd27f4acd8feaccfbcd7ddfdb51f7b543f%2FPasted%20image%2020231003002552.png?alt=media" alt="" width="563"><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/deserialization-attack/php-deserialization-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.
