Behemoth Level 1
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 behemoth1, find the password for behemoth2.
What this level teaches¶
The Narnia-style stack overflow, but starting from a binary alone.
Key ideas¶
- Unsafe input functions. Functions that read without a length limit, such as
gets, make overflows trivial. Disassembly orltracewill show which one is used. - Finding the offset. Send a cyclic pattern in
gdband read which part lands in the saved return address. - Shellcode and its address. Place shellcode in the buffer or environment, and aim the return address at it. Remember
gdbchanges the stack slightly compared with a normal run. - Keep the shell alive. Make sure your input does not close standard input before the shell can use it.
How to approach it¶
- Confirm the crash with a long input.
- Find the offset and the buffer's address.
- Build and test the payload, adjusting for the real stack layout.
Why it matters¶
It consolidates the Narnia skills and confirms you can work without source.