DL·SYS
Contact ↗

CSCTF 2026 · Forensics · 270 pts

Ghost in the Historian.

A deleted ransomware ELF seeds its keystream from the time it ran and the PID it ran as — both of which survive elsewhere on disk.

ext4 file carvingxorshift32deterministic PRNG
EventCSCTF 2026, Operation Dawn (online jeopardy)
CategoryForensics
Points270
StatusSolved during the event
Targetext4 volume + historian.log, offline

TL;DR. Three encrypted files on an ext4 volume were produced by a now-deleted encryptor, carved from unallocated space without ever being run. Its xorshift32 keystream seed is `(time ^ pid) * 0x9e3779b1`, and both inputs — the start time (from a surviving `.enc` file's mtime) and the process ID (from a surviving log) — are recoverable without the binary ever executing.

Challenge

Decrypt three ransomed files without running the ransomware binary itself.

Solution

The ext4 volume has three .enc files under /var/historian and three orphan inodes whose extents were wiped — the encryptor deleted itself after running. Carving the unallocated space between the ransom note and the next known structure recovers the deleted encryptor ELF whole, at a specific byte offset, readable statically without ever executing it.

Reading (not running) the encryptor shows it seeds a xorshift32 generator (shift parameters 13/17/5) with (time ^ pid) * 0x9e3779b1 (32-bit), then XORs each file with 4 little-endian keystream bytes at a time, carrying PRNG state across files processed in alphabetical order, and finally sets each encrypted file's mtime to its own start time — which conveniently preserves the time input needed to re-derive the key. The pid input is recovered separately from historian.log.

Seeding the same xorshift32 generator with the recovered time and pid and replaying the keystream against all three .enc files decrypts all of them to clean plaintext; the flag is in grid_topology.cfg.

Flag

FlagCSCTF{xorshift_ghost_in_the_historian_d2c19434a637}

What I took from it