pentrep 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pentrep/__init__.py +3 -0
- pentrep/__main__.py +6 -0
- pentrep/cli.py +353 -0
- pentrep/cvss.py +313 -0
- pentrep/diagnostics.py +142 -0
- pentrep/loader.py +532 -0
- pentrep/models.py +358 -0
- pentrep/redact.py +320 -0
- pentrep/render/__init__.py +54 -0
- pentrep/render/context.py +200 -0
- pentrep/render/highlight.py +62 -0
- pentrep/render/html.py +34 -0
- pentrep/render/markdown.py +58 -0
- pentrep/render/md.py +172 -0
- pentrep/render/pdf.py +116 -0
- pentrep/scaffold/assets/logo.png +0 -0
- pentrep/scaffold/evidence/pt-001-sqlmap.png +0 -0
- pentrep/scaffold/findings.yaml +119 -0
- pentrep/stats.py +70 -0
- pentrep/themes/classic/fonts/OFL.txt +104 -0
- pentrep/themes/classic/fonts/SourceCodePro-Regular.ttf +0 -0
- pentrep/themes/classic/fonts/SourceSans3-Bold.ttf +0 -0
- pentrep/themes/classic/fonts/SourceSans3-It.ttf +0 -0
- pentrep/themes/classic/fonts/SourceSans3-Regular.ttf +0 -0
- pentrep/themes/classic/fonts.css +7 -0
- pentrep/themes/classic/partials/appendix.html.j2 +38 -0
- pentrep/themes/classic/partials/cover.html.j2 +17 -0
- pentrep/themes/classic/partials/document_control.html.j2 +22 -0
- pentrep/themes/classic/partials/executive_summary.html.j2 +17 -0
- pentrep/themes/classic/partials/finding.html.j2 +56 -0
- pentrep/themes/classic/partials/macros.html.j2 +7 -0
- pentrep/themes/classic/partials/scope.html.j2 +27 -0
- pentrep/themes/classic/partials/summary_table.html.j2 +13 -0
- pentrep/themes/classic/partials/toc.html.j2 +19 -0
- pentrep/themes/classic/report.html.j2 +35 -0
- pentrep/themes/classic/report.md.j2 +187 -0
- pentrep/themes/classic/style.css +97 -0
- pentrep-0.1.0.dist-info/METADATA +142 -0
- pentrep-0.1.0.dist-info/RECORD +42 -0
- pentrep-0.1.0.dist-info/WHEEL +4 -0
- pentrep-0.1.0.dist-info/entry_points.txt +2 -0
- pentrep-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta name="generator" content="pentrep {{ pentrep_version }}">
|
|
7
|
+
<title>{{ engagement.title }}</title>
|
|
8
|
+
<style>
|
|
9
|
+
:root { --accent: {{ branding.accent_color }}; }
|
|
10
|
+
{{ css }}
|
|
11
|
+
</style>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
{% from "partials/macros.html.j2" import draft_banner %}
|
|
15
|
+
{% include "partials/cover.html.j2" %}
|
|
16
|
+
<main>
|
|
17
|
+
{% include "partials/document_control.html.j2" %}
|
|
18
|
+
{% include "partials/toc.html.j2" %}
|
|
19
|
+
{% include "partials/executive_summary.html.j2" %}
|
|
20
|
+
{% include "partials/scope.html.j2" %}
|
|
21
|
+
{% include "partials/summary_table.html.j2" %}
|
|
22
|
+
<section id="detailed-findings">
|
|
23
|
+
<h2>Detailed findings</h2>
|
|
24
|
+
{{ draft_banner(redaction) }}
|
|
25
|
+
{% for finding in findings %}
|
|
26
|
+
{% include "partials/finding.html.j2" %}
|
|
27
|
+
{% endfor %}
|
|
28
|
+
</section>
|
|
29
|
+
{% include "partials/appendix.html.j2" %}
|
|
30
|
+
</main>
|
|
31
|
+
<footer>
|
|
32
|
+
<p>{{ engagement.classification }} · {{ engagement.title }} · Generated {{ generated_at }} by pentrep {{ pentrep_version }}</p>
|
|
33
|
+
</footer>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
{# banner() is appended to a heading line: it adds the FR-36 notice below the heading. #}
|
|
2
|
+
{% macro banner() %}{% if redaction.unredacted %}{{ "\n\n> **" ~ redaction.banner ~ "**" }}{% endif %}{% endmacro %}
|
|
3
|
+
{% macro severity(f) %}{% if f.score is none %}**Informational**{% else %}**{{ f.severity.label }} ({{ f.score_text }})**{% endif %}{% endmacro %}
|
|
4
|
+
# {{ engagement.title | md_inline }}{{ banner() }}
|
|
5
|
+
|
|
6
|
+
{% if branding.logo_path %}
|
|
7
|
+
 }})
