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

Feature: consider register with controllable content of pointer as gadgets' constraint #8

Closed
scwuaptx opened this issue Jun 4, 2017 · 2 comments

Comments

@scwuaptx
Copy link

scwuaptx commented Jun 4, 2017

For example :
2017-06-04 10 09 38
If r12 is controllable, it could execute any command. :)

@david942j
Copy link
Owner

david942j commented Jun 6, 2017

Currently constraints of all one-gadgets are some value(s) to be zero (NULL).
Maybe we should add another option to find gadgets that constraint is register to be a controllable string?

For example, if rdi is a controllable string then we can use system as 'one-gadget'.
And in your case, it works if r12 is a command string.

Maybe add an option --all then one_gadget <file> --all will show this kind of gadgets.

I think separate the null-condition and string-condition cases can prevent confusing users.

@david942j david942j changed the title Add some special case Feature: consider register with controllable content of pointer as gadgets' constraint Dec 21, 2017
@david942j
Copy link
Owner

Assume this request gets supported by #206, an example on one_gadget 1.9.0:

➜ one_gadget -b aad7dbe330f23ea00ca63daf793b766b51aceb5d -l1
0x4551f execve("/bin/sh", rsp+0x30, environ)
constraints:
  address rsp+0x40 is writable
  {"sh", "-c", rbx, NULL} is a valid argv

0x45526 execve("/bin/sh", rsp+0x30, environ)
constraints:
  address rsp+0x40 is writable
  rax == NULL || {rax, "-c", rbx, NULL} is a valid argv

0x4557a execve("/bin/sh", rsp+0x30, environ)
constraints:
  [rsp+0x30] == NULL || {[rsp+0x30], [rsp+0x38], [rsp+0x40], [rsp+0x48], ...} is a valid argv

<... more gadgets followed ...>

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