Skip to content

Add signatures for unbacked memory activities#547

Merged
kevoreilly merged 19 commits intoCAPESandbox:masterfrom
kevross33:patch-637360
Mar 25, 2026
Merged

Add signatures for unbacked memory activities#547
kevoreilly merged 19 commits intoCAPESandbox:masterfrom
kevross33:patch-637360

Conversation

@kevross33
Copy link
Copy Markdown
Contributor

@kevross33 kevross33 commented Mar 19, 2026

This file implements multiple signatures to detect suspicious activities related to unbacked memory, including DLL loading, token manipulation, registry modifications, network connections, named pipe creation, VEH registration, and process creation.

Some of these are still not fully tested but I don't think they should not work as the ones I have found work fine and they are all implemented with similar logic.

Kazuar (Turla APT backdoor) 1749c96cc1a4beb9ad4d6e037e40902fac31042fa40152f1d3794f49ed1a2b5c
image

image image

LUMMA 47b04598800c3231e8dd3eae7d187a42b131f851584403be28f1f4364cf523fa
image

Dridexv4 17afaf60c24ec98039d4273f24888fd457b4aede1e11871e56ed7149ff504fea
image

Pikabot ca5fb5814ec62c8f04936740aabe2664b3c7d036203afbd8425cd67cf1f4b79d
image

This file implements multiple signatures to detect suspicious activities related to unbacked memory, including DLL loading, token manipulation, registry modifications, network connections, named pipe creation, VEH registration, and process creation.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 introduces a new Python module containing a suite of Cuckoo Sandbox signatures. These signatures are designed to enhance the detection capabilities for advanced evasion techniques by identifying various suspicious activities, such as DLL loading, token manipulation, registry modifications, network connections, named pipe creation, VEH registration, and process creation, specifically when these actions originate from dynamically allocated, unbacked memory regions. This helps in uncovering fileless malware and other stealthy threats.

Highlights

  • Unbacked Library Load Detection: Added a signature to detect when a new DLL is loaded from a caller address originating from dynamically allocated (unbacked) memory.
  • Unbacked Token Manipulation Detection: Implemented a signature to identify attempts to open, duplicate, or impersonate access tokens by threads executing in unbacked memory.
  • Unbacked Registry Persistence Detection: Introduced a signature to flag modifications to the Windows registry originating from threads in unbacked memory.
  • Unbacked Network Connection Detection: Added a signature to detect network connections initiated by threads executing in dynamically allocated (unbacked) memory.
  • Unbacked Named Pipe Creation Detection: Created a signature to identify the creation of named pipes by threads in unbacked memory, potentially indicating P2P SMB beacons.
  • Unbacked VEH Registration Detection: Included a signature to detect the registration of Vectored Exception Handlers (VEH) where the callback function points to unbacked memory.
  • Unbacked Process Creation Detection: Added a signature to identify new child processes spawned by threads executing in unbacked memory.

🧠 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.

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable set of signatures for detecting suspicious activities originating from unbacked memory. The overall implementation is solid, but I've identified a few areas for improvement. Specifically, there's a correctness issue in the UnbackedMemoryNetworkConnection signature that could cause it to miss detections, for which I've provided a fix. I also noticed a minor issue with a duplicated TTP entry and significant code duplication across the new signature classes. Addressing the code duplication by refactoring the common logic would greatly improve the long-term maintainability of this new module.

@kevoreilly kevoreilly merged commit dacbf58 into CAPESandbox:master Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants