OSERT — OSCP Exam Report (Markdown → PDF)

Ctrl+F: osert · pandoc · eisvogel · 7z · OS-XXXXX · whoisflynn

Write the OSCP report in Markdown, generate a professional PDF + 7z archive with correct naming — no Word/LibreOffice.

Repo: noraj/OSCP-Exam-Report-Template-Markdown
Examples: noraj.github.io/OSCP-Exam-Report-Template-Markdown

Reminders before exam · Every Box - Manual Workflow


📌 Why use this for OSCP

BenefitDetail
SpeedPaste from Obsidian/markdown notes — no reformatting bold/code
Correct submissionScript outputs OSCP-OS-XXXXX-Exam-Report.pdf + .7z + MD5
Version controlKeep report in a private git repo during the 24h window
No WYSIWYG painAvoid Word whitespace/line-break issues

📌 OSCP templates available

TemplateFileNotes
whoisflynn v3.2 (recommended)src/OSCP-exam-report-template_whoisflynn_v3.2.mdImproved layout, widely used
Official Offensive Security v1src/OSCP-exam-report-template_OS_v1.mdMatches OffSec suggested format
Official Offensive Security v2src/OSCP-exam-report-template_OS_v2.mdUpdated official layout

Preview PDFs in repo: output/examples/OSCP-exam-report-template_*.pdf


📌 Requirements

ToolPurpose
RubyRuns osert.rb
PandocMarkdown → PDF
LaTeX (pdflatex / xelatex)PDF engine (TeX Live)
EisvogelPandoc LaTeX template (title page, TOC, code blocks)
p7zip (7z)Submission archive

Kali / Debian

sudo apt update && sudo apt install -y \
  pandoc \
  texlive-latex-recommended \
  texlive-fonts-extra \
  texlive-latex-extra \
  p7zip-full \
  ruby

Eisvogel (install once — required for osert generate):

The old master/eisvogel.latex URL 404s. The standalone template is only in GitHub releases (not the repo root).

cd /tmp
wget https://github.com/Wandmalfarbe/pandoc-latex-template/releases/download/v3.5.1/Eisvogel.tar.gz
tar xzf Eisvogel.tar.gz
 
# Remove any broken/empty template from a failed wget
rm -f ~/.local/share/pandoc/templates/eisvogel.latex
rm -f /usr/share/pandoc/data/templates/eisvogel.latex 2>/dev/null
 
# Install standalone single-file template (Kali pandoc path)
sudo mkdir -p /usr/share/pandoc/data/templates
sudo cp Eisvogel-*/eisvogel.latex /usr/share/pandoc/data/templates/
mkdir -p ~/.local/share/pandoc/templates
cp Eisvogel-*/eisvogel.latex ~/.local/share/pandoc/templates/
 
# Must be tens of KB — NOT 0 bytes
ls -lh /usr/share/pandoc/data/templates/eisvogel.latex
head -3 /usr/share/pandoc/data/templates/eisvogel.latex

Release page: Eisvogel v3.5.1

Docker fallback (no local LaTeX/template headaches):

docker run --rm -v "$OUT:/data" -u $(id -u):$(id -g) pandoc/extra \
  "/data/OSCP-exam-report-template_whoisflynn_v3.2.md" \
  -o "/data/OSCP-OS-12345-Exam-Report.pdf" \
  --from markdown+yaml_metadata_block+raw_html \
  --template eisvogel --table-of-contents --toc-depth 6 \
  --number-sections --top-level-division=chapter \
  --syntax-highlighting breezedark

macOS

brew install pandoc p7zip ruby
brew install --cask basictex    # or mactex for full install
sudo tlmgr update --self
sudo tlmgr install eisvogel     # if using TeX Live manager
# Eisvogel fallback — same wget to ~/.local/share/pandoc/templates/ or /usr/local/share/pandoc/templates/

After basictex, open a new shell so pdflatex is on PATH.

BlackArch: pacman -S osert (packages repo + deps).


📌 One-time setup — clone repo

git clone https://github.com/noraj/OSCP-Exam-Report-Template-Markdown.git ~/Tools/osert
cd ~/Tools/osert

