S8C88/ReportGen
GitHub: S8C88/ReportGen
一款渗透测试报告生成器,通过导入 JSON 格式的漏洞数据自动生成包含 CVSS 评分和严重性分级的 Markdown/HTML 报告。
Stars: 0 | Forks: 0
# ReportGen — 渗透测试报告生成器
从 JSON 导入漏洞发现,生成 markdown/HTML 报告。支持严重性分级、CVSS v3.1 评分和执行摘要。
## 架构
```
graph TD
subgraph "Input"
JSON["findings.json
(findings + metadata)"] end subgraph "ReportGen Engine" FM["Finding Model
(title, severity, CVSS)"] CVSS["CVSS Calculator
(v3.1 Base Score)"] SM["Severity Classifier
(Critical → Info)"] ES["Executive Summary
Generator"] TD["Technical Details
Builder"] end subgraph "Output" MD["Markdown Report"] HTML["HTML Report
(styled)"] end JSON --> FM FM --> SM FM --> CVSS FM --> ES FM --> TD SM --> MD CVSS --> MD ES --> MD TD --> MD MD --> HTML style JSON fill:#1a237e,stroke:#3949ab,color:#fff style MD fill:#004d40,stroke:#00796b,color:#fff style HTML fill:#004d40,stroke:#00796b,color:#fff ``` ### 数据流 ``` sequenceDiagram participant U as User participant RG as ReportGen participant F as File System U->>RG: load_findings_from_json("findings.json") RG->>F: read JSON F-->>RG: findings data RG->>RG: parse & validate RG->>RG: classify severities RG->>RG: calculate CVSS scores U->>RG: generate_markdown() RG->>RG: build executive summary RG->>RG: sort findings by severity RG->>RG: render technical details RG-->>U: markdown string U->>RG: save_markdown("report.md") RG->>F: write report F-->>U: file saved U->>RG: save_html("report.html") RG->>RG: convert to HTML RG->>F: write report F-->>U: file saved ``` ## 安装说明 ``` pip install -r requirements.txt ``` ## 使用方法 ``` # Markdown 报告 python3 reportgen.py findings.json -o report.md # HTML 报告 python3 reportgen.py findings.json -f html -o report.html # 两种格式 python3 reportgen.py findings.json -f both -o report ``` ### 输入 JSON 格式 ``` { "title": "Web App Penetration Test", "client": "ACME Corp", "assessor": "S8C88", "date": "2026-07-17", "scope": "https://app.acme.com", "executive_summary": "A comprehensive assessment...", "findings": [ { "title": "SQL Injection in Login", "description": "The login endpoint...", "severity": "Critical", "cvss_score": 9.8, "impact": "Full database compromise...", "remediation": "Use parameterized queries...", "references": ["https://owasp.org/www-community/attacks/SQL_Injection"], "affected_resource": "/api/login", "cve": "CVE-2026-1234" } ] } ``` 或作为一个简单的列表: ``` [ { "title": "XSS in Search", "description": "...", "severity": "Medium" } ] ``` ## 项目结构 ``` ReportGen/ ├── reportgen.py ├── requirements.txt ├── LICENSE ├── README.md ├── docs/ │ └── engineering-report.md └── tests/ └── test_reportgen.py ``` ## 许可证 MIT
(findings + metadata)"] end subgraph "ReportGen Engine" FM["Finding Model
(title, severity, CVSS)"] CVSS["CVSS Calculator
(v3.1 Base Score)"] SM["Severity Classifier
(Critical → Info)"] ES["Executive Summary
Generator"] TD["Technical Details
Builder"] end subgraph "Output" MD["Markdown Report"] HTML["HTML Report
(styled)"] end JSON --> FM FM --> SM FM --> CVSS FM --> ES FM --> TD SM --> MD CVSS --> MD ES --> MD TD --> MD MD --> HTML style JSON fill:#1a237e,stroke:#3949ab,color:#fff style MD fill:#004d40,stroke:#00796b,color:#fff style HTML fill:#004d40,stroke:#00796b,color:#fff ``` ### 数据流 ``` sequenceDiagram participant U as User participant RG as ReportGen participant F as File System U->>RG: load_findings_from_json("findings.json") RG->>F: read JSON F-->>RG: findings data RG->>RG: parse & validate RG->>RG: classify severities RG->>RG: calculate CVSS scores U->>RG: generate_markdown() RG->>RG: build executive summary RG->>RG: sort findings by severity RG->>RG: render technical details RG-->>U: markdown string U->>RG: save_markdown("report.md") RG->>F: write report F-->>U: file saved U->>RG: save_html("report.html") RG->>RG: convert to HTML RG->>F: write report F-->>U: file saved ``` ## 安装说明 ``` pip install -r requirements.txt ``` ## 使用方法 ``` # Markdown 报告 python3 reportgen.py findings.json -o report.md # HTML 报告 python3 reportgen.py findings.json -f html -o report.html # 两种格式 python3 reportgen.py findings.json -f both -o report ``` ### 输入 JSON 格式 ``` { "title": "Web App Penetration Test", "client": "ACME Corp", "assessor": "S8C88", "date": "2026-07-17", "scope": "https://app.acme.com", "executive_summary": "A comprehensive assessment...", "findings": [ { "title": "SQL Injection in Login", "description": "The login endpoint...", "severity": "Critical", "cvss_score": 9.8, "impact": "Full database compromise...", "remediation": "Use parameterized queries...", "references": ["https://owasp.org/www-community/attacks/SQL_Injection"], "affected_resource": "/api/login", "cve": "CVE-2026-1234" } ] } ``` 或作为一个简单的列表: ``` [ { "title": "XSS in Search", "description": "...", "severity": "Medium" } ] ``` ## 项目结构 ``` ReportGen/ ├── reportgen.py ├── requirements.txt ├── LICENSE ├── README.md ├── docs/ │ └── engineering-report.md └── tests/ └── test_reportgen.py ``` ## 许可证 MIT
标签:CVSS, HTML, Markdown, Python, 无后门, 逆向工具