关于MS08-067的一点细节
2008-10-27 13:30:33 来源:WEB开发网首先是为什么老是会上溢的问题,这个就是这个漏洞的原因所在了。cocoruder在blog上引用了这么一段话:
There are two copies, the first copy is OK, but when there is another "..", it will lead to start the another copy (repeat the first copy codes), the second copy firstly does not calculate the base pointer correctly (firstly it is basePointer-2, so the 'JZ' checking in the loop of searching character '' will never come ture), that lead to get an unexpected stack pointer which is below the base pointer, after the wrong calculation, it starts the second copy and uses the unexpected pointer as the first parameter of function "wcscpy()", therefore, the wrong-calculation memory will be rewritten. The EIP will be controlled in the main function, probably.
实际上就是在找目录的时候,
x..yyyyyyyyyyyyy
会拷贝为 yyyyyyyyyyyy 中间的 x.. 就没有了。
然后程序会往栈的上面去找 "" 的存在,但是往往栈低址里没有 ""的存在,所以就找完了整个栈,上溢了。
很多同学估计都卡在这个地方了。
bp 0x71baa398 first copy 第一次拷贝,这里没问题
71BCDC12 8D46 04 LEA EAX,DWORD PTR DS:[ESI+4]
71BCDC15 8BCE MOV ECX,ESI
71BCDC17 50 PUSH EAX
71BCDC18 51 PUSH ECX
71BCDC19 FF15 2C10BA71 CALL DWORD PTR DS:[<&msvcrt.wcscpy>] ; msvcrt.wcscpy
更多精彩
赞助商链接