Skip to content

Updates 01 #2624

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

Merged
merged 2 commits into from
Jun 17, 2025
Merged

Updates 01 #2624

merged 2 commits into from
Jun 17, 2025

Conversation

enzok
Copy link
Contributor

@enzok enzok commented Jun 16, 2025

No description provided.

Copy link
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.

Summary of Changes

Hello @enzok, 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 focuses on enhancing our malware detection capabilities by introducing a new YARA rule for 'AdaptixBeacon' and substantially improving the existing rules for 'NitrogenLoader'. The changes aim to increase the accuracy and breadth of detection for these malware families, adapting to new variants and behaviors.

Highlights

  • New Malware Detection Rule: I've added a new YARA rule, AdaptixBeacon.yar, specifically designed to detect 'AdaptixBeacon' payloads. This rule identifies the malware based on a combination of configuration-related strings and WinInet API usage patterns.
  • NitrogenLoader Rule Enhancements: I've significantly updated the existing NitrogenLoader.yar and NitrogenLoaderConfig.yar rules. This includes adding a new sample hash, refining existing string patterns, and introducing new patterns to identify additional decryption routines (including RC4), anti-analysis techniques (Task Manager related), and a new key extraction method. The detection conditions have also been made more robust to improve coverage against new variants.
  • Improved Configuration Extraction: The NitrogenLoaderConfig.yar rule's cape_options have been updated to capture an additional decryption key, providing more comprehensive configuration extraction for NitrogenLoader samples.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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

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

The pull request updates YARA rules for NitrogenLoader and adds a new rule for AdaptixBeacon. The condition in NitrogenLoaderConfig might be too broad, and the regex in $decrypt1 could be more specific. Consider renaming $string1 for clarity and adding descriptions to bp actions. The condition in NitrogenLoader might also be too broad.

Comment on lines 54 to +55
condition:
all of them
any of them
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The condition any of them might be too broad for reliable config extraction given the specificity of the cape_options. The cape_options require both $decrypt1 and $key to be present for the breakpoints and actions to function correctly. Consider changing the condition to ensure $decrypt1 and $key are matched for reliable config extraction.

        $decrypt1 and $key

strings:
$decrypt1 = {48 8B 8C 24 [4] 0F B6 04 01 89 ?? 24 [1-4] 48 63 4C 24 ?? 33 D2 48 8B C1 48 F7 B4 24 [4] 48 8B C2 48 8B 8C}
$decrypt1 = {48 63 4? 24 ?? 33 D2 48 [0-3] F7 B4 24 [4] 48 8B C2 48 8B 8C 24 [4] 0F BE 04 01}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The wildcard ? in the regex can match more than intended. Consider using a more specific character class or escaping special characters if you intend to match them literally.

        $decrypt1 = {48 63 4[0-9a-fA-F] 24 ?? 33 D2 48 [0-3] F7 B4 24 [4] 48 8B C2 48 8B 8C 24 [4] 0F BE 04 01}

strings:
$stringaes1 = {63 7c 77 7b f2 6b 6f c5 30 01 67 2b fe d7 ab 76 ca 82 c9 7d fa}
$stringaes2 = {52 09 6a d5 30 36 a5 38 bf 40 a3 9e 81 f3 d7 fb 7c e3 39 82 9b}
$string1 = "BASS_GetEAXParameters"
$string1 = "GetComputerNameExA"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Consider renaming $string1 to something more descriptive, such as $api_getcomputername, to improve readability and maintainability.

        $api_getcomputername = "GetComputerNameExA"

@@ -45,10 +45,12 @@ rule NitrogenLoaderConfig
meta:
author = "enzok"
description = "NitrogenLoader Config Extraction"
cape_options = "bp0=$decrypt1*+6,hc0=1,count=0,action0=string:rcx,typestring=NitrogenLoader Config"
cape_options = "bp0=$decrypt1*+1,bp1=$key*-4,hc=1,count=0,action0=string:rcx,action1=string:rdx,typestring=NitrogenLoader Config"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Consider adding a description to each bp action, to clarify the purpose of each action.

        cape_options = "bp0=$decrypt1*+1,action0=string:rcx // decryption string,bp1=$key*-4,action1=string:rdx // key,hc=1,count=0,typestring=NitrogenLoader Config"

Comment on lines +29 to +30
condition:
(2 of ($string*) and any of ($syscall*)) or 4 of ($decrypt*) or (3 of ($taskman_*) and all of ($rc4decrypt_*))
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The condition (2 of ($string*) and any of ($syscall*)) or 4 of ($decrypt*) or (3 of ($taskman_*) and all of ($rc4decrypt_*)) might be too broad. Consider narrowing the conditions for better accuracy.

        (2 of ($string*) and any of ($syscall*)) or (4 of ($decrypt*) and any of ($syscall*)) or (3 of ($taskman_*) and all of ($rc4decrypt_*))

@kevoreilly kevoreilly merged commit 52e4b43 into kevoreilly:master Jun 17, 2025
2 of 3 checks passed
@kevoreilly
Copy link
Owner

🙏

@enzok enzok deleted the updates-01 branch June 17, 2025 16:18
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