superr
December 29th, 2005, 04:59 PM
I have this book: "Jon Erickson - Hacking The Art Of Exploitation" and it says:
"Luckily, the address of an environment invoked in this manner is easy to calculate. In Linux, the address will be 0xbffffffa, minus the length of the environment, minus the length of the name of the executed program."
But this method isn't working... then i tried something different:
$ export SHELLCODE = <...>
And make a program in C that uses getenv(SHELLCODE)... but the memory address always change...
superr@bruno:~/test$ ./get_addr
SHELLCODE is located at 0xbfa519ce
superr@bruno:~/test$ ./get_addr
SHELLCODE is located at 0xbfe319ce
Anyone can help me to understanding anyone of this methods?
"Luckily, the address of an environment invoked in this manner is easy to calculate. In Linux, the address will be 0xbffffffa, minus the length of the environment, minus the length of the name of the executed program."
But this method isn't working... then i tried something different:
$ export SHELLCODE = <...>
And make a program in C that uses getenv(SHELLCODE)... but the memory address always change...
superr@bruno:~/test$ ./get_addr
SHELLCODE is located at 0xbfa519ce
superr@bruno:~/test$ ./get_addr
SHELLCODE is located at 0xbfe319ce
Anyone can help me to understanding anyone of this methods?