-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_samples
More file actions
210 lines (193 loc) · 9.23 KB
/
Copy pathgenerate_samples
File metadata and controls
210 lines (193 loc) · 9.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# PDF Style Engine v2.0
# (c) 2025 Claudia Ortega
# Licensed under CC BY-NC-ND 4.0
# https://creativecommons.org/licenses/by-nc-nd/4.0/
#!/usr/bin/env python3
"""
generate_samples.py
===================
CLI tool to generate sample PDFs for both available styles.
Usage
-----
python generate_samples.py # generates both styles
python generate_samples.py --style professional # single style
python generate_samples.py --style cyber
python generate_samples.py --out /tmp/my_docs # custom output directory
"""
import argparse
import os
import sys
# Allow running from any working directory
sys.path.insert(0, os.path.dirname(__file__))
from pdf_generator import generate_pdf
# ---------------------------------------------------------------------------
# Sample data definitions
# ---------------------------------------------------------------------------
PROFESSIONAL_DATA = {
"title": "Annual Technology Review 2025",
"subtitle": "Strategic Infrastructure Assessment",
"date": "2025-05-06",
"reference": "TEC-2025-0042",
"company": "Nexus Consulting Group",
"contact": "info@nexusconsulting.io | +1 (800) 555-0199",
# "logo_path": "/path/to/logo.png", # uncomment and set a real path
"sections": [
{
"heading": "Executive Summary",
"body": (
"This report provides a comprehensive assessment of the organisation's "
"technology infrastructure for the fiscal year 2025. Key findings indicate "
"that cloud adoption has accelerated by 34% year-over-year, while on-premise "
"legacy costs have been reduced by 18%. The strategic roadmap outlined herein "
"prioritises security hardening, AI-assisted observability, and edge computing "
"initiatives for the coming 18 months."
),
},
{
"heading": "Infrastructure Overview",
"body": (
"The current stack consists of a hybrid multi-cloud deployment spanning AWS "
"and Azure tenants, augmented by an on-premise Kubernetes cluster for latency-"
"sensitive workloads. Network segmentation follows a zero-trust architecture "
"enforced via service mesh policies. Total managed endpoints have grown from "
"1,240 to 1,890 units, with a corresponding increase in EDR coverage to 99.4%."
),
},
{
"heading": "Security Posture",
"body": (
"Penetration testing conducted in Q1 identified three medium-severity findings, "
"all of which were remediated within the agreed 30-day SLA. The SIEM platform "
"processed an average of 4.2 million events per day with a mean detection time "
"of 6 minutes for critical alerts. Phishing simulation success rates improved "
"from 12% to 4% following the updated security awareness programme."
),
},
{
"heading": "Recommendations",
"body": (
"1. Migrate remaining on-premise workloads to containerised environments by Q3. "
"2. Implement automated patch management for all Tier-1 systems. "
"3. Expand SIEM retention to 18 months to meet emerging compliance requirements. "
"4. Evaluate AI-driven anomaly detection platforms for SOC augmentation."
),
},
],
"table": {
"headers": ["System", "Status", "Coverage", "Next Review"],
"rows": [
["AWS Cloud", "Operational", "100%", "2025-08-01"],
["Azure Tenant", "Operational", "100%", "2025-08-01"],
["On-Prem K8s", "Degraded", "94.1%", "2025-06-15"],
["EDR Platform", "Operational", "99.4%", "2025-09-01"],
["SIEM / SOAR", "Operational", "100%", "2025-07-30"],
["Backup Systems", "Operational", "97.8%", "2025-08-20"],
],
},
}
CYBER_DATA = {
"title": "THREAT_INTEL_BRIEF",
"subtitle": "Red Team Operation — Shadow Nexus // Phase II",
"date": "2025-05-06T03:14:15Z",
"reference": "OPS-SN-0xBEEF",
"hash_id": "A3F9C1D7E2B08541",
"ascii_art": (
" ██████╗██╗ ██╗██████╗ ███████╗██████╗ \n"
" ██╔════╝╚██╗ ██╔╝██╔══██╗██╔════╝██╔══██╗\n"
" ██║ ╚████╔╝ ██████╔╝█████╗ ██████╔╝\n"
" ██║ ╚██╔╝ ██╔══██╗██╔══╝ ██╔══██╗\n"
" ╚██████╗ ██║ ██████╔╝███████╗██║ ██║\n"
" ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝"
),
"sections": [
{
"heading": "Mission Brief",
"body": (
"OPERATION SHADOW NEXUS — Phase II authorisation granted at 03:00 UTC. "
"Objective: enumerate lateral movement vectors across the 10.14.0.0/16 segment "
"and validate persistence mechanisms planted during Phase I. Rules of engagement "
"restrict destructive payloads. All traffic to be tunnelled through VPN_GATEWAY_7."
),
},
{
"heading": "Reconnaissance Summary",
"body": (
"Host discovery completed via masscan at 100k PPS. 847 live hosts identified. "
"Service fingerprinting revealed 23 exposed RDP instances, 14 unpatched SMB "
"services (CVE-2020-0796), and 3 internet-facing Jenkins nodes running outdated "
"versions. Credential spray returned 6 valid accounts in the CORP domain. "
"Kerberoastable SPNs: 11 identified, 4 cracked offline within 40 minutes."
),
},
{
"heading": "Exploitation Log",
"body": (
"[+] 10.14.3.22 — SMBGhost RCE — SYSTEM shell obtained 04:17 UTC\n"
"[+] 10.14.7.55 — Jenkins Script Console — reverse shell spawned 04:31 UTC\n"
"[+] 10.14.1.9 — Pass-the-Hash — lateral move to DC01 05:02 UTC\n"
"[!] 10.14.2.100 — EDR blocked Mimikatz execution — alternate method used\n"
"[+] DC01 — DCSync executed — NTDS.dit extracted 05:44 UTC"
),
},
{
"heading": "Indicators of Compromise",
"body": (
"SHA256: e3b0c44298fc1c149afb4c8996fb92427ae41e4649b934ca495991b7852b855 "
"C2 Domain: nx-relay.shadowed.io | C2 IP: 198.51.100.77:4444 "
"Persistence: HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run — key 'svcupd' "
"Scheduled Task: \\Microsoft\\Windows\\svchost_upd — triggers every 15 min"
),
},
{
"heading": "Recommendations",
"body": (
"PRIORITY 1 — Patch CVE-2020-0796 on all affected hosts immediately. "
"PRIORITY 2 — Rotate all domain credentials; enforce MFA on RDP endpoints. "
"PRIORITY 3 — Harden Kerberos delegation; remove unnecessary SPNs. "
"PRIORITY 4 — Segment Jenkins CI/CD pipeline from corporate network. "
"PRIORITY 5 — Deploy canary tokens on NTDS.dit and sensitive share paths."
),
},
],
"table": {
"headers": ["HOST", "CVE", "SEVERITY", "STATUS"],
"rows": [
["10.14.3.22", "CVE-2020-0796", "CRITICAL", "EXPLOITED"],
["10.14.7.55", "N/A (Misconfig)", "HIGH", "EXPLOITED"],
["10.14.1.9", "PtH Attack", "HIGH", "PIVOTED"],
["10.14.2.100", "CVE-2021-34527", "CRITICAL", "BLOCKED"],
["10.14.5.11", "CVE-2019-0708", "CRITICAL", "PENDING"],
["DC01", "DCSync / AD", "CRITICAL", "PWNED"],
],
},
}
# ---------------------------------------------------------------------------
# CLI
# ---------------------------------------------------------------------------
def main() -> None:
parser = argparse.ArgumentParser(
description="Generate sample PDFs using pdf_generator.py"
)
parser.add_argument(
"--style",
choices=["professional", "cyber", "both"],
default="both",
help="Which style to generate (default: both)",
)
parser.add_argument(
"--out",
default=os.path.join(os.path.dirname(__file__), "output"),
help="Output directory (default: ./output)",
)
args = parser.parse_args()
os.makedirs(args.out, exist_ok=True)
styles_to_run = (
["professional", "cyber"] if args.style == "both" else [args.style]
)
for style in styles_to_run:
data = PROFESSIONAL_DATA if style == "professional" else CYBER_DATA
out = os.path.join(args.out, f"sample_{style}.pdf")
path = generate_pdf(style, data, out)
print(f"[✓] {style.upper():14s} → {path}")
if __name__ == "__main__":
main()