diff --git a/monkey/infection_monkey/config.py b/monkey/infection_monkey/config.py index 2c6e4b678..d25ff7ebe 100644 --- a/monkey/infection_monkey/config.py +++ b/monkey/infection_monkey/config.py @@ -99,9 +99,6 @@ class Configuration(object): # sets whether or not the monkey is alive. if false will stop scanning and exploiting alive = True - # string of the mutex name for single instance - singleton_mutex_name = "{2384ec59-0df8-4ab9-918c-843740924a28}" - # how long to wait between scan iterations timeout_between_iterations = 100 diff --git a/monkey/infection_monkey/example.conf b/monkey/infection_monkey/example.conf index de6965a6e..b2a5c24dd 100644 --- a/monkey/infection_monkey/example.conf +++ b/monkey/infection_monkey/example.conf @@ -56,7 +56,6 @@ "smb_service_name": "InfectionMonkey", "retry_failed_explotation": true, "self_delete_in_cleanup": true, - "singleton_mutex_name": "{2384ec59-0df8-4ab9-918c-843740924a28}", "skip_exploit_if_file_exist": false, "exploit_user_list": [], "exploit_password_list": [], diff --git a/monkey/infection_monkey/system_singleton.py b/monkey/infection_monkey/system_singleton.py index 745ecea67..c08ded467 100644 --- a/monkey/infection_monkey/system_singleton.py +++ b/monkey/infection_monkey/system_singleton.py @@ -3,11 +3,12 @@ import logging import sys from abc import ABCMeta, abstractmethod -from infection_monkey.config import WormConfiguration - logger = logging.getLogger(__name__) +SINGLETON_MUTEX_NAME = "{2384ec59-0df8-4ab9-918c-843740924a28}" + + class _SystemSingleton(object, metaclass=ABCMeta): @abstractmethod def try_lock(self): @@ -20,7 +21,7 @@ class _SystemSingleton(object, metaclass=ABCMeta): class WindowsSystemSingleton(_SystemSingleton): def __init__(self): - self._mutex_name = r"Global\%s" % (WormConfiguration.singleton_mutex_name,) + self._mutex_name = r"Global\%s" % (SINGLETON_MUTEX_NAME,) self._mutex_handle = None def try_lock(self): @@ -55,7 +56,7 @@ class WindowsSystemSingleton(_SystemSingleton): class LinuxSystemSingleton(_SystemSingleton): def __init__(self): - self._unix_sock_name = str(WormConfiguration.singleton_mutex_name) + self._unix_sock_name = str(SINGLETON_MUTEX_NAME) self._sock_handle = None def try_lock(self):