Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Fix listeners exception #1333

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/listeners/dbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",

if userAgent.lower() == 'default':
profile = listenerOptions['DefaultProfile']['Value']
userAgent = profile.split('|')[1]
if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""
stager += "$u='"+userAgent+"';"

if userAgent.lower() != 'none' or proxy.lower() != 'none':
Expand Down Expand Up @@ -288,7 +291,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",

if userAgent.lower() == 'default':
profile = listenerOptions['DefaultProfile']['Value']
userAgent = profile.split('|')[1]
if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""

launcherBase += "import urllib2;\n"
launcherBase += "UA='%s';" % (userAgent)
Expand Down
10 changes: 8 additions & 2 deletions lib/listeners/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",

if userAgent.lower() == 'default':
profile = listenerOptions['DefaultProfile']['Value']
userAgent = profile.split('|')[1]
if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""
stager += "$u='"+userAgent+"';"

if 'https' in host:
Expand Down Expand Up @@ -438,7 +441,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",

if userAgent.lower() == 'default':
profile = listenerOptions['DefaultProfile']['Value']
userAgent = profile.split('|')[1]
if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""

launcherBase += "import urllib2;\n"
launcherBase += "UA='%s';" % (userAgent)
Expand Down
11 changes: 8 additions & 3 deletions lib/listeners/http_foreign.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",

if userAgent.lower() == 'default':
profile = listenerOptions['DefaultProfile']['Value']
userAgent = profile.split('|')[1]
if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""
stager += "$u='"+userAgent+"';"

if 'https' in host:
Expand Down Expand Up @@ -269,8 +272,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",

if userAgent.lower() == 'default':
profile = listenerOptions['DefaultProfile']['Value']
userAgent = profile.split('|')[1]

if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""

launcherBase += "o=__import__({2:'urllib2',3:'urllib.request'}[sys.version_info[0]],fromlist=['build_opener']).build_opener();"
launcherBase += "UA='%s';" % (userAgent)
Expand Down
10 changes: 8 additions & 2 deletions lib/listeners/http_hop.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",
stager += helpers.randomize_capitalization("$"+helpers.generate_random_script_var_name("wc")+"=New-Object System.Net.WebClient;")

if userAgent.lower() == 'default':
userAgent = profile.split('|')[1]
if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""
stager += "$u='"+userAgent+"';"

if 'https' in host:
Expand Down Expand Up @@ -238,7 +241,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",
print helpers.color(p, color='red')

if userAgent.lower() == 'default':
userAgent = profile.split('|')[1]
if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""

launcherBase += "o=__import__({2:'urllib2',3:'urllib.request'}[sys.version_info[0]],fromlist=['build_opener']).build_opener();"
launcherBase += "UA='%s';" % (userAgent)
Expand Down
10 changes: 8 additions & 2 deletions lib/listeners/redirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",

if userAgent.lower() == 'default':
profile = listenerOptions['DefaultProfile']['Value']
userAgent = profile.split('|')[1]
if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""
stager += "$u='"+userAgent+"';"

if 'https' in host:
Expand Down Expand Up @@ -250,7 +253,10 @@ def generate_launcher(self, encode=True, obfuscate=False, obfuscationCommand="",

if userAgent.lower() == 'default':
profile = listenerOptions['DefaultProfile']['Value']
userAgent = profile.split('|')[1]
if "|" in profile:
userAgent = profile.split('|')[1]
else:
userAgent = ""

launcherBase += "import urllib2;\n"
launcherBase += "UA='%s';" % (userAgent)
Expand Down