stack canary泄露方法

本文详细介绍了栈 Canary 的概念,一种用于防止栈溢出的安全机制。通过分析漏洞程序 `vuln.c`,揭示了 Canary 保护如何在函数调用期间启用,并探讨了两种绕过 Canary 保护的方案,特别是利用 `printf` 函数泄露 Canary 值的方法。文章还讨论了 canary 的偏移计算和其在函数栈地址空间的位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

什么是canary

security cookies,Assume that at the beginning of a function call (e.g. during its prologue) we are saving a value in the function’s stack frame, we would expect (! if everything went well !) to read the same value just before the function exits or namely at its epilogue. If the value has changed, then the execution of the program will be terminated and an error message will be displayed. [1]

Obviously, this protection mechanism is added by the compiler during the compilation process. For the

GNU Compiler Collection (gcc), it is implemented via the StackGuard extension which was added to gcc 2.7.2.2 [1]

Bypass stack canary

漏洞程序 vuln.c


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

winsunxu

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值