Git

Tip

AWSハッキングを学び、実践する:HackTricks Training AWS Red Team Expert (ARTE)
GCPハッキングを学び、実践する:HackTricks Training GCP Red Team Expert (GRTE) Azureハッキングを学び、実践する:HackTricks Training Azure Red Team Expert (AzRTE)

HackTricksをサポートする

URLから .git フォルダをダンプするには https://github.com/arthaud/git-dumper

内容を確認するには https://www.gitkraken.com/ を使用してください

web アプリケーションで .git ディレクトリが見つかった場合、wget -r http://web.com/.git. を使って全コンテンツをダウンロードできます。 その後、git diff で変更点を確認できます。

ツール: Git-Money, DVCS-Pillage and GitTools は git ディレクトリの内容を取得するために使用できます。

ツール https://github.com/cve-search/git-vuln-finder はコミットメッセージ内の CVE やセキュリティ脆弱性に関するメッセージを検索するために使用できます。

ツール https://github.com/michenriksen/gitrob は組織およびその従業員のリポジトリ内で機密データを検索します。

Repo security scanner はコマンドラインベースのツールで、開発者が誤って機密データを push してしまった GitHub のシークレットを発見することを目的に作られています。他と同様に、パスワード、秘密鍵、ユーザー名、トークンなどを見つけるのに役立ちます。

ここで github dorks に関する調査を参照できます: https://securitytrails.com/blog/github-dorks

Faster /.git dumping & dirlisting bypass (2024–2026)

  • holly-hacker/git-dumper は classic GitTools dumper を並列フェッチ対応で書き直した 2024 年のリライトで(>10x の高速化)。例: python3 git-dumper.py https://victim/.git/ out && cd out && git checkout -- .
  • Ebryx/GitDump.git/index, packed-refs などからオブジェクト名をブルートフォースして、ディレクトリトラバーサルが無効でもリポジトリを復元します: python3 git-dump.py https://victim/.git/ dump && cd dump && git checkout -- .

ダンプ後の迅速なトリアージ

cd dumpdir
# reconstruct working tree
git checkout -- .
# show branch/commit map
git log --graph --oneline --decorate --all
# list suspicious config/remotes/hooks
git config -l
ls .git/hooks

シークレット/資格情報探索(現行ツール)

  • TruffleHog v3+: entropy+regex と自動の Git 履歴走査。 trufflehog git file://$PWD --only-verified --json > secrets.json
  • Gitleaks (v8+): 高速な regex ルールセット。展開済みツリーまたは履歴全体をスキャン可能。 gitleaks detect -v --source . --report-format json --report-path gitleaks.json

参考

Tip

AWSハッキングを学び、実践する:HackTricks Training AWS Red Team Expert (ARTE)
GCPハッキングを学び、実践する:HackTricks Training GCP Red Team Expert (GRTE) Azureハッキングを学び、実践する:HackTricks Training Azure Red Team Expert (AzRTE)

HackTricksをサポートする