FallCTF 25 (solved)

Today I walked through several CTF challenges across forensics, crypto, web, and binary exploitation, progressively deepening my debugging and reversing workflow. Here’s a summary of what I learned and how I solved each challenge.


Forensics Challenge — “Find the real email”

Goal: Identify which .eml file contained the legitimate flag email among 100+ spoofed ones.

Approach & Tools:

Key Steps:

  1. Parsed each .eml using email and re libraries.
  2. Compared headers like From, Message-ID, and body content patterns.
  3. The script isolated the correct legitimate message containing the real flag.

Lesson learned:


Crypto Challenge — “RSA e = 2”

Goal: Decrypt a message encrypted with RSA using an invalid public exponent e = 2.

Approach & Tools:

Key Steps:

  1. Factored n into p and q.
  2. Reconstructed private key logic for e=2.
  3. Recovered possible plaintexts (several roots mod n).
  4. Tested each for readable ASCII.

Lesson learned:


Pwn Challenge — “admin-switch”

Goal: Exploit a stack buffer overflow to trigger win() and read the flag.

Approach & Tools:

Key Steps:

  1. Found struct layout in C code: username[32] followed by int admin_key.
  2. Calculated offset: 32 bytes + 4 for alignment → needed 36 bytes of input.
  3. Sent payload: 'A'*32 + p32(0x1337) via pwntools.

Lesson learned:


Pwn Challenge — “jumper” (debugging with GDB)

Goal: Debug a segfaulting binary and find the flag hidden in memory.

Approach & Tools:

Key Steps:

  1. Disassembled win() and found invalid dereferences (movb $0x2a,(%rax)).

  2. Patched %rax to point to writable memory using:

    set $rax=0x404000
    jump *0x401192
    
  3. Continued execution — flag printed successfully.

Lesson learned:


Web Challenge — “Aggie HTTP”

Goal: Interact with a custom HTTP variant “AHTTP/1.1” and retrieve the flag.

Approach & Tools:

Key Steps:

  1. Tested requests manually:

    printf 'POST /flag AHTTP/1.1\r\nHost: aggie-http\r\nFlag: Please\r\nContent-Type: application/json\r\n\r\n{"flag":"yes"}\r\n' \
      | openssl s_client -quiet -connect fallctf.cybr.club:443 -servername aggie-http
    
  2. Server returned gigem{...} flag.

Lesson learned:


Web / XXE Challenge — “Slop Shoveler”

Goal: Exploit an XML endpoint vulnerable to XXE (XML External Entity Injection).

Approach & Tools:

Key Steps:

curl -X POST https://slop-shoveler.fallctf.cybr.club/load-image \
  -H "Content-Type: application/xml" \
  -d '<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///opt/flag.txt">]>
      <image><id>&xxe;</id></image>'

Lesson learned:


Git Forensics — “Gitting tired”

Goal: Recover a hidden flag from a .git directory.

Approach & Tools:

Key Steps:

grep -r "gigem{" src/.git/

Lesson learned:


Pwn Challenge — “stranded”

Goal: Gain control of function pointer to call home() instead of crashing.

Approach & Tools:

Key Steps:

  1. Extracted address of vuln() from output.
  2. Computed target = vuln + (home - vuln) offset.
  3. Sent that address back as input.
  4. Program jumped to home() → flag printed.

Lesson learned:


Crypto Challenge (skipped mid-way) — “RSA e=2 extended”

Status: Incomplete


Misc Binary (in progress) — “uh-what” (file signature recovery)

Goal: Rebuild corrupted file from byte patterns.

Progress:

Lesson learned:


Reversing / Crackme — “crackme1”

Goal: Recover or bypass password check to access flag.

Approach & Tools:

Key Steps (to be done after Ghidra install):

  1. Analyze main() and identify conditional.
  2. Patch or bypass in assembly (or gdb call to success path).

Lesson learned:


Overall Takeaways

Category Skill Learned Key Tool
Forensics Header analysis & authenticity detection Python (email, re)
Crypto Weak exponent RSA & modular math sympy, Crypto.Util.number
Binary Exploitation Stack overflow → struct overwrite pwntools, gdb
Reverse Engineering Function disassembly & patching Ghidra, radare2
Web Exploitation Protocol tampering & XXE payloads curl, openssl s_client
Version Control Forensics Git history analysis grep, .git/objects

Reflection

Today’s session helped me combine binary analysis, Python scripting, manual protocol crafting, and forensics intuition.
Each challenge was small but reinforced one principle:

“CTFs aren’t about guessing — they’re about observing patterns and reasoning from structure.”