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.