GiTaDi-CrEaTe/repo-bleed
GitHub: GiTaDi-CrEaTe/repo-bleed
一款高速 Git 历史扫描器,能够检测并定位仓库提交中泄露的 API 密钥与凭证,并通过重写提交历史将敏感文件永久抹除。
Stars: 4 | Forks: 0
# REPO-BLEED // Git 历史机密扫描器





**REPO-BLEED** 是一款高速、零内存开销的安全工具,旨在扫描整个 Git 仓库历史,查找泄露的 API 密钥、token 和私有凭证。它采用了一种战术性的“nuke”协议,能够精准地重写 Git 提交树,将被污染的文件永久抹除。
## ⚡ 核心架构与逻辑
Repo-Bleed 专为处理大规模企业级仓库而设计,不会导致系统内存崩溃。
* **零开销流式传输:** 引擎没有将 Git 历史加载到 RAM 中,而是利用 `subprocess.Popen` 创建直接的数据流。它通过 Python 生成器循环逐行读取 Git 补丁树,对数据进行评估并立即丢弃,从而保持近乎于零的内存占用。
* **预编译启发式检测:** 利用预编译的 Regex 引擎来检测 AWS Access Keys、Stripe API、RSA Private Keys 以及通用的机密赋值语句 `(api_key, token, secret)`。
* **战术级载荷摧毁 (Nuke):** 自动化了危险的 `git filter-branch` 协议。在重写历史以清除目标文件后,它会强制执行立即的垃圾回收(`git reflog expire` 和 `git gc --prune=now`),以便从本地 `.git` 数据库中粉碎孤立的内存对象。
## 🚀 执行与 CLI 协议
```
### 1. 安装
Clone the repository and install the CLI globally via the provided `pyproject.toml` build system:
git clone [https://github.com/GiTaDi-CrEaTe/repo-bleed.git](https://github.com/GiTaDi-CrEaTe/repo-bleed.git)
cd repo-bleed
pip install .
2. Stream Scan (Detection)
Run the scanner in any local Git repository. The engine will parse the entire commit tree across all branches for exposed signatures.
Bash
# 扫描当前目录
repo-bleed scan
# 扫描特定 repository 路径
repo-bleed scan /path/to/target/repo
3. Tactical Nuke (Eradication)
If a leak is detected, use the nuke command to rewrite history and destroy the target file across all branches and commits.
Bash
repo-bleed nuke backend/config/secrets.yml
⚠️ WARNING: This is a destructive action. You must run git push origin --force --all afterward to overwrite the remote server.
🌐 Web Dashboard (React/Vite)
Repo-Bleed is currently being integrated with a high-performance React 19 dashboard for visual threat tracking. To boot the local frontend environment:
Bash
cd repo-bleed-web
npm install
npm run dev
⚙️ Tech Stack
Core Engine: Python 3, subprocess pipes, Pre-compiled re modules
Version Control Interface: Native Git CLI commands, Git Garbage Collection
Frontend UI: React 19, Vite, Tailwind CSS (In Development)
Author: Adi
```
标签:Git历史取证, Python, React, StruQ, Syscalls, 无后门, 逆向工具