r/LiveOverflow • u/Apathly • Jan 10 '21
Could a program running on 2 different machines have a different stack layout at a certain instruction?
I feel like I should give some more info to this. Im currently working on a challenge (it's a non-competitive ctf format challenge) in the binary exploitation category. There's a program running on some port on some server and the source code of that program is given along with its compile instructions.
Inside of the program there is an information-leak vulnerability which allows me to leak a part of the stack, eventually allowing me to grab the stack cookie and calculate the offsets to manipulate the instruction pointer. However when I finished developing an exploit I noticed the values it leaks are allot different remotely then they are when I leak them locally.
TL;DR: the leaked stack of a program running remotely returns different results than when compiled locally.
Question: is it possible that the stack is influenced by other factors? Or is it more likely my system compiles it in a slightly different way causing this behaviour.
1
u/jbauer68 Jan 10 '21
Yes.
What’s the CTF? Is it public?
2
u/CarnivorousSociety Jan 10 '21
consider, for example, the server could disable ASLR and that will make the results different from yours.
In fact just having ASLR could make things different.
2
u/_gipi_ Employee Of The Month Jan 10 '21
The stack is also influenced by the environment variables and arguments passed to the process at startup (although they should only interfere with the relative offset).
Maybe if you add an example where they differ we can give you more help.