A brief analysis of the memory layout of CTF array out of bounds

Source: Internet
Author: User

Today, we bring you an analysis of the principle of array cross-border vulnerability, and combine the examples in the CTF to explain. Because I am also the first contact, if there is not in place, but also hope that the comments will be added to my timely correction.

In general, the array out of bounds actually and stack overflow almost ...
Recommend a post

http://blog.csdn.net/human_evolution/article/details/40752047

Basically the principle of the array out of bounds to speak clearly. Here, I mainly combine the question in the CTF, let everyone actually feel how to exploit this loophole.

The question. (sometimes I want to not send out the link to the topic so that we can practice it together.) Need a message on the topic Oh ~)

What protection does a habitual check prescribe?

Open NX, not open stack protection, can go to stack overflow this aspect.

As if it were an array of arrays.

Feel the logic of the program is quite around, but this is not the tube, mainly this: s[v3] = v2, the problem is that programmers never trust the input of others, which is easy for programmers to make a mistake.
I'm here to learn how the program allocates memory to the array and the relative position of the elements of the array. Let's debug the next breakpoint.

This explains, the code, the stack, the registers all have to look, the screenshot is more troublesome. Sweat. Note that this is all 16 binary, do not understand the error.

After executing this statement, assign a value. where [Ebp+s] points to the starting position of the array, eax is our offset, which is the subscript value, which is the layout in the stack.

After understanding these I think how to exploit this loophole should be small case, we have implemented arbitrary write.
This T-problem, and do not need us to leak what address,

The system functions have been so clearly placed here, we have to do is to set the stack to the implementation of the system to have a comfortable environment.

The last exp I will not post, mainly to analyze the idea. Let's go write and write.

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.