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

Corefile fault_addr on amd64 #1018

Closed
zachriggle opened this issue Sep 1, 2017 · 4 comments
Closed

Corefile fault_addr on amd64 #1018

zachriggle opened this issue Sep 1, 2017 · 4 comments
Assignees
Milestone

Comments

@zachriggle
Copy link
Member

When doing ROP on amd64, the fault_addr of the generated corefile is zero.

This is a little bit confusing, because the fault address is not zero, it's whatever is on the top of the stack (e.g. faaagaaa).

This is extra confusing because i386 behaves how we would expect.

I suggest the following change which should make things function the way we'd expect.

try:
  if core.arch == 'amd64' and core.fault_addr == 0 and core.read(core.pc, 1) == '\xc3':
    core.fault_addr = core.unpack(core.sp)
except Exception:
  pass
@zachriggle zachriggle self-assigned this Sep 1, 2017
@zachriggle
Copy link
Member Author

The context / impetus for this is the challenges in ROP Emporium are provided in both architectures, and it should be possible to have a single exploit script that works for either.

Currently, this is the biggest hiccup, aside from limitations of pwnlib.rop.rop.ROP.setRegisters requiring super basic gadgets.

@bennofs
Copy link
Contributor

bennofs commented Sep 13, 2017

What's the \xc3 magic constant there?

@zachriggle
Copy link
Member Author

It is a ret instruction.

@zachriggle
Copy link
Member Author

Fixed in #1031

@zachriggle zachriggle modified the milestones: 3.10.0, 3.11.0 Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants