Agent: Modify backdoor user PBA's commands to request for headers only

when checking for internet connection
This commit is contained in:
Shreya Malviya 2021-11-11 19:09:45 +05:30
parent 81fb015e6b
commit 4288063408
1 changed files with 3 additions and 3 deletions

View File

@ -67,16 +67,16 @@ class CommunicateAsBackdoorUser(PBA):
format_string = (
'powershell.exe -command "[Net.ServicePointManager]::SecurityProtocol = ['
"Net.SecurityProtocolType]::Tls12; "
'Invoke-WebRequest {url} -UseBasicParsing"'
'Invoke-WebRequest {url} -UseBasicParsing -method HEAD"'
)
else:
# if curl works, we're good.
# If curl doesn't exist or fails and wget work, we're good.
# And if both don't exist: we'll call it a win.
if shutil.which("curl") is not None:
format_string = "curl {url}"
format_string = "curl {url} --head"
else:
format_string = "wget -O/dev/null -q {url}"
format_string = "wget -O/dev/null -q {url} --method=HEAD"
return format_string.format(url=url)
def send_result_telemetry(self, exit_status, commandline, username):