Exam-day tip: Clone and run a test generate before exam day so Pandoc/LaTeX/Eisvogel are verified.


📌 Step 1 — Init (pick OSCP template)

Interactive — choose OSCP → template → enter OS ID + email:

cd ~/Tools/osert
ruby osert.rb init

Prompts:

  1. Certification → OSCP (index 0)
  2. Template → Whoisflynn Improved v3.2 (index 0) or official v1/v2
  3. OS ID → e.g. 12345 (stored as OS-12345)
  4. Author email
  5. Output folder → e.g. ~/oscp-exam-report/

Non-interactive init (copy template yourself):

mkdir -p ~/oscp-exam-report
cp ~/Tools/osert/src/OSCP-exam-report-template_whoisflynn_v3.2.md \
   ~/oscp-exam-report/report.md
 
# Edit YAML frontmatter: author, date, titlepage colors, OSID

Title page colors (YAML frontmatter)

Set in the template header:

titlepage-color: "DC143C"      # Crimson
titlepage-text-color: "FFFFFF"
titlepage-rule-color: "FFFFFF"

Other good sets: 1E90FF / 483D8B / FFD700 — see repo README color table.

List syntax themes: pandoc --list-highlight-styles (default in script: breezedark).


📌 Step 2 — Write the report (OSCP structure)

Fill sections per current OSCP exam guide — typical layout:

1. Introduction / scope
2. Standalone machine #1 … #3 (or however many you completed)
   - Recon → Exploitation → PrivEsc → flags (local.txt, proof.txt)
3. AD set (if attempted)
   - Client #1, Client #2, DC
4. Appendix — extra screenshots, full command output

Images + generate: use Generate OSCP Report — one script + one copy-paste command block.

Pandoc -r does not search subfolders — collect PNGs next to the report first (included in that note).

Code blocks (gray boxes in PDF): wrap commands in fenced blocks with a blank line before the opening fence and a language tag:

After enumeration, I connected with mssqlclient:
 
```bash
impacket-mssqlclient oscp.exam/r.andrews:BusyOfficeWorker890@192.168.126.206 -windows-auth

![screenshot](Pasted image 20260817024225.png)


Eisvogel + `--style breezedark` renders fenced blocks with shaded background and syntax highlighting. Inline `` `command` `` is for short one-liners only.

**Reuse vault notes:** Copy command blocks from **[[Sheet]]** tool pages — strip wikilinks `[[...]]` or replace with plain text before PDF build (Pandoc does not resolve Obsidian links).

---

## 📌 Step 3 — Generate PDF + 7z (submission)

### Interactive

```bash
cd ~/Tools/osert
ruby osert.rb generate

Script will:

  1. Prompt for highlight style (default breezedark)
  2. Build PDF → OSCP-OS-12345-Exam-Report.pdf
  3. Build 7z → OSCP-OS-12345-Exam-Report.7z
  4. Optionally add external lab report PDF to archive
  5. Print MD5 hash (verify after upload to OffSec portal)

Non-interactive (exam day — no prompts)

cd ~/Tools/osert
 
ruby osert.rb generate \
  -i ~/oscp-exam-report/report.md \
  -o ~/oscp-exam-report \
  -e OSCP \
  -s 12345 \
  -r ~/oscp-exam-report \
  --style breezedark \
  --no-preview \
  --no-external-lab-report
FlagMeaning
-iInput markdown report
-oOutput directory for PDF + 7z
-e OSCPExam type (filename prefix)
-s 12345OS ID without OS- prefix
-r PATH--resource-path for images (repeat paths as needed)
--stylePandoc highlight theme
--no-previewSkip xdg-open
--no-external-lab-reportSkip lab PDF prompt
--lua-filter FILEOptional Pandoc filter (repeatable) — community filters

Output files:

~/oscp-exam-report/OSCP-OS-12345-Exam-Report.pdf
~/oscp-exam-report/OSCP-OS-12345-Exam-Report.7z

Verify MD5 printed at end matches portal after upload.


📌 Manual Pandoc (OSCP — whoisflynn template)

