x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/reverse-engineering/tools/ldd.md
View on GitHub# ldd
- **Category**: Reverse Engineering / Binary & Library Analysis
- **Risk Level**: 🟢 Low
---
## 描述
打印可执行文件或共享库的共享库依赖关系。用于识别库劫持机会——如果二进制文件从可写入路径加载库,攻击者可以用恶意版本替换它。
## 安装
```bash
apt install libc-bin
```
## 参数说明
| 参数 | 说明 |
|-----------|-------------|
| `-v` | 详细——打印所有版本信息 |
| `-u` | 打印未使用的直接依赖(已链接但实际不需要的库) |
| `-d` | 执行数据重定位并报告缺失的函数 |
| `-r` | 执行数据和函数重定位并报告缺失的对象 |
## 常用命令
```bash
# 检查 SUID 二进制文件的库依赖(提权分析)
ldd /usr/bin/passwd
# 检查自定义应用中是否存在可写入的库路径
ldd /opt/custom_app/bin/app | grep -v '^/' # 未解析为绝对路径的库
# 详细输出:显示版本要求
ldd -v /usr/bin/sudo
# 检查缺失的对象(链接错误)
ldd -r /usr/bin/target
# 检查共享库本身加载的库
ldd /lib/x86_64-linux-gnu/libssl.so
```
## 注意事项
1. 未显示绝对路径的库(例如 `libfoo.so => not found`)表示动态链接器将搜索 `LD_LIBRARY_PATH`——这是一个劫持机会。
2. `ldd` 可能会在动态链接器下执行二进制文件以解析依赖关系。对于不受信任的二进制文件,更安全的替代方法是使用 `objdump -p <binary> | grep NEEDED` 或 `readelf -d <binary> | grep NEEDED`。
3. 库劫持需要在搜索路径中存在可写入目录,或能够设置 `LD_LIBRARY_PATH` / `LD_PRELOAD`。
4. 对 SUID 二进制文件进行完整的漏洞利用前评估时,请使用 `ldd`(依赖)+ `nm -D`(导入函数)+ `readelf -a`(安全标志)+ `checksec`(漏洞缓解)。
---
## 官方参考
- [ldd(1) — Linux manual page](https://man7.org/linux/man-pages/man1/ldd.1.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 |