Stack Overflows for Beginners: 1 Walkthrough Level0 to Level1

Stack Overflow for Beginners: 1 is the overflow based machine. We have to exploit the Binaries in order to get to the next level. These binaries are owned by the next level users. 
Login to the Level0 by username:level0 password:level0.

You will find levelOne and levelOne.c in the home directory.

If you use the command: #file levelOne
you will see that it is LSB executable. It is a C compiled file.
With command: #ls -la levelOne
you will see that it is owned by the level 1 user. So we know now what to exploit to get to the level 1.

Try running levelOne with a parameter and without. You will find different outputs. 


levelOne.c contains the code for LSB executable, which is the actual code.

The code above is taking an argument and checking the key which defines the address space. We need to make the key value as 0x42424242, to get the shell with the permissions of level1 user. 

Look at the buf[] value of 32, we need to overwrite that buf variable. It’s big endian. We need to give an input of more than 32 bits because 4 bytes contains 32 bits.

To do that here are somethings that I tried:

So, it is overwriting the key value. 0x41 is for As. 0x42 is for Bs. and since we need to make the key as 0x42424242, we will be putting B’s here.
So 32 B’s must be there and after that it will overwrite the key, so here we go!

Once we get the shell you can easily get the password for the next level!

%d bloggers like this: