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/chntpw.md
View on GitHub# chntpw
- **Category**: Password Attacks / Offline Windows Password Recovery
- **Risk Level**: 🟡 Medium
---
## 描述
用于查看和修改 Windows NT/2000/XP 至 Windows 8.1 SAM 数据库文件中用户密码的离线工具。通过直接编辑 Windows 注册表文件实现——无需登录 Windows。还包含交互式注册表编辑器和十六进制编辑器。在后渗透和取证场景中,当具备物理访问权限或文件系统访问权限时,可用于恢复或重置 Windows 凭据。
## 安装
```bash
sudo apt install chntpw
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `<SAM file>` | Windows SAM 文件路径 |
| `-u <username>` | 要交互编辑的用户名或 RID(如 0x3e9) |
| `-l` | 列出 SAM 数据库中的所有用户 |
| `-i` | 交互式菜单系统 |
| `-e` | 注册表编辑器(功能有限,支持写入) |
| `-d` | 进入缓冲区调试器(十六进制编辑器模式) |
| `<system file>` | SYSTEM 配置单元文件(启用 syskey 时必须提供) |
## 常用命令
```bash
# 首先挂载 Windows 分区
mount /dev/sda2 /mnt/windows
# 列出 SAM 数据库中的所有用户
chntpw -l /mnt/windows/Windows/System32/config/SAM
# 交互式重置 Administrator 密码
chntpw /mnt/windows/Windows/System32/config/SAM
# 非交互式重置指定用户密码
chntpw -u "jdoe" /mnt/windows/Windows/System32/config/SAM
# 带 SYSTEM 配置单元(启用 syskey 时必须)
chntpw /mnt/windows/Windows/System32/config/SAM /mnt/windows/Windows/System32/config/SYSTEM
# 交互式用户选择菜单
chntpw -i /mnt/windows/Windows/System32/config/SAM
# 从 Kali Live 启动(常见用法)
# 从 USB 启动 Kali,挂载 Windows 磁盘,运行 chntpw
```
## 注意事项
1. 需要物理访问或文件系统访问权限(如通过 LFI、备份或物理访问)——无法远程使用。
2. 在渗透测试中,若通过 LFI、备份或物理访问获得 Windows 文件系统访问权限,chntpw 可重置或清空 SAM 文件中的本地账户密码。
3. Windows 运行时 SAM 文件被锁定——需从 Kali Live 介质启动或通过其他系统访问。
4. 启用了 BitLocker 的现代 Windows 会加密 SAM 文件——没有密钥时 chntpw 无法访问加密卷。
5. 对于有 Shell 访问权限的在线 Windows 系统,使用 impacket-secretsdump 或 lsassy 更合适——chntpw 需要离线文件访问。
---
## 官方参考
- [chntpw man page](https://manpages.debian.org/chntpw)
- [Kali chntpw](https://www.kali.org/tools/chntpw/)
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 |