- 1、本文档共33页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
缓冲区溢出光速入门(Introduction to the speed of light in buffer overflow).doc
缓冲区溢出光速入门(Introduction to the speed of light in buffer overflow)
Buffer overflow
Application: buffer overflow in interest but the masses always miss the point.
Author: watercloud@
Date: written in 2006-2, revised in 2007-9
Buffer overflow base
When buffer overflows are typically written to an array, the length of data written exceeds the size of the original array definition.
For example, before you defined int buff[10], then the only buff[0] - buff[9] space is when we define buff
The legal space of the application, but when the data is written, the buff[12]=0x10 is out of bounds. C language commonly used
Strcpy, sprintf, strcat, and other functions are very easy to cause buffer overflow problems.
When you look at books written in C language, you usually tell you that unexpected results can occur after the program overflows. In the network security
The art of using buffer overflow in the whole field is to make this unexpected outcome change to our desired result.
See the demo below: buf.c
Buffer overflow example by watercloud@ * / / *
#includestdio.h
Void why_here (void) / * this function does not call any place.
{
Printf (why, u, here, \n);
_exit (0);
}
Int main (int, argc, char * argv[])
{
Int buff[1];
Buff[2]= (int) why_here;
Return 0;
}
On the command line, compiled by the VC command line compiler (compiled and run in Linux under GCC) is the same result:
C:\Tempcl buf.c
Running program:
C:\Tempbuf.exe
Why, u, here?!
By carefully analyzing the program and printing the information, you can see that we have not called the why_here function in the program, but the function has not
Is called at run time!!
The only explanation here is buff[2]=why_here; the operation leads to changes in the program execution flow.
To explain this phenomenon, you need to understand some of the underlying C language (and computer architecture related) and some compilation knowledge, especially
Stack and the compilation of CALL/RET knowledge, if you still have a lack of this, it is recomm
文档评论(0)