Recently, I have been doing some experimenting with a Return-to-libc attack on paper. Bypassing an unused stack during operation using return-to-libc with my Ubuntu11.10.
Before my experiment, I closed ALSR.
According to the document, I can find the address of the environment variable SHELL = "/ bin / bash" in gdb (use gdb to debug the program I want to attack):


But I found that this address is incorrect when I try to use it for the Return-to-libc experiment.
And then I write a simple program to get the address of the environment variable:

, :

.
question . ( ).
, .