Lion Cipher Lab

Watch what a program does without reading its code: files, network and child commands with strace and ltrace

Why it matters

The fastest way to understand an unfamiliar program is often not to read it but to watch it. Whatever a program does that matters to the outside world, it must ask the operating system to do: open a file, make a network connection, start another program. Those requests are called system calls, and a tool that logs them gives you a factual list of the program's behaviour: which files it touched, who it talked to, what it ran. Analysts use exactly this to triage software they do not trust and cannot easily read, and automated analysis sandboxes build on the same idea. This lab teaches the…

What you'll learn

Steps in this lab

  1. Two kinds of calls, and why watching them works
  2. Build the mystery program and its config file
  3. Trace everything and read one line
  4. Question 1: which files did it touch?
  5. Question 2: who did it try to talk to?
  6. Question 3: what other programs did it start?
  7. Time and summaries: -tt, -T and -c
  8. Library calls with ltrace, and the static-binary trap
  9. Check your three answers against the source
  10. Limits to remember: overhead, one tracer, static binaries
  11. When NOT to use this, and how a pro does it better

Open the full interactive lab →

Keep learning