Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1537 try to move dropper file first #1588

Merged
merged 4 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/).
- Checkbox for self deleting a monkey agent on cleanup. #1537
- Checkbox for file logging. #1537
- Remove serialization of config. #1537
- Checkbox that gave the option to not try to first move the dropper file. #1537

### Fixed
- A bug in network map page that caused delay of telemetry log loading. #1545
Expand Down
1 change: 0 additions & 1 deletion monkey/infection_monkey/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def as_dict(self):
# dropper config
###########################

dropper_try_move_first = True
dropper_set_date = True
dropper_date_reference_path_windows = r"%windir%\system32\kernel32.dll"
dropper_date_reference_path_linux = "/bin/sh"
Expand Down
12 changes: 5 additions & 7 deletions monkey/infection_monkey/dropper.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def start(self):
if not file_moved and os.path.exists(self._config["destination_path"]):
os.remove(self._config["destination_path"])

# first try to move the file
if not file_moved and WormConfiguration.dropper_try_move_first:
# always try to move the file first
if not file_moved:
try:
shutil.move(self._config["source_path"], self._config["destination_path"])

Expand Down Expand Up @@ -187,11 +187,9 @@ def cleanup(self):
logger.info("Cleaning up the dropper")

try:
if (
(self._config["source_path"].lower() != self._config["destination_path"].lower())
and os.path.exists(self._config["source_path"])
and WormConfiguration.dropper_try_move_first
):
if self._config["source_path"].lower() != self._config[
"destination_path"
].lower() and os.path.exists(self._config["source_path"]):

# try removing the file first
try:
Expand Down
1 change: 0 additions & 1 deletion monkey/infection_monkey/example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

"monkey_dir_name": "monkey_dir",

"dropper_try_move_first": true,
"exploiter_classes": [
"SSHExploiter",
"SmbExploiter",
Expand Down
8 changes: 0 additions & 8 deletions monkey/monkey_island/cc/services/config_schema/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,6 @@
"Windows machine "
"(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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@
"dropper_date_reference_path_linux": "/bin/sh",
"dropper_target_path_linux": "/tmp/monkey",
"dropper_target_path_win_32": "C:\\Windows\\temp\\monkey32.exe",
"dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe",
"dropper_try_move_first": true
"dropper_target_path_win_64": "C:\\Windows\\temp\\monkey64.exe"
},
"logging": {
"dropper_log_path_linux": "/tmp/user-1562",
Expand Down