angr_ctf, rebuilt

If you’ve tried to learn angr, chances are someone handed you angr_ctf. It’s Jake Springer’s set of eighteen small challenges, each teaching a single symbolic-execution idea — reach an address, prune the dead paths, inject a symbol into a register or onto the stack, fake the heap, hook a function, merge states, and by the end turn a buffer overflow into an arbitrary read, write, and jump. It’s still the first thing I’d point a beginner at.

The binaries, though, haven’t aged well. It was written for an angr from several versions ago — back when claripy was still its own package — ships only 32-bit ELFs, and enough of its scaffold comments describe behaviour angr 10 no longer has that following them to the letter walks you into a wall.

So I rebuilt it: the same eighteen levels, the same concepts in the same order, regenerated from C and brought up to angr 10, and built for both x86-64 and the original i386. The scaffolds and the reference solutions run on angr 10 too, and I validated every binary and every solution end to end on both architectures — fill the blanks, get a password, feed it back, “Good Job.”

A few things I had to do differently, and they turned out to be the interesting part:

  • The arbitrary read/write/jump levels need a target at an address you can type as printable ASCII. Upstream pinned .rodata/.text to a hand-picked address and hoped the layout held; I pin a dedicated .secret section instead, which lands it there deterministically — and it works for a function too, so level 17’s jump target is real executable code.
  • The Veritesting level stopped working. In angr 10 Veritesting no longer merges a loop body, so the original 32-iteration loop just forks forever. I split it in two: one level keeps the straight-line form Veritesting still collapses, the other keeps the loop and merges the states by hand.
  • Where old angr needed a manual trick to drive a multi-field scanf, angr 10 just does it. So several levels ship a second, shorter solution that leans on that, next to the one that still teaches the technique the long way.

The prebuilt binaries are committed, so you need nothing but Python and angr to start.

It’s all here: angr_ctf_rebuilt.

Happy hacking!