Leviathan Level 1
Leviathan Level 1 — watch a setuid program ask for a password and use ltrace to see what it compares your input to.
Table of Contents
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
There is no information for this level, intentionally.
Study guide
Level map: logged in as leviathan1, find the password for leviathan2.
What this level teaches
Dynamic analysis: running a program under a tracer instead of reading its code.
Key ideas
- Setuid. The program runs with its owner’s privileges, which is why it can reach files you cannot.
- Library calls. Compiled programs call functions such as
strcmpto compare strings, andltraceprints each call with its arguments. - Secrets in memory. If the program compares your input with a hard-coded password, the tracer shows both strings.
How to approach it
- Run the program normally and see what it asks.
- Run it again under
ltrace, giving it some input, and read the comparisons it makes. - After you gain a shell, check which user you are with
id.
Why it matters
Tracing is a fast first step in malware analysis and debugging when you lack source code.