x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/password/tools/crunch.md
View on GitHub# crunch
- **Category**: Password Attacks / Custom Wordlist Generation
- **Risk Level**: 🟢 Low
---
## 描述
根据指定字符集和长度规则生成自定义密码字典,适合已知密码规律(如"公司名+4位数字"、特定格式密码)的场景。可生成极大的字典文件,注意磁盘空间。
## 安装
```bash
sudo apt install crunch
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `min` | 最小密码长度 |
| `max` | 最大密码长度 |
| `charset` | 使用的字符集 |
| `-o FILE` | 输出到文件 |
| `-t PATTERN` | 指定模式(`@`=小写 `,`=大写 `%`=数字 `^`=特殊)|
| `-d N` | 限制连续相同字符数 |
| `-b SIZE` | 按文件大小分割输出 |
| `-c N` | 按行数分割输出 |
| `-l MASK` | 字面字符掩码 |
| `-p WORDS` | 排列组合模式 |
| `-q FILE` | 读取单词并排列组合 |
## 常用命令
```bash
# 生成 6-8 位纯数字字典
crunch 6 8 0123456789 -o /tmp/num_dict.txt
# 生成 8 位小写字母+数字
crunch 8 8 abcdefghijklmnopqrstuvwxyz0123456789 -o /tmp/alphanumeric.txt
# 使用模式(@=小写 ,=大写 %=数字 ^=特殊)
crunch 9 9 -t admin@@%% -o /tmp/admin_dict.txt # admin + 2小写 + 2数字
crunch 11 11 -t Company%%%% -o /tmp/company.txt # Company + 4数字
# ⚠️ 使用 -t 时,总长度(min=max)必须等于模式字符串的长度
# 常见密码规律(公司名+年份)
crunch 14 14 -t TargetCorp%%%% -o /tmp/target.txt
# 生成所有 4 位数字(PIN 码)
crunch 4 4 0123456789 -o /tmp/pins.txt
# 使用 gzip 压缩输出以节省磁盘(-z gzip)
crunch 8 8 abc123 -z gzip -o /tmp/small_dict.gz
# 排列组合模式(生成给定词集的所有排列)
# 注意:-p 接受以空格分隔的独立字符串作为参数
crunch 1 1 -p abc 123 # 生成所有提供词的全排列:"abc123" 和 "123abc"
# 注意:-p 模式下 min/max 值被忽略,但仍需作为位置参数提供
# 分割大字典(每份 100MB)
crunch 8 8 abcdefghijklmnopqrstuvwxyz -b 100mb -o START
```
## 注意事项
1. 生成完整字典可能占用 TB 级磁盘空间——使用 `-t` 模式或用 `-z gzip` 压缩输出。
2. 用 `-t` 模式指定密码格式——可针对性地大幅缩小字典规模。
3. 配合 `hashcat -a 0` 可边生成边破解,节省磁盘:
```bash
crunch 8 8 abc123 | hashcat -m 0 hash.txt -a 0
# 使用管道时 hashcat 自动检测 stdin 输入;无需额外参数
```
4. 使用 `-b 100mb -o START` 将大字典分割为可管理的块,便于分发或存储。
5. 对于已知规律(公司名+年份、姓名+生日)的密码,crunch 比 rockyou 等通用字典更有针对性。
---
## 官方参考
- [crunch Debian man page](https://manpages.debian.org/unstable/crunch/crunch.1.en.html)
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 |