Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROP(x64)-exp4.py使用vulfun_addr无法成功,使用main地址则可以 #6

Open
MillionSky opened this issue Jun 19, 2017 · 2 comments

Comments

@MillionSky
Copy link

MillionSky commented Jun 19, 2017

一步一步学ROP之linux_x64篇的第一节“ Memory Leak & DynELF - 在不获取目标libc.so的情况下进行ROP攻击”。测试的时候,发现exp4.py使用vulfun_addr无法成功,使用main地址则可以成功。环境是Ubuntu 16.04.1 64位系统。使用vulfun_addr时,GDB调试发现system函数执行没有效果,返回值为0x7f00 (32512),然后继续执行vulfun,最后执行.bss,然后收到SIGSEG信号。

这个地方非常困惑。从栈内容上看,一切都符合预期,为什么vulfun_addr就无法成功?为什么用main就可以了,用vulfun怎样才可以成功,有什么诀窍?
希望能解答一下小白的疑惑,谢谢!

@Anemone95
Copy link

同样的问题,vulfun到底代表着什么呢?

@ghost
Copy link

ghost commented Apr 17, 2019

leak函数rop链返回值处直接调用vul只push了一次ebp,这样leak函数被调用许多次后栈帧会不断向高地址移动,覆盖掉以前的东西,如果调main,main一开始的代码push了很多东西,栈帧会不断向低地址移动。我猜这就是区别,如果在返回值处填__x86.get_pc_thunk.bx,这样进入vul后前有两次call,加上vul本身的push ebp可以达到平衡在原地,这时我发现也可以成功

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants