Merge pull request #1588 from guardicore/1537-try-to-move-first

1537 try to move dropper file first
This commit is contained in:
ilija-lazoroski 2021-11-15 15:59:26 +01:00 committed by GitHub
commit e0abe199f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 19 deletions

View File

@ -22,6 +22,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/).
- Checkbox for self deleting a monkey agent on cleanup. #1537 - Checkbox for self deleting a monkey agent on cleanup. #1537
- Checkbox for file logging. #1537 - Checkbox for file logging. #1537
- Remove serialization of config. #1537 - Remove serialization of config. #1537
- Checkbox that gave the option to not try to first move the dropper file. #1537
### Fixed ### Fixed
- A bug in network map page that caused delay of telemetry log loading. #1545 - A bug in network map page that caused delay of telemetry log loading. #1545

View File

@ -86,7 +86,6 @@ class Configuration(object):
# dropper config # dropper config
########################### ###########################
dropper_try_move_first = True
dropper_set_date = True dropper_set_date = True
dropper_date_reference_path_windows = r"%windir%\system32\kernel32.dll" dropper_date_reference_path_windows = r"%windir%\system32\kernel32.dll"
dropper_date_reference_path_linux = "/bin/sh" dropper_date_reference_path_linux = "/bin/sh"

View File

@ -72,8 +72,8 @@ class MonkeyDrops(object):
if not file_moved and os.path.exists(self._config["destination_path"]): if not file_moved and os.path.exists(self._config["destination_path"]):
os.remove(self._config["destination_path"]) os.remove(self._config["destination_path"])
# first try to move the file # always try to move the file first
if not file_moved and WormConfiguration.dropper_try_move_first: if not file_moved:
try: try:
shutil.move(self._config["source_path"], self._config["destination_path"]) shutil.move(self._config["source_path"], self._config["destination_path"])
@ -187,11 +187,9 @@ class MonkeyDrops(object):
logger.info("Cleaning up the dropper") logger.info("Cleaning up the dropper")
try: try:
if ( if self._config["source_path"].lower() != self._config[
(self._config["source_path"].lower() != self._config["destination_path"].lower()) "destination_path"
and os.path.exists(self._config["source_path"]) ].lower() and os.path.exists(self._config["source_path"]):
and WormConfiguration.dropper_try_move_first
):
# try removing the file first # try removing the file first
try: try:

View File

@ -26,7 +26,6 @@
"monkey_dir_name": "monkey_dir", "monkey_dir_name": "monkey_dir",
"dropper_try_move_first": true,
"exploiter_classes": [ "exploiter_classes": [
"SSHExploiter", "SSHExploiter",
"SmbExploiter", "SmbExploiter",

View File

@ -246,14 +246,6 @@ INTERNAL = {
"Windows machine " "Windows machine "
"(64 bit)", "(64 bit)",
}, },
"dropper_try_move_first": {
"title": "Try to move first",
"type": "boolean",
"default": True,
"description": "Determines whether the dropper should try to move itself "
"instead of copying itself"
" to target path",
},
}, },
}, },
"logging": { "logging": {

View File

@ -116,8 +116,7 @@
"dropper_date_reference_path_linux": "/bin/sh", "dropper_date_reference_path_linux": "/bin/sh",
"dropper_target_path_linux": "/tmp/monkey", "dropper_target_path_linux": "/tmp/monkey",
"dropper_target_path_win_32": "C:\\Windows\\temp\\monkey32.exe", "dropper_target_path_win_32": "C:\\Windows\\temp\\monkey32.exe",
"dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe", "dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe"
"dropper_try_move_first": true
}, },
"logging": { "logging": {
"dropper_log_path_linux": "/tmp/user-1562", "dropper_log_path_linux": "/tmp/user-1562",