|
|
8
|
+
|
|
9
|
+
{% endif %}
|
|
10
|
+
{% if branding.company_name %}
|
|
11
|
+
{{ branding.company_name | md_inline }}
|
|
12
|
+
|
|
13
|
+
{% endif %}
|
|
14
|
+
- **Client:** {{ engagement.client.name | md_inline }}
|
|
15
|
+
- **Report date:** {{ engagement.report_date }}
|
|
16
|
+
- **Version:** {{ engagement.report_version }}
|
|
17
|
+
- **Classification:** {{ engagement.classification | md_inline }}
|
|
18
|
+
|
|
19
|
+
## Document control{{ banner() }}
|
|
20
|
+
|
|
21
|
+
| Field | Value |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Report version | {{ engagement.report_version }} |
|
|
24
|
+
| Report date | {{ engagement.report_date }} |
|
|
25
|
+
| Classification | {{ engagement.classification | md_cell }} |
|
|
26
|
+
| Client | {{ engagement.client.name | md_cell }}{% if engagement.client.contact %} ({{ engagement.client.contact | md_cell }}){% endif %} |
|
|
27
|
+
| Testing period | {{ engagement.start_date }} to {{ engagement.end_date }} |
|
|
28
|
+
|
|
29
|
+
| Tester | Role | Email |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
{% for tester in engagement.testers %}
|
|
32
|
+
| {{ tester.name | md_cell }} | {{ (tester.role or "") | md_cell }} | {{ (tester.email or "") | md_cell }} |
|
|
33
|
+
{% endfor %}
|
|
34
|
+
|
|
35
|
+
## Table of contents{{ banner() }}
|
|
36
|
+
|
|
37
|
+
- [Executive summary](#executive-summary)
|
|
38
|
+
- [Scope and methodology](#scope-and-methodology)
|
|
39
|
+
- [Findings summary](#findings-summary)
|
|
40
|
+
- [Detailed findings](#detailed-findings)
|
|
41
|
+
{% for f in findings %}
|
|
42
|
+
- [{{ f.id }}: {{ f.title | md_inline }}](#{{ (f.id ~ ": " ~ f.title) | slug }})
|
|
43
|
+
{% endfor %}
|
|
44
|
+
- [Appendix A: CVSS 3.1 severity scale](#appendix-a-cvss-31-severity-scale)
|
|
45
|
+
- [Appendix B: Redaction](#appendix-b-redaction)
|
|
46
|
+
|
|
47
|
+
## Executive summary{{ banner() }}
|
|
48
|
+
|
|
49
|
+
{% if engagement.executive_summary %}
|
|
50
|
+
{{ engagement.executive_summary | md_block }}
|
|
51
|
+
|
|
52
|
+
{% endif %}
|
|
53
|
+
| Severity | Findings |
|
|
54
|
+
| --- | ---: |
|
|
55
|
+
{% for label, count in stats.counts.items() %}
|
|
56
|
+
| {{ label }} | {{ count }} |
|
|
57
|
+
{% endfor %}
|
|
58
|
+
|
|
59
|
+
Overall risk: **{{ stats.overall_risk.label }}**
|
|
60
|
+
|
|
61
|
+
## Scope and methodology{{ banner() }}
|
|
62
|
+
|
|
63
|
+
### In scope
|
|
64
|
+
|
|
65
|
+
| Asset | Type | Notes |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
{% for asset in engagement.scope.in_scope %}
|
|
68
|
+
| {{ asset.asset | md_cell }} | {{ asset.type }} | {{ (asset.notes or "") | md_cell }} |
|
|
69
|
+
{% endfor %}
|
|
70
|
+
{% if engagement.scope.out_of_scope %}
|
|
71
|
+
|
|
72
|
+
### Out of scope
|
|
73
|
+
|
|
74
|
+
| Asset | Type | Notes |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
{% for asset in engagement.scope.out_of_scope %}
|
|
77
|
+
| {{ asset.asset | md_cell }} | {{ asset.type }} | {{ (asset.notes or "") | md_cell }} |
|
|
78
|
+
{% endfor %}
|
|
79
|
+
{% endif %}
|
|
80
|
+
|
|
81
|
+
### Methodology
|
|
82
|
+
|
|
83
|
+
{{ engagement.methodology | md_block }}
|
|
84
|
+
|
|
85
|
+
## Findings summary{{ banner() }}
|
|
86
|
+
|
|
87
|
+
| ID | Title | Severity | Status |
|
|
88
|
+
| --- | --- | --- | --- |
|
|
89
|
+
{% for f in findings %}
|
|
90
|
+
| [{{ f.id }}](#{{ (f.id ~ ": " ~ f.title) | slug }}) | {{ f.title | md_cell }} | {{ severity(f) }} | {{ f.status_label }} |
|
|
91
|
+
{% endfor %}
|
|
92
|
+
|
|
93
|
+
## Detailed findings{{ banner() }}
|
|
94
|
+
{% for f in findings %}
|
|
95
|
+
|
|
96
|
+
### {{ f.id }}: {{ f.title | md_inline }}
|
|
97
|
+
|
|
98
|
+
- **Severity:** {{ severity(f) }}
|
|
99
|
+
{% if f.score is not none %}
|
|
100
|
+
- **CVSS 3.1:** {{ f.score_text }} (Impact {{ f.impact_score }}, Exploitability {{ f.exploitability_score }})
|
|
101
|
+
- **Vector:** `{{ f.vector }}`
|
|
102
|
+
{% endif %}
|
|
103
|
+
- **Status:** {{ f.status_label }}
|
|
104
|
+
{% if f.cwe %}
|
|
105
|
+
- **CWE:** {% for number, url in f.cwe %}[CWE-{{ number }}]({{ url }}){% if not loop.last %}, {% endif %}{% endfor %}
|
|
106
|
+
|
|
107
|
+
{% endif %}
|
|
108
|
+
- **Affected assets:** {% for asset in f.affected_assets %}{{ asset | md_inline }}{% if not loop.last %}, {% endif %}{% endfor %}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
**Description**
|
|
112
|
+
|
|
113
|
+
{{ f.description | md_block }}
|
|
114
|
+
|
|
115
|
+
**Impact**
|
|
116
|
+
|
|
117
|
+
{{ f.impact | md_block }}
|
|
118
|
+
|
|
119
|
+
**Steps to reproduce**
|
|
120
|
+
|
|
121
|
+
{% for step in f.steps_to_reproduce %}
|
|
122
|
+
{{ loop.index }}. {{ step | md_step }}
|
|
123
|
+
{% endfor %}
|
|
124
|
+
{% if f.evidence %}
|
|
125
|
+
|
|
126
|
+
**Evidence**
|
|
127
|
+
{% for item in f.evidence %}
|
|
128
|
+
|
|
129
|
+
**Evidence {{ item.number }}: {{ item.caption | md_inline }}**
|
|
130
|
+
|
|
131
|
+
{% if item.type == "image" %}
|
|
132
|
+
 }})
|
|
133
|
+
{% else %}
|
|
134
|
+
{% set marker = item.content | fence %}
|
|
135
|
+
{{ marker }}{{ item.language or "" }}
|
|
136
|
+
{{ item.content.rstrip("\n") }}
|
|
137
|
+
{{ marker }}
|
|
138
|
+
{% endif %}
|
|
139
|
+
{% endfor %}
|
|
140
|
+
{% endif %}
|
|
141
|
+
|
|
142
|
+
**Remediation**
|
|
143
|
+
|
|
144
|
+
{{ f.remediation | md_block }}
|
|
145
|
+
{% if f.references %}
|
|
146
|
+
|
|
147
|
+
**References**
|
|
148
|
+
|
|
149
|
+
{% for url in f.references %}
|
|
150
|
+
- <{{ url | md_url }}>
|
|
151
|
+
{% endfor %}
|
|
152
|
+
{% endif %}
|
|
153
|
+
{% endfor %}
|
|
154
|
+
|
|
155
|
+
## Appendix A: CVSS 3.1 severity scale{{ banner() }}
|
|
156
|
+
|
|
157
|
+
| Severity | Base score |
|
|
158
|
+
| --- | --- |
|
|
159
|
+
| None | 0.0 |
|
|
160
|
+
| Low | 0.1 – 3.9 |
|
|
161
|
+
| Medium | 4.0 – 6.9 |
|
|
162
|
+
| High | 7.0 – 8.9 |
|
|
163
|
+
| Critical | 9.0 – 10.0 |
|
|
164
|
+
|
|
165
|
+
## Appendix B: Redaction{{ banner() }}
|
|
166
|
+
|
|
167
|
+
{% if redaction.unredacted %}
|
|
168
|
+
This report was not redacted. It may contain secrets and personal data from the evidence. Do not distribute it.
|
|
169
|
+
{% else %}
|
|
170
|
+
Secrets and personal data in evidence and reproduction steps were replaced with `[REDACTED:NAME]` tokens. Redaction is pattern-based and is a safety net, not a guarantee.
|
|
171
|
+
{% if redaction.counts %}
|
|
172
|
+
|
|
173
|
+
| Pattern | Values redacted |
|
|
174
|
+
| --- | ---: |
|
|
175
|
+
{% for name, count in redaction.counts %}
|
|
176
|
+
| {{ name }} | {{ count }} |
|
|
177
|
+
{% endfor %}
|
|
178
|
+
{% endif %}
|
|
179
|
+
{% for line in redaction.lines[1:] %}
|
|
180
|
+
|
|
181
|
+
{{ line }}
|
|
182
|
+
{% endfor %}
|
|
183
|
+
{% endif %}
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
Generated {{ generated_at }} by pentrep {{ pentrep_version }}.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* pentrep "classic" theme. --accent is set from branding.accent_color in report.html.j2. */
|
|
2
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
3
|
+
html { font-size: 15px; }
|
|
4
|
+
body {
|
|
5
|
+
margin: 0;
|
|
6
|
+
color: #1A1A1A;
|
|
7
|
+
background: #FFFFFF;
|
|
8
|
+
font-family: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
|
|
9
|
+
line-height: 1.5;
|
|
10
|
+
}
|
|
11
|
+
main, footer { max-width: 60rem; margin: 0 auto; padding: 0 1.5rem; }
|
|
12
|
+
h1, h2, h3, h4 { color: var(--accent); line-height: 1.25; }
|
|
13
|
+
h2 { border-bottom: 2px solid var(--accent); padding-bottom: 0.2rem; margin-top: 2.5rem; }
|
|
14
|
+
h3 { margin-top: 2rem; }
|
|
15
|
+
h4 { margin: 1.25rem 0 0.4rem; color: #333333; }
|
|
16
|
+
a { color: var(--accent); }
|
|
17
|
+
code, pre { font-family: "Source Code Pro", Menlo, Consolas, monospace; font-size: 0.9em; }
|
|
18
|
+
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
19
|
+
/* WeasyPrint only wraps span-fragmented (highlighted) code with break-all. */
|
|
20
|
+
.highlight pre, pre.plain { word-break: break-all; }
|
|
21
|
+
|
|
22
|
+
/* Cover */
|
|
23
|
+
.cover { padding: 4rem 1.5rem 3rem; border-top: 1.25rem solid var(--accent); text-align: center; }
|
|
24
|
+
.cover h1 { font-size: 2.2rem; margin: 1.5rem auto; max-width: 48rem; }
|
|
25
|
+
.cover .logo { max-height: 5rem; max-width: 16rem; }
|
|
26
|
+
.cover .company { font-weight: 600; color: #333333; }
|
|
27
|
+
.cover dl { display: inline-grid; grid-template-columns: auto auto; gap: 0.25rem 1rem; text-align: left; }
|
|
28
|
+
.cover dt { font-weight: 600; }
|
|
29
|
+
.cover dd { margin: 0; }
|
|
30
|
+
.classification { letter-spacing: 0.1em; font-weight: 700; }
|
|
31
|
+
|
|
32
|
+
/* Tables */
|
|
33
|
+
table { border-collapse: collapse; width: 100%; margin: 0.75rem 0; }
|
|
34
|
+
th, td { border: 1px solid #C8C8C8; padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
|
|
35
|
+
thead th { background: var(--accent); color: #FFFFFF; }
|
|
36
|
+
tbody th { background: #F3F4F6; }
|
|
37
|
+
.stats { width: auto; min-width: 20rem; }
|
|
38
|
+
.stats td { text-align: right; }
|
|
39
|
+
|
|
40
|
+
/* Severity badges (FR-44); text colours meet WCAG AA (4.5:1) */
|
|
41
|
+
.badge { display: inline-block; padding: 0.05rem 0.55rem; border-radius: 0.3rem; font-weight: 700; font-size: 0.85em; }
|
|
42
|
+
.badge-critical { background: #7B1FA2; color: #FFFFFF; }
|
|
43
|
+
.badge-high { background: #C62828; color: #FFFFFF; }
|
|
44
|
+
.badge-medium { background: #E65100; color: #000000; }
|
|
45
|
+
.badge-low { background: #2E7D32; color: #FFFFFF; }
|
|
46
|
+
.badge-informational { background: #455A64; color: #FFFFFF; }
|
|
47
|
+
.badge-none { background: #455A64; color: #FFFFFF; }
|
|
48
|
+
|
|
49
|
+
/* Findings */
|
|
50
|
+
.finding { border-top: 1px solid #DDDDDD; }
|
|
51
|
+
.finding-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; margin: 0.5rem 0 1rem; }
|
|
52
|
+
.finding-meta dt { font-weight: 600; }
|
|
53
|
+
.finding-meta dd { margin: 0; overflow-wrap: anywhere; }
|
|
54
|
+
.md-heading { margin-bottom: 0.25rem; }
|
|
55
|
+
figure.evidence { margin: 1rem 0; }
|
|
56
|
+
figure.evidence figcaption { font-weight: 600; margin-bottom: 0.3rem; }
|
|
57
|
+
figure.evidence img { max-width: 100%; border: 1px solid #C8C8C8; }
|
|
58
|
+
.highlight pre, pre.plain { padding: 0.75rem; border: 1px solid #DDDDDD; border-radius: 0.3rem; background: #F8F8F8; margin: 0; }
|
|
59
|
+
|
|
60
|
+
/* Unredacted draft banner (FR-36) */
|
|
61
|
+
.draft-banner { margin: 0.5rem 0; padding: 0.4rem 0.75rem; background: #B71C1C; color: #FFFFFF; font-weight: 700; text-align: center; letter-spacing: 0.05em; }
|
|
62
|
+
|
|
63
|
+
footer { margin-top: 3rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid #DDDDDD; color: #555555; font-size: 0.85em; }
|
|
64
|
+
|
|
65
|
+
@media print {
|
|
66
|
+
html { font-size: 10.5pt; }
|
|
67
|
+
a { color: inherit; text-decoration: none; }
|
|
68
|
+
main, footer { max-width: none; padding: 0; }
|
|
69
|
+
.cover { page-break-after: always; padding-top: 6rem; }
|
|
70
|
+
.finding { page-break-before: always; border-top: none; }
|
|
71
|
+
pre, figure, table, .finding-meta { page-break-inside: avoid; }
|
|
72
|
+
h2, h3, h4 { page-break-after: avoid; }
|
|
73
|
+
/* Running header text (FR-46, FR-36) and TOC page numbers (WeasyPrint paged media). */
|
|
74
|
+
.cover dd.classification { string-set: classification content(text); }
|
|
75
|
+
.cover .draft-banner { string-set: draft content(text); }
|
|
76
|
+
.toc a::after { content: leader(".") " " target-counter(attr(href), page); }
|
|
77
|
+
h4, h5, h6 { bookmark-level: none; }
|
|
78
|
+
footer { display: none; }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@page {
|
|
82
|
+
margin: 22mm 18mm 20mm;
|
|
83
|
+
/* Margin boxes do not inherit from <body>, so set the font here too (FR-46). */
|
|
84
|
+
font-family: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
|
|
85
|
+
@top-center {
|
|
86
|
+
content: string(classification) " " string(draft);
|
|
87
|
+
font-size: 8.5pt; font-weight: 700; letter-spacing: 0.08em; color: #555555;
|
|
88
|
+
}
|
|
89
|
+
@bottom-right {
|
|
90
|
+
content: "Page " counter(page) " of " counter(pages);
|
|
91
|
+
font-size: 8.5pt; color: #555555;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
@page :first {
|
|
95
|
+
@top-center { content: none; }
|
|
96
|
+
@bottom-right { content: none; }
|
|
97
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: pentrep
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Turn findings.yaml into professional pentest reports (HTML, PDF, Markdown) with CVSS 3.1 scoring and PII redaction.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Rayhan212/pentrep
|
|
6
|
+
Project-URL: Issues, https://github.com/Rayhan212/pentrep/issues
|
|
7
|
+
Author: Rayhan212
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: cli,cvss,pentest,report,security
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Information Technology
|
|
14
|
+
Classifier: Operating System :: MacOS
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Security
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Requires-Dist: jinja2<4,>=3.1.6
|
|
25
|
+
Requires-Dist: markdown-it-py<5,>=4
|
|
26
|
+
Requires-Dist: pydantic<3,>=2.12
|
|
27
|
+
Requires-Dist: pygments<3,>=2.19
|
|
28
|
+
Requires-Dist: ruamel-yaml<0.20,>=0.19.1
|
|
29
|
+
Requires-Dist: typer<1,>=0.29.2
|
|
30
|
+
Requires-Dist: weasyprint<71,>=70
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# pentrep
|
|
34
|
+
|
|
35
|
+
> Turn a `findings.yaml` file into a professional penetration test report — HTML, PDF and Markdown —
|
|
36
|
+
> with CVSS 3.1 scoring and PII redaction built in.
|
|
37
|
+
|
|
38
|
+
[](https://github.com/Rayhan212/pentrep/actions/workflows/ci.yml)
|
|
39
|
+
|
|
40
|
+
**Status:** v0.1.0, the first stable release. See the [changelog](CHANGELOG.md).
|
|
41
|
+
|
|
42
|
+
- Validates `findings.yaml` and reports every problem with `file:line:col`, a stable error code and a hint.
|
|
43
|
+
- Scores findings from CVSS 3.1 vectors (own implementation, checked against FIRST's published examples).
|
|
44
|
+
- Redacts secrets and personal data in evidence by default (cookies, tokens, passwords, keys, cards,
|
|
45
|
+
e-mail addresses, private IPs, plus your own patterns).
|
|
46
|
+
- Renders one report as a self-contained HTML file, a PDF and GitHub-Flavored Markdown.
|
|
47
|
+
|
|
48
|
+
**[See the sample report](https://rayhan212.github.io/pentrep/)**, built from
|
|
49
|
+
[`examples/findings.yaml`](examples/findings.yaml) by CI: [HTML](https://rayhan212.github.io/pentrep/pentest-report.html) ·
|
|
50
|
+
[PDF](https://rayhan212.github.io/pentrep/pentest-report.pdf) · [Markdown](https://rayhan212.github.io/pentrep/pentest-report.md).
|
|
51
|
+
|
|
52
|
+
| Cover | Finding |
|
|
53
|
+
|---|---|
|
|
54
|
+
| [](docs/img/cover.png) | [](docs/img/finding.png) |
|
|
55
|
+
|
|
56
|
+
## Quickstart
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pipx install pentrep
|
|
60
|
+
pentrep init my-test
|
|
61
|
+
pentrep build my-test/findings.yaml
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`init` writes an example `findings.yaml` with a logo and an evidence image. `build` validates it and writes
|
|
65
|
+
`report/pentest-report.html`, `report/pentest-report.pdf` and `report/pentest-report.md` (with images in
|
|
66
|
+
`report/assets/`). PDF output needs the system libraries below; without them, the HTML and Markdown reports are
|
|
67
|
+
still written.
|
|
68
|
+
|
|
69
|
+
### PDF output: system libraries
|
|
70
|
+
|
|
71
|
+
PDF rendering uses [WeasyPrint](https://weasyprint.org/), which needs Pango and HarfBuzz:
|
|
72
|
+
|
|
73
|
+
| OS | Install |
|
|
74
|
+
|---|---|
|
|
75
|
+
| Debian / Ubuntu | `sudo apt install libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz0b` |
|
|
76
|
+
| macOS (Homebrew) | `brew install pango` (on Apple Silicon, also `export DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib`) |
|
|
77
|
+
| Windows / other | Use the Docker image below (Windows is not officially supported in v0.1) |
|
|
78
|
+
|
|
79
|
+
Without these libraries, `build` writes the HTML and Markdown reports, then exits with code 3 and prints an
|
|
80
|
+
install hint. PDFs embed only the bundled fonts (Source Sans 3, Source Code Pro), so they look the same on every
|
|
81
|
+
machine.
|
|
82
|
+
|
|
83
|
+
### Docker
|
|
84
|
+
|
|
85
|
+
The image includes all PDF dependencies. Run it from the directory that contains `findings.yaml`:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
docker run --rm -v "$PWD:/work" ghcr.io/rayhan212/pentrep init
|
|
89
|
+
docker run --rm -v "$PWD:/work" ghcr.io/rayhan212/pentrep build findings.yaml
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The container runs as a non-root user (uid 1000) in `/work`. If your files belong to another user, add
|
|
93
|
+
`--user "$(id -u):$(id -g)"` so the report can be written.
|
|
94
|
+
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pentrep init my-test/ # example findings.yaml + logo + evidence image
|
|
99
|
+
pentrep validate my-test/findings.yaml # every error with file:line:col, code and hint
|
|
100
|
+
pentrep build my-test/findings.yaml # report/pentest-report.{html,md,pdf}
|
|
101
|
+
pentrep schema -o findings.schema.json # JSON Schema for editor completion
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
| Command | Flags |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `pentrep init [DIR]` | `--force`: overwrite existing files |
|
|
107
|
+
| `pentrep validate FILE` | `--strict`: treat warnings as errors · `--format text\|json`: JSON goes to stdout |
|
|
108
|
+
| `pentrep build FILE` | `-f, --format html\|md\|pdf\|all` (repeatable) · `-o, --output-dir DIR` · `-n, --name NAME` · `--template-dir DIR` · `--paper a4\|letter` · `--no-redact` · `--strict` · `-q, --quiet` |
|
|
109
|
+
| `pentrep schema` | `-o, --output FILE`: write to a file instead of stdout |
|
|
110
|
+
| global | `--version`, `--debug` (show tracebacks), `--help` |
|
|
111
|
+
|
|
112
|
+
Exit codes: `0` success, `1` validation failed, `2` usage error, `3` I/O or rendering failure.
|
|
113
|
+
|
|
114
|
+
- File format: [docs/schema.md](docs/schema.md)
|
|
115
|
+
- Error codes, with examples and fixes: [docs/errors.md](docs/errors.md)
|
|
116
|
+
- Custom templates (`--template-dir`): [docs/templates.md](docs/templates.md)
|
|
117
|
+
|
|
118
|
+
> [!IMPORTANT]
|
|
119
|
+
> **Redaction is a safety net, not a guarantee.** It is pattern-based and can miss secrets that don't look like
|
|
120
|
+
> any known format, and images are not scanned. Always review the evidence before you share a report. A report
|
|
121
|
+
> built with `--no-redact` is marked `UNREDACTED DRAFT – DO NOT DISTRIBUTE` on every page.
|
|
122
|
+
|
|
123
|
+
## Development
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
uv sync --all-extras
|
|
127
|
+
uv run pentrep --version
|
|
128
|
+
uv run pytest -m "not perf" # full suite without benchmarks
|
|
129
|
+
uv run pytest -m perf # performance checks (NFR-01..04)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
- Product requirements: [docs/PRD.md](docs/PRD.md)
|
|
133
|
+
- Implementation plan & progress: [docs/PLAN.md](docs/PLAN.md)
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
pentrep is released under the [MIT License](LICENSE).
|
|
138
|
+
|
|
139
|
+
The bundled fonts, Source Sans 3 and Source Code Pro by Adobe, are licensed under the SIL Open Font License,
|
|
140
|
+
Version 1.1. The licence text and both copyright notices are in
|
|
141
|
+
[`src/pentrep/themes/classic/fonts/OFL.txt`](src/pentrep/themes/classic/fonts/OFL.txt). It ships inside the wheel
|
|
142
|
+
next to the font files.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
pentrep/__init__.py,sha256=IRphnSrQtVqFeprVC-xPu7RKiPb__NUMwgJ8SYZxUog,92
|
|
2
|
+
pentrep/__main__.py,sha256=ajUcwR_wwsRhYNnjjix15sEAtIgqEubuFPlRfgZuWyI,123
|
|
3
|
+
pentrep/cli.py,sha256=c7LnLehzvw_pJYBYQpcD2vhdnxGmfE10ndUcYzmGo34,12410
|
|
4
|
+
pentrep/cvss.py,sha256=3C9-1Lq6niYFfMPdF2Z8d8_RDjDaJqW3TwRRKbHJhWo,11055
|
|
5
|
+
pentrep/diagnostics.py,sha256=Openv81kfwQZzfHpvBH4Cwx9FJrV0wJ40qeBIUGIGVM,4688
|
|
6
|
+
pentrep/loader.py,sha256=jkpKuRUixLcoBjXYN68KdeiIhvRWgnTidsGcJg4RW_U,21697
|
|
7
|
+
pentrep/models.py,sha256=M0pYgcyT1F1FPt0FDPFCPNHaPKdVPYIqeq-AZRz9jZQ,12640
|
|
8
|
+
pentrep/redact.py,sha256=98V8f2e1mmgV7eS_yV8YGlD_89Z7NbuIdEQI2l1fXDY,12299
|
|
9
|
+
pentrep/stats.py,sha256=jqLtkbWFNrHVcV6qdSa_A-rqAzlO9fLzbyNZSaIARsY,2512
|
|
10
|
+
pentrep/render/__init__.py,sha256=MRKc_wxM-kUxHDYETYKXQabJ3ro-sdd7pAsgdb6vtts,2243
|
|
11
|
+
pentrep/render/context.py,sha256=QWghhH07Xk3w2Xuy0GcYqPyvfjAXTr-Pk_HLRpKRSZU,6545
|
|
12
|
+
pentrep/render/highlight.py,sha256=MSH0naxGlXcp_gg6xoeaQGfJihpRWWysQh1F9Dk85bI,2265
|
|
13
|
+
pentrep/render/html.py,sha256=CcpwenGDHwYdQJL15wskZYnZC7xmSev-nU7TZ_GJjAI,1339
|
|
14
|
+
pentrep/render/markdown.py,sha256=sC9dPLUPKoBIaB8IVgSVp_9-f_TdF3DTq1w8G6g5Td4,1845
|
|
15
|
+
pentrep/render/md.py,sha256=80e5qRCQMj7233RlqLPuuhPLIAcx1MUT-R3fUe0kCbI,6224
|
|
16
|
+
pentrep/render/pdf.py,sha256=uSEDNe8GfFV6oGVsSewy6mviE8PQCKpXg6x3CobdJiY,4592
|
|
17
|
+
pentrep/scaffold/findings.yaml,sha256=ldVs_8WvizX3666-_jioUhGL2I0xeMeMXfJCfqckeDc,4359
|
|
18
|
+
pentrep/scaffold/assets/logo.png,sha256=IY7Rvq4xhuKaoCyJa94Nn3R8CynB00iH28j49bTvZ_w,233
|
|
19
|
+
pentrep/scaffold/evidence/pt-001-sqlmap.png,sha256=6X-y51bTLoxKwTigxIcHnjlHb-E-cIYG-6ArXXuR_Wc,1206
|
|
20
|
+
pentrep/themes/classic/fonts.css,sha256=XtREwThnGTwK-jfjs8x1vJ9k9zyWmYca3nXMg5gOpxU,746
|
|
21
|
+
pentrep/themes/classic/report.html.j2,sha256=bznI06HP2KUpkhPuZkbLouG4g0Wfb0Z5z34m2HEjQj0,1052
|
|
22
|
+
pentrep/themes/classic/report.md.j2,sha256=f8bomO4u1NQCT0YrAusBxAVVfXCnHIptorWlDfvejqs,5488
|
|
23
|
+
pentrep/themes/classic/style.css,sha256=pMQpYeRlIwdHJGv0FgN0EDzM2uJVoFckn77YLvV-OiA,4558
|
|
24
|
+
pentrep/themes/classic/fonts/OFL.txt,sha256=dOVOORxtb7RPEZg2OOZbf-_CirXvcq0uif5nprLYVN0,5117
|
|
25
|
+
pentrep/themes/classic/fonts/SourceCodePro-Regular.ttf,sha256=dL2A0-QqCFF81-EQi6PYby2imsDzBlvpXgNXlWq52zc,210312
|
|
26
|
+
pentrep/themes/classic/fonts/SourceSans3-Bold.ttf,sha256=khS52V5CMcYJgCgVwmRsmBdOIQLQ03-Il4p_jnEAbmo,428176
|
|
27
|
+
pentrep/themes/classic/fonts/SourceSans3-It.ttf,sha256=GSr9ePD1Sjxp6vAtQ_TZqCHp1hEOQdPSXWGnOFzVgOQ,315812
|
|
28
|
+
pentrep/themes/classic/fonts/SourceSans3-Regular.ttf,sha256=RkTIG4bsnKqna2NIiZaO08T09S8FSFWTOsx8KyHlOw8,431196
|
|
29
|
+
pentrep/themes/classic/partials/appendix.html.j2,sha256=R45xLe-pmsZJriKu2OjbWgw1bsDdPr_smQ7uSnOi54s,1605
|
|
30
|
+
pentrep/themes/classic/partials/cover.html.j2,sha256=gqxYPTIk70G5jseFZ_jmao5Fo0gGrIDNkR6t6O8PQkU,743
|
|
31
|
+
pentrep/themes/classic/partials/document_control.html.j2,sha256=okDTdIaJhHqj_Re8JpLQGT3T44iijsPZA_3C3ze1VPA,992
|
|
32
|
+
pentrep/themes/classic/partials/executive_summary.html.j2,sha256=oSJCzE1CqesNf0bDmFWz6nMM7FBbXN4eAAUoyQFe488,567
|
|
33
|
+
pentrep/themes/classic/partials/finding.html.j2,sha256=Bdx7-Rhb1di-nHJ9zbRyMoZKggM_1j0y0GXIARC0JZ0,1773
|
|
34
|
+
pentrep/themes/classic/partials/macros.html.j2,sha256=F10bajXr5jtFt0MyBwPzw-7Eft6lEHSMUwyZyIibZ4I,273
|
|
35
|
+
pentrep/themes/classic/partials/scope.html.j2,sha256=AxEYgYYAxaOYltvM7uo3IuhV7g15QIot611AcNLlem0,896
|
|
36
|
+
pentrep/themes/classic/partials/summary_table.html.j2,sha256=y2aqYlhxUFSuCzJWt_D6Fg-ZCvHRrNuCSvMO2QvCyxs,601
|
|
37
|
+
pentrep/themes/classic/partials/toc.html.j2,sha256=EQjrFU9nVQQhzMcoW0SmG3mZhqAPqN5KH6MMW4rpZFs,693
|
|
38
|
+
pentrep-0.1.0.dist-info/METADATA,sha256=X6J2xmXD71UN1_q9SAeRNybgX8u2LH0zhCQTAr1mCCs,6447
|
|
39
|
+
pentrep-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
40
|
+
pentrep-0.1.0.dist-info/entry_points.txt,sha256=pggJ8-ex5DG8d7xBhgUeaCAcecklPqsVb5w1BS-fBN0,45
|
|
41
|
+
pentrep-0.1.0.dist-info/licenses/LICENSE,sha256=tSDMZaVJeUkUo__z8BpZ-LpfkTcNqmfaPrRxq8H7yZY,1066
|
|
42
|
+
pentrep-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rayhan212
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|