Skip to content

Commit

Permalink
Fixed orphaned agents - #23
Browse files Browse the repository at this point in the history
  • Loading branch information
Cx01N committed Dec 7, 2019
1 parent 9f1ca8c commit 2829029
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/listeners/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def generate_agent(self, listenerOptions, language=None, obfuscate=False, obfusc
'$Profile = "/admin/get.php,/news.php,/login/process.php|Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"',
"$Profile = \"" + str(profile) + "\"")
code = code.replace('$LostLimit = 60', "$LostLimit = " + str(lostLimit))
code = code.replace('$DefaultResponse = ""', '$DefaultResponse = "' + str(b64DefaultResponse) + '"')
code = code.replace('$DefaultResponse = ""', '$DefaultResponse = "' + b64DefaultResponse.decode('UTF-8') + '"')

# patch in the killDate and workingHours if they're specified
if killDate != "":
Expand Down Expand Up @@ -713,7 +713,7 @@ def generate_agent(self, listenerOptions, language=None, obfuscate=False, obfusc
'profile = "%s"' % (profile))
code = code.replace('lostLimit = 60', 'lostLimit = %s' % (lostLimit))
code = code.replace('defaultResponse = base64.b64decode("")',
'defaultResponse = base64.b64decode("%s")' % (b64DefaultResponse))
'defaultResponse = base64.b64decode("%s")' % (b64DefaultResponse.decode("UTF-8")))

# patch in the killDate and workingHours if they're specified
if killDate != "":
Expand Down Expand Up @@ -1051,7 +1051,7 @@ def handle_get(request_uri):
obfuscationCommand=self.mainMenu.obfuscateCommand)
return make_response(stage, 200)

elif results.startswith(b'ERROR:'):
elif results.startswith('ERROR:'):
listenerName = self.options['Name']['Value']
message = "[!] Error from agents.handle_agent_data() for {} from {}: {}".format(
request_uri, clientIP, results)
Expand Down

0 comments on commit 2829029

Please sign in to comment.