1625-5 王子昂 总结《2017年11月19日》 【连续第415天总结】
A. pwn-StackSmash
B.
原理
当程序加了Cannary来保护时,栈溢出会使得程序异常终止并输出错误信息
StackSmash就是利用这个错误信息进行任意地址读取的
报错函数为__stack_chk_fail,代码如下:
void __attribute__ ((noreturn)) __stack_chk_fail (void)
{
__fortify_fail ("stack smashing detected");
}
void __attribute__ ((noreturn)) internal_function __fortify_fail (const char *msg)
{
/* The loop is added only to keep gcc happy. */
while (1)
__libc_message (2, "*** %s ***: %s terminated\n",