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/ghidra-headless.md
View on GitHub# Ghidra Headless
- **Category**: Reverse Engineering / Binary Analysis
- **Risk Level**: 🟡 Medium
---
## 描述
Ghidra 的 `analyzeHeadless` CLI 可在无 GUI 情况下执行导入、分析和脚本。仅在有明确问题和受限运行时间的目标二进制分析任务中使用。
## 安装
```bash
sudo apt install ghidra
/usr/share/ghidra/support/analyzeHeadless
```
> **Note**: 无头二进制文件位于 `/usr/share/ghidra/support/analyzeHeadless`。Kali 上默认 `$PATH` 中没有 `analyzeHeadless`;使用完整路径或创建符号链接。
## 参数说明
| 参数 | 说明 |
|------|------|
| `<project_location> <project_name>[/<folder_path>]` | 无头项目路径和名称(必需) |
| `-import [<directory>\|<file>]+` | 导入一个或多个文件或目录 |
| `-process [<project_file>]` | 处理项目中已导入的文件 |
| `-preScript <ScriptName>` | 分析前运行脚本 |
| `-postScript <ScriptName>` | 分析后运行脚本 |
| `-scriptPath "<path1>[;<path2>...]"` | 分号分隔的脚本目录 |
| `-propertiesPath "<path1>[;<path2>...]"` | 分号分隔的属性目录 |
| `-scriptlog <path>` | 脚本日志文件路径 |
| `-log <path>` | 日志文件路径 |
| `-overwrite` | 导入时覆盖已有项目文件 |
| `-recursive` | 递归导入目录 |
| `-readOnly` | 不保存更改到项目 |
| `-deleteProject` | 运行后删除项目 |
| `-noanalysis` | 导入但不运行自动分析 |
| `-processor <languageID>` | 指定处理器/语言 ID |
| `-cspec <compilerSpecID>` | 指定编译器规范 ID |
| `-analysisTimeoutPerFile <seconds>` | 限制每个文件的分析时间 |
| `-max-cpu <cores>` | 最大使用 CPU 核心数 |
| `-loader <loader name>` | 指定加载器 |
| `-mirror` | 本地镜像远程仓库 |
| `-keystore <KeystorePath>` | 服务器连接的密钥库路径 |
| `-connect [<userID>]` | 连接 Ghidra Server |
| `-librarySearchPaths <path1>[;<path2>...]` | 库搜索路径 |
## 常用命令
```bash
# 带 timeout 导入并分析单个二进制文件
/usr/share/ghidra/support/analyzeHeadless /tmp/ghidra_proj target_proj \
-import /usr/bin/target -analysisTimeoutPerFile 120
# 运行分析后脚本
/usr/share/ghidra/support/analyzeHeadless /tmp/ghidra_proj target_proj \
-import /usr/bin/target \
-scriptPath /tmp/ghidra_scripts -postScript ExportFunctions.java -deleteProject
# 处理已导入的二进制文件(不重新导入)
/usr/share/ghidra/support/analyzeHeadless /tmp/ghidra_proj target_proj \
-process target_binary -readOnly -postScript ListFunctions.java
# 从目录递归导入,不执行分析
/usr/share/ghidra/support/analyzeHeadless /tmp/ghidra_proj target_proj \
-import /tmp/samples/ -recursive -noanalysis
```
## 注意事项
1. 本工具不使用 Ghidra GUI 工作流。
2. 无头分析可能较慢;仅用于少数高价值二进制文件。
3. 快速分流优先使用 `strings`、`readelf`、`objdump`、`rabin2` 和 `radare2`。
---
## 官方参考
- [Ghidra GitHub](https://github.com/NationalSecurityAgency/ghidra)
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 |