-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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: fix ROP(ELF(exe)).leave
is None
in some ELF
#2506
Conversation
When `pop rbp; pop rsp; ret;` exists in libc, it is chosen instead of `leave`. Add a specific `order` to filter out the former one.
ROP(ELF(exe)).leave is None
in some ELFROP(ELF(exe)).leave
is None
in some ELF
Thank you for the fix! I think a more correct solution would be to add move 999999 and migrated flag to |
Oh, you're right. Since But what if the user wish to match |
I think the last one would be very rare. I don't think |
However, in my case, Take a look at my latest solution. |
Can you merge latest dev into this branch to move the changelog entry to 5.0.0 please? Thank you for all your contributions and continuous effort! |
Conclusion
When libc has gadgets like
pop rsp; pop rbp; ret;
andleave; ret;
,ROP(ELF(libc)).leave
is None. Added a specificorder
"leav" to filter out the former case.Analysis
However, when gadgets to filter contain both
Gadget(0x26211, ['pop rsp', 'pop rbp', 'ret'], ['rsp', 'rbp'], 0x18)
andGadget(0x2556a, ['leave', 'ret'], ['rbp', 'rsp'], 0x2540be407)
,the former one is chosen as it has the same
len(g.regs) == 2
as the latter one and has a smaller move. When return back to__load
, becauseleave.regs == ['rsp', 'rbp']
andleave.regs != ['rbp', rsp']
, soself.leave is None
.The libc I test is 2.39-0ubuntu8_amd64
POC: