I remember the previous experiment on buffer overflow attacks in Linux. I used two machines, one with RedHat 8.0 and the other with RedHat 9.0, and found a strange phenomenon. The stack base address of RedHat 8.0 is fixed, while the stack base address of RedHat 9.0 is floating. For exampleProgramThe output of RedHat 8.0 is the same each time, while RedHat 9.0 is different.
Int main ()
{
Char Buf [256];
Printf ("0x % x/N", Buf );
Gets (BUF );
}
Obviously, as the stack base address changes, the most common buffer overflow attack (passing a shellcode to the gets () function) is hard to succeed in RedHat 9.0. (Try it in RedHat 8.0 .) I didn't care too much at the time. I think this may be a way to enhance the system security of RedHat 9.0.
Today, we accidentally discovered that this approach is called address space layout randomization, which not only randomizes the stack address, but also randomizes the base address of the dynamic link library (such as libc) (in response to the Return-to-libc attack) and MMAP addresses.
I did not go further into it. It is said that OpenBSD, Linux, and Vista all implement this technology. The following are some reference addresses.
Http://pax.grsecurity.net/docs/aslr.txt
Http://blogs.msdn.com/michael_howard/archive/2006/05/26/608315.aspx
Http://www.csc.ncsu.edu/faculty/junxu/software/aslp/
Http://www.stanford.edu /~ BLP/papers/asrandom.pdf