> 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-server-side-request-forgery-ssrf/ssrf-api-pentesting-web.md).

# SSRF API

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

## [SSRF](/ja/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-server-side-request-forgery-ssrf.md):

「Browse」ボタンを使うと、書籍の表紙を表す画像であることが想定されるファイルをアップロードできます。一方、テキストフィールド「Cover URL linked to your book」にはURLを入力でき、サービスがそれを取得して画像をダウンロードします。

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

#### **開始** [**Burp Suite** ](https://hacking-notes-jordan.gitbook.io/notes/autres/burpsuite)**:**

画像がサーバーにアップロードされると、保存場所へのリンクが提供されます。

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

そこで 65,535 個のポートに対してブルートフォース攻撃を行い、5000番ポートだけが異なる応答を返すことを確認します。

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

内部の5000番ポートの内容を確認すると、ファイルをアップロードできることが分かります。

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

このJSONファイルには、関連するルートとともに内部APIが一覧化されています。その中でも、ルート `message/authors` は特に重要と思われます。

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

したがって、Burp Suiteを使って、以下のアドレスの5000番ポート経由でそのファイルにアクセスします：

```url
http://127.0.0.1:5000/api/latest/metadata/messages/authors

```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f08219a35902676466733c842c69c19c70985fb2%2Fimage%20(2240).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-2102d6cb0943845aa378bdf9dbd1e9321a189a47%2Fimage%20(2241).png?alt=media" alt=""><figcaption></figcaption></figure>

このファイルには、平文のユーザー名とパスワードも見つかります `dev:dev080217_devAPI!@`

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a2765810dd3026cc971f04f81fbba9b0fdd72b2a%2Fimage%20(2242).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/owasp-top-10-vulnerabilities/vulnerability-server-side-request-forgery-ssrf/ssrf-api-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.
