diff options
| author | Jakob <jakob@memeware.net> | 2017-09-04 13:11:42 -0400 |
|---|---|---|
| committer | Jakob <jakob@memeware.net> | 2017-09-04 13:11:42 -0400 |
| commit | 26b602c9080572de54458768bf80ef879fb9e8f4 (patch) | |
| tree | b5080498a965b0f9aea97d5e826a72bf1e39ee96 /hypodermic/main.py | |
| parent | 8927b31b8ef6334a5efd28ea779db5a58ac5d445 (diff) | |
Improved interface for executing code from the inferior.
Diffstat (limited to 'hypodermic/main.py')
| -rw-r--r-- | hypodermic/main.py | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/hypodermic/main.py b/hypodermic/main.py index 7ce9be6..cb17d3b 100644 --- a/hypodermic/main.py +++ b/hypodermic/main.py @@ -108,26 +108,8 @@ def main(): if args.create: alert("Creating process at path '{}'...".format(args.create)) p = Process(path=args.create) - - shellcode = b"\x48\xc7\xc0\x01\x00\x00\x00\x48\xc7\xc7\x01\x00" + \ - b"\x00\x00\x48\xc7\xc2\x29\x00\x00\x00\x48\x8d\x35" + \ - b"\x00\x00\x00\x00\x48\x81\xc6\x0d\x00\x00\x00\x0f" + \ - b"\x05\x90\x90\x90\xcc\x61\x6d\x64\x36\x34\x20\x4c" + \ - b"\x69\x6e\x75\x78\x20\x73\x79\x73\x5f\x77\x72\x69" + \ - b"\x74\x65\x20\x73\x68\x65\x6c\x6c\x63\x6f\x64\x65" + \ - b"\x20\x62\x79\x20\x4a\x61\x6b\x6f\x62\x0a" - - old_rip = p.get_register("rip") - alert("%rip at {}".format(hex(old_rip))) - old_code = p.read_bytes(old_rip, len(shellcode)) - p.write_bytes(old_rip, shellcode) - while p.read_bytes(p.get_register("rip"), 1) != b'\xcc': - p.single_step() - alert("Hit breakpoint!") - p.write_bytes(old_rip, old_code) - p.set_register("rip", old_rip) - alert("%rip reset to {}".format(hex(p.get_register("rip")))) p.continue_until_haulted() else: alert("Attaching to process with pid {}...".format(args.attach)) p = Process(pid=args.attach) + p.continue_until_haulted() |