Address Space Layout randomization and buffer overflow attacks

Source: Internet
Author: User

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:// /~ BLP/papers/asrandom.pdf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.