x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/reporting/tools/pandoc.md
View on GitHub# pandoc
- **Category**: Reporting / Document Format Conversion
- **Risk Level**: 🟢 Low
---
## 描述
通用文档格式转换工具,支持 Markdown/HTML/LaTeX/Word/PDF 等 40+ 格式互转。渗透测试场景中常用于将 Markdown 测试笔记转换为专业 Word/PDF 报告,可配合自定义模板。
## 安装
```bash
sudo apt install pandoc
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `-o <file>` | 输出文件 |
| `--pdf-engine <engine>` | PDF 渲染引擎 |
| `--toc` | 包含目录 |
| `-V <key>=<value>` | 模板变量 |
| `--reference-doc <file>` | 样式参考文档 |
## 常用命令
```bash
# Markdown → PDF
pandoc report.md -o report.pdf
# 注意:默认 PDF 引擎为 pdflatex,如未安装请执行:
# sudo apt install texlive-latex-base
# 使用 wkhtmltopdf 引擎(更好的 CSS/HTML 样式支持,无需 LaTeX)
# sudo apt install wkhtmltopdf
pandoc report.md -o report.pdf --pdf-engine=wkhtmltopdf
# Markdown → Word(.docx)
pandoc report.md -o report.docx
# 使用自定义 Word 模板
pandoc report.md --reference-doc=template.docx -o report.docx
# Markdown → HTML
pandoc report.md -o report.html --standalone --css=style.css
# pandoc 默认样式包含 max-width: 36em——移除它以使用完整页宽
sed -i 's/max-width: 36em;//' report.html
# 多个 Markdown 文件合并
pandoc intro.md findings.md appendix.md -o full_report.pdf
# 添加元数据(使用 -V 传递模板变量,或在 .md 文件中使用 YAML 前置块)
pandoc report.md -o report.pdf \
-V title:"Penetration Test Report" \
-V author:"Security Team" \
-V date:"2024-01-01"
# 注意:-M 设置元数据变量,-V 设置模板变量。大多数模板使用 -V。
# 生成带目录的 PDF
pandoc report.md -o report.pdf --toc --toc-depth=3
```
### 配合渗透测试的 Markdown 报告模板
```bash
# 创建报告模板
cat > /tmp/report-template.md << 'EOF'
---
title: Penetration Test Report
author: Tester
date: $(date +%Y-%m-%d)
---
# Executive Summary
# Findings Summary
# Detailed Findings
# Appendices
EOF
# 转换为 PDF
pandoc /tmp/report-template.md -o /tmp/report.pdf --pdf-engine=wkhtmltopdf
```
## 注意事项
1. 默认 PDF 引擎(`pdflatex`)需要安装 `texlive-latex-base`——使用 `--pdf-engine=wkhtmltopdf` 可无需 LaTeX 即实现基于 HTML 的 PDF 渲染。
2. 使用自定义 Word 模板(`--reference-doc=template.docx`)匹配客户品牌风格——可用 `pandoc -o template.docx --print-default-data-file reference.docx` 提取默认模板。
3. Markdown 文件中的 YAML 前置块可直接设置文档元数据(标题、作者、日期),无需在命令行中使用 `-V` 参数。**当标题包含非 ASCII 字符时,必须使用前置块而非 `--metadata title=`**——通过 SSH/expect 传递中文等多字节文本会导致生成的 `<title>` 标签编码损坏。
4. 一条命令可合并多个 Markdown 文件——按顺序传入即可:`pandoc recon.md scanning.md findings.md -o report.pdf`。
5. 使用 `--toc --toc-depth=3` 在 PDF 和 Word 输出中自动生成带链接的目录。
---
## 官方参考
- [Pandoc 官方网站](https://pandoc.org/)
- [Pandoc 用户手册](https://pandoc.org/MANUAL.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 |