From 2bcdb725551fab4b16a4c33329e81d088b8feb27 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 20 Apr 2022 17:41:57 +0530 Subject: [PATCH] Agent: Extract const USERNAME_PREFIX to a common file --- monkey/infection_monkey/consts.py | 1 + .../post_breach/actions/communicate_as_backdoor_user.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 monkey/infection_monkey/consts.py diff --git a/monkey/infection_monkey/consts.py b/monkey/infection_monkey/consts.py new file mode 100644 index 000000000..520f82929 --- /dev/null +++ b/monkey/infection_monkey/consts.py @@ -0,0 +1 @@ +USERNAME_PREFIX = "somenewuser" 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 01843b242..15d41bc9d 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 @@ -6,6 +6,7 @@ import subprocess from typing import Dict from common.common_consts.post_breach_consts import POST_BREACH_COMMUNICATE_AS_BACKDOOR_USER +from infection_monkey.consts import USERNAME_PREFIX from infection_monkey.i_puppet.i_puppet import PostBreachData from infection_monkey.post_breach.pba import PBA from infection_monkey.telemetry.messengers.i_telemetry_messenger import ITelemetryMessenger @@ -23,8 +24,6 @@ CREATED_PROCESS_AS_USER_FAILED_FORMAT = ( "Created process '{}' as user '{}', but the process failed (exit status {}:{})." ) -USERNAME_PREFIX = "somenewuser" - logger = logging.getLogger(__name__)