From 5bbd1c608ffee12874dc96631ead730c8c0ef0ac Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 11 Nov 2021 19:19:59 +0530 Subject: [PATCH] Agent: Modify backdoor user PBA's HTTP requests' timeout to 10 seconds --- .../post_breach/actions/communicate_as_backdoor_user.py | 4 ++-- monkey/infection_monkey/utils/windows/users.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/post_breach/actions/communicate_as_backdoor_user.py b/monkey/infection_monkey/post_breach/actions/communicate_as_backdoor_user.py index b24ace801..03126dec0 100644 --- a/monkey/infection_monkey/post_breach/actions/communicate_as_backdoor_user.py +++ b/monkey/infection_monkey/post_breach/actions/communicate_as_backdoor_user.py @@ -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): diff --git a/monkey/infection_monkey/utils/windows/users.py b/monkey/infection_monkey/utils/windows/users.py index 8cf128c20..e0da2ded3 100644 --- a/monkey/infection_monkey/utils/windows/users.py +++ b/monkey/infection_monkey/utils/windows/users.py @@ -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__)