x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/information-gathering/tools/trufflehog.md
View on GitHub# TruffleHog
- **Category**: Information Gathering / Secret Scanning
- **Risk Level**: 🟡 Medium
---
## 描述
扫描 git 仓库、文件系统、S3 存储桶和 CI/CD 系统以检测泄露的密钥,包括 API 密钥、密码、令牌和私钥。同时使用正则表达式模式和熵分析来检测密钥,并尽可能验证发现的凭据是否在实时服务上仍然有效。支持扫描完整的 git 历史记录,以发现曾被提交后又被删除的密钥。
## 安装
```bash
sudo apt install trufflehog
# 或从 GitHub releases 下载最新二进制文件
curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `git <repo_url>` | 扫描 git 仓库(本地路径或远程 URL) |
| `filesystem <path>` | 扫描文件系统路径 |
| `s3` | 扫描 S3 存储桶 |
| `github --org <org>` | 扫描 GitHub 组织中的所有仓库 |
| `gitlab --group <group>` | 扫描 GitLab 组中的所有仓库 |
| `docker --image <image>` | 扫描 Docker 镜像 |
| `syslog` | 扫描 syslog |
| `--json` | JSON 输出 |
| `--no-verification` | 跳过实时凭据验证 |
| `--include-detectors <list>` | 逗号分隔的要包含的检测器类型列表 |
| `--exclude-detectors <list>` | 逗号分隔的要排除的检测器类型列表 |
| `--since-commit <hash>` | 扫描此提交哈希之后的提交 |
| `--branch <name>` | 扫描特定分支 |
| `--results <filter>` | 按结果类型过滤输出:`verified`、`unknown`、`unverified` |
| `--concurrency <n>` | 并发工作线程数 |
## 常用命令
```bash
# 扫描远程 git 仓库(完整历史)
trufflehog git https://github.com/target-org/target-repo.git
# 扫描本地 git 仓库
trufflehog git file:///path/to/repo
# 扫描文件系统目录
trufflehog filesystem /path/to/project
# 扫描 GitHub 组织中的所有仓库
trufflehog github --org target-org --token $GITHUB_TOKEN
# JSON 输出用于自动化
trufflehog git https://github.com/target-org/target-repo.git --json > /tmp/secrets.json
# 仅显示已验证(确认活跃)的密钥
trufflehog git https://github.com/target-org/target-repo.git --results verified
# 仅扫描最近的提交
trufflehog git https://github.com/target-org/target-repo.git --since-commit abc123
# 跳过实时验证(更快、更安静)
trufflehog git https://github.com/target-org/target-repo.git --no-verification
```
## 注意事项
1. 已验证的结果表明 trufflehog 通过在实时服务上测试确认了凭据仍然有效——这是需要立即修复的 Critical 级别发现。
2. 默认扫描 git 仓库的完整历史——曾被提交后又删除的密钥仍可从 git 历史中恢复,仍具有可利用性。
3. 使用 `--json` 输出以集成到 CI/CD 管道和自动化报告中。
4. 对于大型组织,使用 `github --org` 配合个人访问令牌系统地扫描所有仓库。
5. 配合人工审查:高熵字符串可能产生误报——在纳入报告前请验证发现结果。
---
## 官方参考
- [TruffleHog (GitHub)](https://github.com/trufflesecurity/trufflehog)
- [Kali trufflehog](https://www.kali.org/tools/trufflehog/)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |