Narnia 1 - OverTheWire - Updated Walktrough
Narnia 1 is about teaching you to write, inject and use ShellCode. *NOTE - this tutorial is for programmers like me, that just learn some web programming, maybe having fun with some hacking ect., no idea about c or assembler. If you're a computer science deg. this might be wwaayy over simplifying, and therefor its not for you. The main purpose of this tutorial is not HOW to solve narnia1, but to UNDERSTAND how to solve it a-z. What's ShellCode? Its a crafted piece of code, usually meant for a shell, usually binary code (in hex representation, called Object Code) So as stated there are 3 stages here, -write, -inject, -run. I'll start from the last. RUN YOUR SHELLCODE Well, in order to run your shellcode, you need to know where is the exploit, and adapt the code to that, so lets open narnia and lets see the exlpoit in " narnia1.c ": ret = getenv("EGG"); ret(); Well, whats " ret "? It is defined " int (*ret)(); "