Modifying the executable properties of the program stack

Source: Internet
Author: User

Recently, several experiments have just been done csapp, in the Bufbomb experiment Level2 and LEVEL3, need to embed the attack code into the buffer and modify the program return address as the beginning address of the buffer, but encountered the problem of the stack is not executable. Because the Ubuntu default stack is not executable. Two ways to modify the executable properties of the program stack are summarized here.

Method One: (There is a. C source file)

  1. Gcc-g-Z execstack-fno-stack-protector stack.c-o Stack
  2. ./stack

Method Two: (only compiled executable programs, such as Bufbomb in the experiment)

  1. Install execstack locally, command: sudo apt-get install Execstack
  2. Modify the executable properties of the program stack, command: Execstack-s bufbomb

To close the ASLR command:

  1. su root
  2. sysctl -w kernel.randomize_va_space=0(赋值为2,即可打开ASLR)
 

Modifying the executable properties of the program stack

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: info-contact@alibabacloud.com 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.