Behemoth Level 3
Behemoth Level 3 — a format-string vulnerability in a binary without source, used to write to memory and take control.
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 behemoth3, find the password for behemoth4.
What this level teaches
Format-string exploitation starting from a compiled program.
Key ideas
- Recognising the bug. The program prints your input with a
printf-style call without a fixed format. Feeding%xspecifiers shows stack contents. - Locating your input on the stack with positional specifiers.
- Choosing a target to overwrite. A function pointer, a Global Offset Table entry or a return address can redirect execution.
- Where to put shellcode. An environment variable is a convenient place, and its address can be computed.
How to approach it
- Confirm the vulnerability with a harmless sequence of specifiers.
- Find the stack index of your own input.
- Decide on the target and the value, then build the write.
Why it matters
It repeats a technique you learned earlier in a more realistic setting.