Stack 2
Last updated
Last updated
This program will use the getenv
function to check if there is an environment variable set to GREENIE
and then assign it to variable
.
Looking at the getenv
man page we see that it searches in the environment list to find the environment variable GREENIE
and returns a pointer to the value string.
So I'm guessing that the environment value must be equal to 0x0d0a0d0a
to change modified
. We already know how to cause an overflow and set the last 4 bytes as the value we want to set modified
to, so we just need to do it using environment variables now. Maybe we can solve this challenge with a python script.
We run it...
And it works! Stack2 solved.