forked from p15670423/monkey
Agent: Remove timeouts from communicate_as_backdoor_user.py
Timeouts are removed from commands because timeouts are defined in popen instead
This commit is contained in:
parent
91f0a4e8ea
commit
84a7d864b5
|
@ -75,20 +75,19 @@ class CommunicateAsBackdoorUser(PBA):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_commandline_for_http_request(url, is_windows=is_windows_os()):
|
def get_commandline_for_http_request(url, is_windows=is_windows_os()):
|
||||||
if is_windows:
|
if is_windows:
|
||||||
format_string = (
|
return (
|
||||||
'powershell.exe -command "[Net.ServicePointManager]::SecurityProtocol = ['
|
f'powershell.exe -command "[Net.ServicePointManager]::SecurityProtocol = ['
|
||||||
"Net.SecurityProtocolType]::Tls12; "
|
f"Net.SecurityProtocolType]::Tls12; "
|
||||||
'Invoke-WebRequest {url} -UseBasicParsing -method HEAD"'
|
f'Invoke-WebRequest {url} -UseBasicParsing -method HEAD"'
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
# if curl works, we're good.
|
# if curl works, we're good.
|
||||||
# If curl doesn't exist or fails and wget work, 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.
|
# And if both don't exist: we'll call it a win.
|
||||||
if shutil.which("curl") is not None:
|
if shutil.which("curl") is not None:
|
||||||
format_string = "curl {url} --head --max-time 10"
|
return f"curl {url} --head"
|
||||||
else:
|
else:
|
||||||
format_string = "wget -O/dev/null -q {url} --method=HEAD --timeout=10"
|
return f"wget -O/dev/null -q {url} --method=HEAD"
|
||||||
return format_string.format(url=url)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_result_for_telemetry(exit_status, commandline, username):
|
def _get_result_for_telemetry(exit_status, commandline, username):
|
||||||
|
|
Loading…
Reference in New Issue