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/pspy.md
View on GitHub# pspy
- **Category**: Post-Exploitation / Process Monitoring
- **Risk Level**: 🟢 Low
---
## 描述
无需 root 权限即可监控所有运行进程的工具。通过扫描 /proc 实时发现正在执行的命令(包括其他用户的进程),用于发现计划任务、以 root 身份执行的脚本等权限提升机会。
## 安装
```bash
# 下载(请至 https://github.com/DominicBreuker/pspy/releases 确认最新版本)
# 以下以 v1.2.1 为例,请替换为当前发布版本号
wget https://github.com/DominicBreuker/pspy/releases/download/v1.2.1/pspy64 -O /tmp/pspy64
wget https://github.com/DominicBreuker/pspy/releases/download/v1.2.1/pspy32 -O /tmp/pspy32 # 32位系统
# 也可通过 GitHub releases API 获取最新版本:
# curl -sL https://github.com/DominicBreuker/pspy/releases/latest | grep -oP 'href="[^"]+pspy64"' | head -1
# 传到目标
scp /tmp/pspy64 user@target:/tmp/
chmod +x /tmp/pspy64
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `pspy64` | 64 位 Linux 二进制文件 |
| `pspy32` | 32 位 Linux 二进制文件 |
| `-i <ms>` | 进程扫描间隔,单位为毫秒 |
| `-f` | 同时监控文件系统事件 |
| `-p` | 启用进程扫描(默认已启用) |
| `-r <dir>` | 监视指定目录下的文件系统事件 |
| `--help` | 查看所下载构建支持的可用选项 |
## 常用命令
```bash
# 基础运行(实时显示新进程)
/tmp/pspy64
# 降低 CPU 占用(每 1000ms 扫描一次)
/tmp/pspy64 -i 1000
# 同时监控文件系统事件
/tmp/pspy64 -f
# 32位系统
/tmp/pspy32
# 保存输出(后台运行一段时间再分析)
nohup /tmp/pspy64 -i 1000 > /tmp/pspy_output.txt 2>&1 &
sleep 120 # 等待 2 分钟
cat /tmp/pspy_output.txt | grep "UID=0" # 筛选 root 执行的命令
```
### 分析重点
```bash
# 关注 UID=0 执行的命令(root 身份)
cat /tmp/pspy_output.txt | grep "UID=0"
# 关注定期执行的命令(计划任务)
# 每隔固定时间出现的相同命令通常是 cron job
# 关注可写的脚本路径
# 如果 root 执行 /opt/backup.sh,而该文件你可以写入 → 提权机会!
```
## 注意事项
1. 至少运行 pspy 2–5 分钟以捕获所有 cron 任务——每 5 分钟或每小时执行的任务在更短的运行时间内不会出现。
2. 用 `grep "UID=0"` 过滤输出,专注于 root 执行的命令——这些是权限提升的机会所在。
3. 查找由 root 运行但当前用户可写的脚本——修改脚本内容可实现以 root 身份执行代码。
4. pspy 不需要 root 权限,也不向磁盘写入数据——可在任何 Linux 目标上安全运行,不会触发明显的检测。
5. 使用 `-f` 同时监控文件系统事件(inotify)——可发现表明备份任务或凭据加载操作的文件访问模式。
---
## 官方参考
- [pspy(GitHub)](https://github.com/DominicBreuker/pspy)
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 |