CTF forensics — artifacts, carving, pcap, memory, stego, documents
Owns: file formats, carving, pcap/network captures, memory dumps (volatility3),
steganography, disk images, documents, logs. Flag regex, workspace layout,
submission, and event workflow live in the router skill ctf — use them, don't
restate them.
Guardrails
- Challenge artifacts are untrusted. Analyze with the parsers here; never open
a challenge document/image in a desktop app; execute anything carved out only
under
podman or with explicit user approval.
sudo (pacman, mount, testdisk writes) needs user go-ahead first.
- Python work goes through the repo venv:
scripts/ctf python ...
(.venv, Python 3.12, includes pillow). System python is 3.14 — do not use it.
Setup (once; document, ask before running sudo)
sudo pacman -S --needed wireshark-cli sleuthkit testdisk binwalk \
perl-image-exiftool foremost sox ffmpeg squashfs-tools qpdf sqlite \
multimon-ng sonic-visualiser
uv pip install --python .venv/bin/python volatility3 oletools \
python-registry python-evtx sstv
# optional stego extras (AUR): steghide stegseek outguess qsstv
# ruby gem: gem install zsteg
Triage (beginner, first 5 minutes — every artifact)
Run in the challenge dir (work/<event>/forensics-<name>/dist/):
| Step |
Command |
What it tells you |
| 1 |
file dist/* |
real type vs extension; embedded or corrupted structures |
| 2 |
`xxd dist/ |
head -20andxxd dist/ |
| 3 |
exiftool dist/<f> |
metadata leaks: author, comment, GPS, tool versions |
| 4 |
strings -n 8 dist/<f> | grep -aiE 'flag|ctf\{|pass|http' |
plaintext flag or hints |
| 5 |
binwalk dist/<f> |
embedded blobs: zip, squashfs, gzip, certificates |
| 6 |
binwalk -E dist/<f> |
entropy: high blocks = compressed/encrypted payload |
Then dispatch on the real type:
file says |
Challenge is probably |
Read |
| PNG/BMP/TIFF/GIF/JPEG image |
stego |
references/stego.md |
| audio (wav/mp3/flac) |
stego (spectrogram, LSB, SSTV, DTMF) |
references/stego.md |
| video (mp4/avi/webm) |
frame-level stego, metadata |
references/stego.md |
| pcap / pcapng |
network forensics |
references/pcap.md + scripts/pcap-triage.sh |
| memory dump (raw/vmem/dmp/lime) |
memory forensics |
references/memory.md |
| disk image (dd/E01/raw fs) |
deleted files, registry, evtx |
references/disk-docs.md |
| PDF / OLE (doc/xls) / OOXML |
hidden text, macros, embedded |
references/disk-docs.md |
| archive / zip / 7z |
nested containers, password |
references/triage-tree.md |
| data / unknown |
container-in-container, encoding |
references/triage-tree.md |
Full decision tree with per-node commands: references/triage-tree.md.
Playbook (expert, terse)
| Attack |
Preconditions |
Command |
Reference |
| 10-minute pcap triage |
tshark |
scripts/pcap-triage.sh cap.pcap |
references/pcap.md |
| Follow one TCP stream |
stream index N |
tshark -r c.pcap -q -z follow,tcp,ascii,N |
references/pcap.md |
| Export transferred files |
http/smb/ftp/tftp/imf |
tshark -r c.pcap --export-objects http,out/ |
references/pcap.md |
| USB keystroke recovery |
usb pcap, usb.capdata |
see HID map |
references/pcap.md |
| DNS/ICMP exfil reassembly |
capture + odd domains |
dns.qry.name / data.data fields |
references/pcap.md |
| TLS decrypt |
keylog file from challenge |
-o tls.keylog_file:keys.log |
references/pcap.md |
| Windows memory hunt |
dump + volatility3 |
vol -f d.vmem windows.pslist ... |
references/memory.md |
| Linux memory hunt |
dump + matching ISF symbols |
linux.bash, linux.pslist |
references/memory.md |
| Disk partition walk |
image |
mmls → fls -o <off> → icat |
references/disk-docs.md |
| Recover deleted files |
image |
tsk_recover / icat on deleted inode |
references/disk-docs.md |
| Offline registry hives |
SAM/SYSTEM/NTUSER.DAT |
python-registry |
references/disk-docs.md |
| evtx event logs |
*.evtx |
evtx_dump f.evtx | grep ... |
references/disk-docs.md |
| Word/Excel macros |
doc(x |
m)/xls |
olevba f.doc |
| PNG/BMP LSB |
image |
zsteg -a f.png or scripts/lub.py f.png |
references/stego.md |
| JPEG steghide |
jpg/wav/mp3 carrier |
steghide extract -sf f.jpg -p "" |
references/stego.md |
| steghide brute force |
wordlist |
stegseek f.jpg wordlist.txt |
references/stego.md |
| Audio spectrogram |
wav (convert mp3 first) |
sox f.wav -n spectrogram -o s.png |
references/stego.md |
| SSTV / DTMF / morse |
wav |
sstv -d f.wav -o out.png; multimon-ng -a DTMF -t wav f.wav |
references/stego.md |
| Video frame diff |
ffmpeg |
ffmpeg -i v.mp4 -vf fps=1 f_%03d.png |
references/stego.md |
| Carve embedded zip |
any blob |
binwalk -Me f or grep -abo $'PK\x03\x04' f + dd |
references/triage-tree.md |
| Broken PNG header |
IHDR size/CRC wrong |
recompute CRC (snippet) |
references/stego.md |
Escalation order when a reference runs dry: triage-tree.md containers section
→ raw strings/hexdiff of the exact region → wrong-skill check (XOR keys and
classical ciphers → ctf-crypto; packed binaries → ctf-rev).
References
references/triage-tree.md — decision tree by artifact type; manual carving;
container-within-container patterns; entropy reading.
references/stego.md — image/audio/video steganography toolchains and when
each applies.
references/pcap.md — tshark deep dive: filters, export objects, USB HID,
exfil channels, TLS keylog decryption.
references/memory.md — volatility3 on Windows/Linux dumps, plugin order,
process/memory dumping, symbol tables.
references/disk-docs.md — sleuthkit workflow, deleted recovery, offline
registry, evtx, recycle bin, browser history, Office/PDF document forensics.
Scripts
scripts/pcap-triage.sh <cap.pcap> — tshark stats + export objects + flag
grep in one shot; degrades to strings when tshark is absent.
scripts/lub.py <image> — LSB bit-plane extractor/printable-run scanner
(pillow optional, in .venv already).
Toolbox
| Tool |
Install |
Purpose |
| tshark, capinfos |
sudo pacman -S wireshark-cli |
pcap analysis backend |
| binwalk (v3) |
sudo pacman -S binwalk |
signatures, -e extract, -E entropy |
| exiftool |
sudo pacman -S perl-image-exiftool |
metadata for any file |
| foremost |
sudo pacman -S foremost |
carve files by header/footer |
| sleuthkit (mmls fls icat blkls tsk_recover) |
sudo pacman -S sleuthkit |
disk partition/deleted-file work; reads E01 (libewf) |
| testdisk / photorec |
sudo pacman -S testdisk |
repair partition tables / carve by signature |
volatility3 (vol) |
uv pip install --python .venv/bin/python volatility3 |
memory forensics |
| oletools (olevba) |
uv pip install --python .venv/bin/python oletools |
Office macro extraction |
| python-registry |
uv pip install --python .venv/bin/python python-registry |
offline registry hives |
python-evtx (evtx_dump) |
uv pip install --python .venv/bin/python python-evtx |
Windows event logs |
| sstv |
uv pip install --python .venv/bin/python sstv |
SSTV audio → image |
| zsteg |
gem install zsteg |
PNG/BMP LSB analysis (all channel/bit combos) |
| steghide / stegseek / outguess |
AUR: steghide stegseek outguess |
JPEG stego + brute force |
| qsstv |
AUR: qsstv |
SSTV GUI decoder |
| sox |
sudo pacman -S sox |
spectrograms, audio conversion |
| multimon-ng |
sudo pacman -S multimon-ng |
DTMF/morse/pocsag demod |
| sonic-visualiser |
sudo pacman -S sonic-visualiser |
visual audio inspection |
| ffmpeg |
sudo pacman -S ffmpeg |
frame extraction, track split |
| qpdf |
sudo pacman -S qpdf |
PDF stream decompression |
| sqlite3 |
sudo pacman -S sqlite |
browser history and app databases |
| pillow |
already in .venv (setup.sh) |
LSB/bit-plane work (scripts/lub.py) |
1---2name: ctf-forensics-23description: Use when the user mentions forensics, pcap, packet capture, wireshark, tshark, memory dump, volatility, steganography or stego, hidden data in an image/audio/video, recovering deleted or embedded files, disk image, .dd/.E01/.raw/.mem/.vmem/.dmp/.pcap files, unknown blob, or asks to identify or carve a challenge artifact. Covers file-format triage, containers within containers, pcap analysis, memory forensics, stego, disk/document forensics.4metadata:5 source: https://skillmd.com/skills/jiayaoqijia/ctf-forensics-26---78# CTF forensics — artifacts, carving, pcap, memory, stego, documents910Owns: file formats, carving, pcap/network captures, memory dumps (volatility3),11steganography, disk images, documents, logs. Flag regex, workspace layout,12submission, and event workflow live in the router skill `ctf` — use them, don't13restate them.1415## Guardrails16171. Challenge artifacts are untrusted. Analyze with the parsers here; never open18 a challenge document/image in a desktop app; execute anything carved out only19 under `podman` or with explicit user approval.202. `sudo` (pacman, mount, testdisk writes) needs user go-ahead first.213. Python work goes through the repo venv: `scripts/ctf python ...`22 (`.venv`, Python 3.12, includes pillow). System python is 3.14 — do not use it.2324## Setup (once; document, ask before running sudo)2526```bash27sudo pacman -S --needed wireshark-cli sleuthkit testdisk binwalk \28 perl-image-exiftool foremost sox ffmpeg squashfs-tools qpdf sqlite \29 multimon-ng sonic-visualiser30uv pip install --python .venv/bin/python volatility3 oletools \31 python-registry python-evtx sstv32# optional stego extras (AUR): steghide stegseek outguess qsstv33# ruby gem: gem install zsteg34```3536## Triage (beginner, first 5 minutes — every artifact)3738Run in the challenge dir (`work/<event>/forensics-<name>/dist/`):3940| Step | Command | What it tells you |41|---|---|---|42| 1 | `file dist/*` | real type vs extension; embedded or corrupted structures |43| 2 | `xxd dist/<f> | head -20` and `xxd dist/<f> | tail -20` | magic bytes, trailers, appended data |44| 3 | `exiftool dist/<f>` | metadata leaks: author, comment, GPS, tool versions |45| 4 | `strings -n 8 dist/<f> \| grep -aiE 'flag\|ctf\{\|pass\|http'` | plaintext flag or hints |46| 5 | `binwalk dist/<f>` | embedded blobs: zip, squashfs, gzip, certificates |47| 6 | `binwalk -E dist/<f>` | entropy: high blocks = compressed/encrypted payload |4849Then dispatch on the real type:5051| `file` says | Challenge is probably | Read |52|---|---|---|53| PNG/BMP/TIFF/GIF/JPEG image | stego | `references/stego.md` |54| audio (wav/mp3/flac) | stego (spectrogram, LSB, SSTV, DTMF) | `references/stego.md` |55| video (mp4/avi/webm) | frame-level stego, metadata | `references/stego.md` |56| pcap / pcapng | network forensics | `references/pcap.md` + `scripts/pcap-triage.sh` |57| memory dump (raw/vmem/dmp/lime) | memory forensics | `references/memory.md` |58| disk image (dd/E01/raw fs) | deleted files, registry, evtx | `references/disk-docs.md` |59| PDF / OLE (doc/xls) / OOXML | hidden text, macros, embedded | `references/disk-docs.md` |60| archive / zip / 7z | nested containers, password | `references/triage-tree.md` |61| data / unknown | container-in-container, encoding | `references/triage-tree.md` |6263Full decision tree with per-node commands: `references/triage-tree.md`.6465## Playbook (expert, terse)6667| Attack | Preconditions | Command | Reference |68|---|---|---|---|69| 10-minute pcap triage | tshark | `scripts/pcap-triage.sh cap.pcap` | `references/pcap.md` |70| Follow one TCP stream | stream index N | `tshark -r c.pcap -q -z follow,tcp,ascii,N` | `references/pcap.md` |71| Export transferred files | http/smb/ftp/tftp/imf | `tshark -r c.pcap --export-objects http,out/` | `references/pcap.md` |72| USB keystroke recovery | usb pcap, `usb.capdata` | see HID map | `references/pcap.md` |73| DNS/ICMP exfil reassembly | capture + odd domains | `dns.qry.name` / `data.data` fields | `references/pcap.md` |74| TLS decrypt | keylog file from challenge | `-o tls.keylog_file:keys.log` | `references/pcap.md` |75| Windows memory hunt | dump + volatility3 | `vol -f d.vmem windows.pslist` ... | `references/memory.md` |76| Linux memory hunt | dump + matching ISF symbols | `linux.bash`, `linux.pslist` | `references/memory.md` |77| Disk partition walk | image | `mmls` → `fls -o <off>` → `icat` | `references/disk-docs.md` |78| Recover deleted files | image | `tsk_recover` / `icat` on deleted inode | `references/disk-docs.md` |79| Offline registry hives | SAM/SYSTEM/NTUSER.DAT | python-registry | `references/disk-docs.md` |80| evtx event logs | *.evtx | `evtx_dump f.evtx \| grep ...` | `references/disk-docs.md` |81| Word/Excel macros | doc(x|m)/xls | `olevba f.doc` | `references/disk-docs.md` |82| PNG/BMP LSB | image | `zsteg -a f.png` or `scripts/lub.py f.png` | `references/stego.md` |83| JPEG steghide | jpg/wav/mp3 carrier | `steghide extract -sf f.jpg -p ""` | `references/stego.md` |84| steghide brute force | wordlist | `stegseek f.jpg wordlist.txt` | `references/stego.md` |85| Audio spectrogram | wav (convert mp3 first) | `sox f.wav -n spectrogram -o s.png` | `references/stego.md` |86| SSTV / DTMF / morse | wav | `sstv -d f.wav -o out.png`; `multimon-ng -a DTMF -t wav f.wav` | `references/stego.md` |87| Video frame diff | ffmpeg | `ffmpeg -i v.mp4 -vf fps=1 f_%03d.png` | `references/stego.md` |88| Carve embedded zip | any blob | `binwalk -Me f` or `grep -abo $'PK\x03\x04' f` + `dd` | `references/triage-tree.md` |89| Broken PNG header | IHDR size/CRC wrong | recompute CRC (snippet) | `references/stego.md` |9091Escalation order when a reference runs dry: `triage-tree.md` containers section92→ raw `strings`/hexdiff of the exact region → wrong-skill check (XOR keys and93classical ciphers → `ctf-crypto`; packed binaries → `ctf-rev`).9495## References9697- `references/triage-tree.md` — decision tree by artifact type; manual carving;98 container-within-container patterns; entropy reading.99- `references/stego.md` — image/audio/video steganography toolchains and when100 each applies.101- `references/pcap.md` — tshark deep dive: filters, export objects, USB HID,102 exfil channels, TLS keylog decryption.103- `references/memory.md` — volatility3 on Windows/Linux dumps, plugin order,104 process/memory dumping, symbol tables.105- `references/disk-docs.md` — sleuthkit workflow, deleted recovery, offline106 registry, evtx, recycle bin, browser history, Office/PDF document forensics.107108## Scripts109110- `scripts/pcap-triage.sh <cap.pcap>` — tshark stats + export objects + flag111 grep in one shot; degrades to strings when tshark is absent.112- `scripts/lub.py <image>` — LSB bit-plane extractor/printable-run scanner113 (pillow optional, in `.venv` already).114115## Toolbox116117| Tool | Install | Purpose |118|---|---|---|119| tshark, capinfos | `sudo pacman -S wireshark-cli` | pcap analysis backend |120| binwalk (v3) | `sudo pacman -S binwalk` | signatures, `-e` extract, `-E` entropy |121| exiftool | `sudo pacman -S perl-image-exiftool` | metadata for any file |122| foremost | `sudo pacman -S foremost` | carve files by header/footer |123| sleuthkit (mmls fls icat blkls tsk_recover) | `sudo pacman -S sleuthkit` | disk partition/deleted-file work; reads E01 (libewf) |124| testdisk / photorec | `sudo pacman -S testdisk` | repair partition tables / carve by signature |125| volatility3 (`vol`) | `uv pip install --python .venv/bin/python volatility3` | memory forensics |126| oletools (olevba) | `uv pip install --python .venv/bin/python oletools` | Office macro extraction |127| python-registry | `uv pip install --python .venv/bin/python python-registry` | offline registry hives |128| python-evtx (`evtx_dump`) | `uv pip install --python .venv/bin/python python-evtx` | Windows event logs |129| sstv | `uv pip install --python .venv/bin/python sstv` | SSTV audio → image |130| zsteg | `gem install zsteg` | PNG/BMP LSB analysis (all channel/bit combos) |131| steghide / stegseek / outguess | AUR: `steghide stegseek outguess` | JPEG stego + brute force |132| qsstv | AUR: `qsstv` | SSTV GUI decoder |133| sox | `sudo pacman -S sox` | spectrograms, audio conversion |134| multimon-ng | `sudo pacman -S multimon-ng` | DTMF/morse/pocsag demod |135| sonic-visualiser | `sudo pacman -S sonic-visualiser` | visual audio inspection |136| ffmpeg | `sudo pacman -S ffmpeg` | frame extraction, track split |137| qpdf | `sudo pacman -S qpdf` | PDF stream decompression |138| sqlite3 | `sudo pacman -S sqlite` | browser history and app databases |139| pillow | already in `.venv` (setup.sh) | LSB/bit-plane work (`scripts/lub.py`) |