Agent: Modify backdoor user PBA's HTTP requests' timeout to 10 seconds

This commit is contained in:
Shreya Malviya 2021-11-11 19:19:59 +05:30
parent 4288063408
commit 5bbd1c608f
2 changed files with 3 additions and 3 deletions

View File

@ -74,9 +74,9 @@ class CommunicateAsBackdoorUser(PBA):
# 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} --head"
format_string = "curl {url} --head --max-time 10"
else:
format_string = "wget -O/dev/null -q {url} --method=HEAD"
format_string = "wget -O/dev/null -q {url} --method=HEAD --timeout=10"
return format_string.format(url=url)
def send_result_telemetry(self, exit_status, commandline, username):

View File

@ -15,7 +15,7 @@ if is_windows_os():
ACTIVE_NO_NET_USER = "/ACTIVE:NO"
WAIT_TIMEOUT_IN_MILLISECONDS = 60 * 1000
WAIT_TIMEOUT_IN_MILLISECONDS = 10 * 1000
logger = logging.getLogger(__name__)