Fix ransomware message and add new mass note placement sig#533
Fix ransomware message and add new mass note placement sig#533kevross33 wants to merge 1 commit intoCAPESandbox:masterfrom
Conversation
Fix sig so it works correctly when using NTWriteFile instead of appearing in dropped files (we return True immediately on one hit to avoid marking them all). Then add a new signatures for mass copying/writing the same likely ransomware message across multiple directories. It will mark the first 5 calls but display the count to avoid it returning potentially hundreds or even thousands of marked calls. BASTA
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the system's ability to detect ransomware activity. It refines an existing signature to catch a broader range of ransomware messages and introduces a new signature specifically designed to identify the widespread deployment of ransom notes across a file system, providing more comprehensive coverage against common ransomware behaviors. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request improves the RansomwareMessage signature by expanding the list of indicators and refining its logic. It also introduces a new signature, MassRansomNoteDrop, to detect the mass creation of ransom notes across multiple directories, which is a great addition. The changes in RansomwareMessage correctly switch to string-based matching and cover more API calls. However, there is a potential issue in the on_call method where a detected ransom note write could lead to duplicate findings from the on_complete method. My review includes a suggestion to fix this potential duplication.
| if len(matches) > 1: | ||
| self.mark_call() | ||
| self.ret = True | ||
| return True |
There was a problem hiding this comment.
The current implementation in on_call marks the API call but doesn't set self.ret = True. This means on_complete will still execute its logic. If a file is written via a hooked API call like NtWriteFile, it will likely also appear in the dropped files list. This can cause the same ransom note to be reported twice: once as a marked call from on_call, and again from on_complete. To prevent this duplication, you should set self.ret = True when a match is found in on_call. This will signal that the signature has already triggered and on_complete should not perform its check.
| if len(matches) > 1: | |
| self.mark_call() | |
| self.ret = True | |
| return True | |
| if len(matches) > 1: | |
| self.mark_call() | |
| self.ret = True | |
| return True |
Fix sig so it works correctly when using NTWriteFile instead of appearing in dropped files (we return True immediately on one hit to avoid marking them all).
Then add a new signatures for mass copying/writing the same likely ransomware message across multiple directories. It will mark the first 5 calls but display the count to avoid it returning potentially hundreds or even thousands of marked calls.
BASTA

LOCKBIT
