diff --git a/monkey/infection_monkey/post_breach/shell_startup_files/linux/shell_startup_files_modification.py b/monkey/infection_monkey/post_breach/shell_startup_files/linux/shell_startup_files_modification.py index ddd8f514b..63d67d208 100644 --- a/monkey/infection_monkey/post_breach/shell_startup_files/linux/shell_startup_files_modification.py +++ b/monkey/infection_monkey/post_breach/shell_startup_files/linux/shell_startup_files_modification.py @@ -1,5 +1,6 @@ import subprocess +from common.common_consts.timeouts import MEDIUM_REQUEST_TIMEOUT from infection_monkey.utils.environment import is_windows_os @@ -12,7 +13,9 @@ def get_linux_commands_to_modify_shell_startup_files(): # get list of usernames USERS = ( subprocess.check_output( # noqa: DUO116 - "cut -d: -f1,3 /etc/passwd | egrep ':[0-9]{4}$' | cut -d: -f1", shell=True + "cut -d: -f1,3 /etc/passwd | egrep ':[0-9]{4}$' | cut -d: -f1", + shell=True, + timeout=MEDIUM_REQUEST_TIMEOUT, ) .decode() .split("\n")[:-1] diff --git a/monkey/infection_monkey/post_breach/shell_startup_files/windows/shell_startup_files_modification.py b/monkey/infection_monkey/post_breach/shell_startup_files/windows/shell_startup_files_modification.py index 9d90f3812..714596266 100644 --- a/monkey/infection_monkey/post_breach/shell_startup_files/windows/shell_startup_files_modification.py +++ b/monkey/infection_monkey/post_breach/shell_startup_files/windows/shell_startup_files_modification.py @@ -1,6 +1,7 @@ import subprocess from pathlib import Path +from common.common_consts.timeouts import MEDIUM_REQUEST_TIMEOUT from infection_monkey.utils.environment import is_windows_os MODIFY_POWERSHELL_STARTUP_SCRIPT = Path(__file__).parent / "modify_powershell_startup_file.ps1" @@ -16,7 +17,9 @@ def get_windows_commands_to_modify_shell_startup_files(): # get list of usernames USERS = ( - subprocess.check_output("dir C:\\Users /b", shell=True) # noqa: DUO116 + subprocess.check_output( # noqa: DUO116 + "dir C:\\Users /b", shell=True, timeout=MEDIUM_REQUEST_TIMEOUT + ) .decode() .split("\r\n")[:-1] )