If osert.rb fails, build PDF directly:

cd ~/Tools/osert
 
pandoc ~/oscp-exam-report/report.md \
  -o ~/oscp-exam-report/OSCP-OS-12345-Exam-Report.pdf \
  --from markdown+yaml_metadata_block+raw_html \
  --template eisvogel \
  --table-of-contents \
  --toc-depth 6 \
  --number-sections \
  --top-level-division=chapter \
  --highlight-style breezedark \
  --resource-path=.:src:~/oscp-exam-report
 
# Archive manually
7z a ~/oscp-exam-report/OSCP-OS-12345-Exam-Report.7z \
  ~/oscp-exam-report/OSCP-OS-12345-Exam-Report.pdf
 
md5sum ~/oscp-exam-report/OSCP-OS-12345-Exam-Report.7z

📌 OSCP submission checklist

ItemCheck
FilenameOSCP-OS-XXXXX-Exam-Report.pdf inside .7z
Archive.7z only (not zip/rar)
MD5Matches portal after upload
Flagslocal.txt + proof.txt per standalone; AD flags per guide
ScreenshotsEvery step — command + result visible
Private repoNever push report/flags to public GitHub
RegenerateRe-run generate after final edits; confirm MD5 again

Point target → Reminders before exam > 📌 OSCP exam point breakdown (100 total — pass = 70)


📌 Pre-exam dry run

# 1. Init template to a test folder
ruby osert.rb init   # OSCP → whoisflynn → test OSID
 
# 2. Add one fake machine section + one screenshot
# 3. Generate
ruby osert.rb generate -i ~/oscp-exam-report/report.md -o ~/oscp-exam-report \
  -e OSCP -s 99999 -r ~/oscp-exam-report --style breezedark --no-preview --no-external-lab-report
 
# 4. Confirm PDF opens, TOC/numbering/code blocks look correct

Fix LaTeX/Eisvogel errors before exam day — missing fonts/packages are the usual failure.


📌 Troubleshooting

ProblemFix
osert: command not foundUse ruby ~/Tools/osert/osert.rb … or alias osert='ruby ~/Tools/osert/osert.rb'
rb_sysopen - Hacking (or similar)Quote paths with spacesMy Hacking Adventures splits into separate shell words without quotes
pdflatex not foundInstall TeX Live / basictex; restart shell
Emergency stop / no legal \end foundBroken Eisvogel install — reinstall from release tar.gz, verify file size > 0
Could not find ... eisvogel.latexSame — install from release, not raw GitHub master URL (404)
Images missing in PDFSet -r / --resource-path to folder containing images
PDF generation failedRun pandoc command manually; read LaTeX error in output
Obsidian [[links]] in PDFReplace with plain text or [text](url) before generate
Undefined control sequence / N\AUse N/A not N\A in tables — LaTeX treats \A as a command
![[Pasted image ...]]Pandoc ignores Obsidian embeds — use ![caption](filename.png) and put images in -r path
xdg-open on headless/SSHUse --no-preview

Paths with spaces (common vault paths)

Your box folders use My Hacking Adventures — the shell splits unquoted paths at every space. Ruby then tries to open a file literally named Hacking.

# WRONG — breaks at spaces
ruby osert.rb generate -i /home/phill/.../My Hacking Adventures/.../report.md
 
# RIGHT — quote every path argument
REPORT="/home/phill/Documents/Personal/OSCP/Boxes/My Hacking Adventures/HackTheBox/Soccer2/OSCP-exam-report-template_whoisflynn_v3.2.md"
OUT="/home/phill/Documents/Personal/OSCP/Boxes/My Hacking Adventures/HackTheBox/Soccer2"
 
ruby ~/Tools/osert/osert.rb generate \
  -i "$REPORT" \
  -o "$OUT" \
  -e OSCP \
  -s 12345 \
  -r "$OUT" \
  --style breezedark \
  --no-preview \
  --no-external-lab-report

Tip: For exam reports, use a path without spaces (e.g. ~/oscp-exam-report/) to avoid quoting mistakes under pressure.

Help: ruby osert.rb generate -h · repo FAQ.md