-
Notifications
You must be signed in to change notification settings - Fork 807
Ransomware README with configurable directories #1309
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
Conversation
def test_no_readme_if_no_directory( | ||
build_ransomware_payload, ransomware_payload_config, ransomware_target | ||
): | ||
ransomware_payload_config["encryption"]["enabled"] = True | ||
ransomware_payload_config["encryption"]["directories"]["linux_target_dir"] = "" | ||
ransomware_payload_config["encryption"]["directories"]["windows_target_dir"] = "" | ||
ransomware_payload_config["other_behaviors"]["readme"] = True | ||
ransomware_payload = build_ransomware_payload(ransomware_payload_config) | ||
|
||
ransomware_payload.run_payload() | ||
assert not Path(ransomware_target / README_DEST).exists() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With an empty target directory, there's no reason to think that a readme would be left in ransomware_target/
. From the test's perspective, it's very unpredictable where RansomwarePayload might leave the file. It depends on how we're processing the target directory and how that code handles an empty path. This assert
is not sufficient to verify that no readme file is left on the system.
Take a look at test_readme_already_exists()
. This test needs to basically do the same thing, which is to assert that no attempt at copying the file is made.
monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## develop #1309 +/- ##
========================================
Coverage 30.86% 30.87%
========================================
Files 454 454
Lines 13544 13545 +1
========================================
+ Hits 4181 4182 +1
Misses 9363 9363
Continue to review full report at Codecov.
|
8b5091d
to
eb36869
Compare
What does this PR do?
Fixes first task of #1287 . If we don't specify a directory, the readme should not be left.
PR Checklist
Testing Checklist
Explain Changes
Are the commit messages enough? If not, elaborate.