> 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/information-disclosure/information-disclosure-via-version-control-history.md).

# バージョン管理履歴による情報漏えい

バージョン管理履歴による情報漏えいの PortSwigger Web Security Academy ラボ向けノート。攻撃フロー、ペイロードテスト、Burp Suite による検証、および是正策の文脈を含みます。

### バージョン管理履歴における情報漏えい

**ラボの説明**

このラボでは、バージョン管理リポジトリの履歴を通じて機密情報が漏えいしています。 / 目的はユーザーのパスワードを取得することです **administrator**、その後、このアカウントでログインしてユーザーを削除します **carlos**.

**初期分析**

アプリケーションを調べると、ディレクトリの存在が確認できます **`.git`** ウェブサーバーから直接アクセスできます。

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

これは、Gitリポジトリ全体が公開されていることを示しており、ソースや変更履歴を取得できる可能性があります。

**悪用**

**Gitリポジトリの抽出** / git-dumperツールを使って、次の `.git` ディレクトリ:

```bash
git-dumper https://0a7800030384626580b39ee5001e00b1.web-security-academy.net/.git .git
```

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

**コミット履歴の分析** / リポジトリがローカルで再構築されたら、コミット履歴を確認します:

```bash
git log
```

分析の結果、あるコミットに管理者パスワードの削除が含まれていることがわかります。

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

**差分の確認** / このコミットの正確な内容を確認し、削除された情報を特定します:

```bash
git log -p ab875bcd9cf3ea84ad6af9471521aea4c3a1852d
```

表示された差分から、ユーザーのパスワードを見つけることができます **administrator**.

* q0b3xu3ko6pqcqdjofrq

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-16a7b141e1d6ca0b25e89b920d677b4cdac7702d%2Fimage%20(210).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/information-disclosure/information-disclosure-via-version-control-history.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.
