Lion Cipher Lab

Solve a keygen-me with angr: let symbolic execution find the serial, then see why the check can never protect a secret

Why it matters

Software licence checks, 'activation' routines and hard-coded password tests are all just code that takes an input and answers yes or no. When the code is in a file the user holds, anyone can study it. A tool called a symbolic execution engine can do that study for them: instead of guessing inputs, it treats the input as an unknown, follows both outcomes of every decision, and asks a maths solver what input reaches the yes branch. As a defender you need to know this exists, to judge how much a clever-looking local check is really worth (very little), and to know the limits that make some…

What you'll learn

Steps in this lab

  1. Symbolic execution in plain words
  2. Build the keygen-me
  3. Install angr in a throwaway virtual environment
  4. Warm up on the solver alone
  5. Make the serial symbolic and explore
  6. Never trust the solver: run the real program
  7. Cross-check with a plain Python copy of the check
  8. Where angr struggles: path explosion, loops and crypto
  9. The defender's takeaway: you cannot hide a check inside the thing you hand out
  10. Clean up

Open the full interactive lab →

Keep learning