Page Background Animation
302 words
2 minutes
UofTCTF 2026 — Forensics, Crypto & Pwn Writeups

UofTCTF 2026 — Writeups#

Writeups for challenges solved during UofTCTF 2026 (University of Toronto CTF), covering Forensics, Cryptography, and exploitation challenges.

Baby Exfil — Forensics / Network Analysis#

Flag: uoftctf{b4by_w1r3sh4rk_an4lys1s}

Scenario#

Team K&K identified suspicious network activity — a data exfiltration attempt. We analyzed final.pcapng to recover stolen confidential data.

Investigation#

Step 1: Protocol Triage

Using tshark -z io,phs revealed a mix of TCP/TLS, QUIC, and a small amount of unencrypted HTTP — the prime suspect for data leakage.

Step 2: HTTP Traffic Analysis

Filtering for http:

  1. GET /JdRlPr1.py — Attacker downloaded a Python exfil script
  2. Multiple POST /upload requests — multipart/form-data payloads to 34.134.77.90:8080

Step 3: Exfiltration Script Analysis

The Python script (JdRlPr1.py) revealed the exfil mechanism:

  • Reads target files
  • Chunks data and encodes it
  • POSTs each chunk to the C2 upload endpoint

Step 4: Data Recovery

Extracting the POST bodies from Wireshark and reversing the encoding recovered the stolen data containing the flag.

Flag: uoftctf{b4by_w1r3sh4rk_an4lys1s}

Gambler’s Fallacy — PRNG Exploitation#

A challenge exploiting weak pseudo-random number generation. By predicting the PRNG state after observing enough outputs, we could predict future “random” outcomes and win the gambling game consistently.

Approach#

  1. Collect PRNG outputs from the server
  2. Use Z3 SMT solver / Mersenne Twister untwist to recover internal state
  3. Predict next outputs and win

🔐 Encryption Service — Cryptography#

A custom encryption service challenge requiring analysis of the encryption scheme to find weaknesses.

Key Insight#

The service used a vulnerable padding scheme that leaked information about the plaintext through timing/response differences — a classic padding oracle vector.


🔢 Guess The Number — Binary Exploitation#

Reverse engineering a number-guessing binary to identify the validation logic and bypass the check, either through:

  • Direct binary patching
  • Symbolic execution with angr
  • Integer overflow exploitation

🎲 Lottery — Crypto#

Exploiting weak randomness in a lottery system where the seed was predictable, allowing us to compute winning tickets.


📐 MAT247 Crypto#

A math-heavy cryptography challenge involving linear algebra concepts (hence the course code MAT247). Required solving systems of equations over finite fields to recover the encryption key.