Try the challenge thoroughly before reading the write-up. Otherwise, it's your loss.
Recap of previous level.
The recap gives a brief summary of the previous level’s solution using gdb. It also provides an alternate method without using gdb. That method uses the fact that the program was also printing out the return address. Do check that method out too. But I think it’s pretty rare that any function will print it’s return address.
The story of this level reveals that we’ll have to create our own program. On examining the level7.c file, we see that it will execute the code we enter.
Go through this walkthrough that I wrote to write shellcode which would spawn a shell. Using it’s final shellcode(
\xeb\x18\x5e\x31\xc0\x88\x46\x07\x8d\x1e\x89\x5e\x08\x8d\x4e\x08\x89\x46\x0c\x8d\x56\x0c\xb0\x0b\xcd\x80\xe8\xe3\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68\x4e\x41\x41\x41\x41\x42\x42\x42\x42) directly. Since I had not used any hardcoded addresses in it, it should work fine.
And Voila! we have level8 shell which we can use to read level8 password. I am not revealing the password here so that the readers try the challenge on their own.