Skip to content

Conversation

@ailiffa
Copy link
Contributor

@ailiffa ailiffa commented Jan 21, 2026

Closes #5572

Summary - What I changed

This PR addresses two detection gaps in the "Unsigned DLL Side-Loading from a Suspicious Folder" rule that allowed a real DLL sideloading attack to evade detection.

Change 1: Add Downloads to suspicious paths list

"?:\\Users\\*\\Downloads\\*.dll"

Downloads is a common malware execution location but was missing from the list that already includes Documents, Pictures, Music, and Public folders.

Change 2: Fix subdirectory evasion with directory matching logic

Changed from endswith~ to startswith~:

// Before: requires DLL in exact same directory as exe
endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), 
          substring(process.executable, 0, length(process.executable) - (length(process.name) + 1)))

// After: catches DLLs in subdirectories of the exe's location
startswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), 
            substring(process.executable, 0, length(process.executable) - (length(process.name) + 1)))

Why this matters:

Attackers can trivially bypass the original rule by placing the malicious DLL one directory level deeper. The analyzed sample used a Chrome sideloading technique where the malicious chrome_elf.dll was placed in a version numbered subfolder (143.0.7499.110\), mimicking Chrome's legitimate directory structure:

Component Path
EXE directory ...\FPS_BOOSTER\
DLL directory ...\FPS_BOOSTER\143.0.7499.110\

The existing filters (suspicious base paths, unsigned DLL, trusted process signature, recent file modification time) constrain false positives when using the broader startswith~ matching. A legitimate application loading unsigned DLLs from subdirectories within a user's Downloads folder is inherently suspicious and worth investigating. Tested against a real environment without generating additional false positives.

image

How To Test

Tested against a real info stealer sample that uses Chrome DLL sideloading. The modified rule correctly identified the sideloading activity without generating additional false positives.

Test query with both changes applied:

library where host.os.type == "windows" and
 process.code_signature.trusted == true and
 (dll.Ext.relative_file_creation_time <= 500 or dll.Ext.relative_file_name_modify_time <= 500) and
 not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*", "errorChaining") and
   dll.path : (
       "?:\\Users\\*\\Downloads\\*.dll",
       "?:\\Users\\*\\Documents\\*.dll",
       "?:\\Users\\*\\Pictures\\*.dll",
       "?:\\Users\\*\\Music\\*.dll",
       "?:\\Users\\Public\\*.dll"
       /* additional paths truncated for brevity */
   ) and
 startswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1)))

Sample event indicators from tested malware:

Field Value
dll.name chrome_elf.dll
dll.path C:\Users\dadre\Downloads\FPS_BOOSTER\143.0.7499.110\chrome_elf.dll
dll.pe.original_file_name engine_complete_hyper.dll
dll.code_signature.exists false
process.executable C:\Users\dadre\Downloads\FPS_BOOSTER\fps.exe
process.code_signature.subject_name Google LLC

Checklist

  • Added a label for the type of pr: bug, enhancement, schema, maintenance, Rule: New, Rule: Deprecation, Rule: Tuning, Hunt: New, or Hunt: Tuning so guidelines can be generated
  • Added the meta:rapid-merge label if planning to merge within 24 hours
  • Automated testing was updated or added to match the most common scenarios
  • Documentation and comments were added for features that require explanation

…loads path and fix subdirectory evasion

- Add Downloads folder to the suspicious paths list
- Modify directory matching logic from endswith~ to startswith~ to detect DLLs loaded from subdirectories of the executable's location
@Samirbous
Copy link
Contributor

Samirbous commented Jan 23, 2026

@ailiffa thank you for reporting this gap. the problem is this side-loading using version numbers to redirect to a sub-dir or another folder is specific to chromium processes and will introduce FPs if we change the current condition requires DLL in exact same directory as exe. I would suggest to create a new rule for chrome_elf.dll or add it in this rule as a tuning in an OR condition to have minimal impact on FP volume:

library where host.os.type == "windows" and

 process.code_signature.trusted == true and

 (dll.Ext.relative_file_creation_time <= 500 or dll.Ext.relative_file_name_modify_time <= 500) and

  not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*", "errorChaining") and

      /* Suspicious Paths */
      dll.path : 
                ("?:\\PerfLogs\\*.dll",
                  "?:\\Users\\*\\Pictures\\*.dll",
                  "?:\\Users\\*\\Music\\*.dll",
                  "?:\\Users\\Public\\*.dll",
                  "?:\\Users\\*\\Downloads\\*.dll", // added downloads
                  "?:\\Users\\*\\Documents\\*.dll",
                  "?:\\Windows\\Tasks\\*.dll",
                  "?:\\Windows\\System32\\Tasks\\*.dll",
                  "?:\\Intel\\*.dll",
                  "?:\\AMD\\Temp\\*.dll",
                  "?:\\Windows\\AppReadiness\\*.dll",
                  "?:\\Windows\\ServiceState\\*.dll",
                  "?:\\Windows\\security\\*.dll",
		  "?:\\Windows\\System\\*.dll",
                  "?:\\Windows\\IdentityCRL\\*.dll",
                  "?:\\Windows\\Branding\\*.dll",
                  "?:\\Windows\\csc\\*.dll",
                  "?:\\Windows\\DigitalLocker\\*.dll",
                  "?:\\Windows\\en-US\\*.dll",
                  "?:\\Windows\\wlansvc\\*.dll",
                  "?:\\Windows\\Prefetch\\*.dll",
                  "?:\\Windows\\Fonts\\*.dll",
                  "?:\\Windows\\diagnostics\\*.dll",
                  "?:\\Windows\\TAPI\\*.dll",
                  "?:\\Windows\\INF\\*.dll",
                  "?:\\windows\\tracing\\*.dll",
                  "?:\\windows\\IME\\*.dll",
                  "?:\\Windows\\Performance\\*.dll",
                  "?:\\windows\\intel\\*.dll",
                  "?:\\windows\\ms\\*.dll",
                  "?:\\Windows\\dot3svc\\*.dll",
                  "?:\\Windows\\ServiceProfiles\\*.dll",
                  "?:\\Windows\\panther\\*.dll",
                  "?:\\Windows\\RemotePackages\\*.dll",
                  "?:\\Windows\\OCR\\*.dll",
                  "?:\\Windows\\appcompat\\*.dll",
                  "?:\\Windows\\apppatch\\*.dll",
                  "?:\\Windows\\addins\\*.dll",
                  "?:\\Windows\\Setup\\*.dll",
                  "?:\\Windows\\Help\\*.dll",
                  "?:\\Windows\\SKB\\*.dll",
                  "?:\\Windows\\Vss\\*.dll",
                  "?:\\Windows\\Web\\*.dll",
                  "?:\\Windows\\servicing\\*.dll",
                  "?:\\Windows\\CbsTemp\\*.dll",
                  "?:\\Windows\\Logs\\*.dll",
                  "?:\\Windows\\WaaS\\*.dll",
                  "?:\\Windows\\twain_32\\*.dll",
                  "?:\\Windows\\ShellExperiences\\*.dll",
                  "?:\\Windows\\ShellComponents\\*.dll",
                  "?:\\Windows\\PLA\\*.dll",
                  "?:\\Windows\\Migration\\*.dll",
                  "?:\\Windows\\debug\\*.dll",
                  "?:\\Windows\\Cursors\\*.dll",
                  "?:\\Windows\\Containers\\*.dll",
                  "?:\\Windows\\Boot\\*.dll",
                  "?:\\Windows\\bcastdvr\\*.dll",
                  "?:\\Windows\\TextInput\\*.dll",
                  "?:\\Windows\\schemas\\*.dll",
                  "?:\\Windows\\SchCache\\*.dll",
                  "?:\\Windows\\Resources\\*.dll",
                  "?:\\Windows\\rescache\\*.dll",
                  "?:\\Windows\\Provisioning\\*.dll",
                  "?:\\Windows\\PrintDialog\\*.dll",
                  "?:\\Windows\\PolicyDefinitions\\*.dll",
                  "?:\\Windows\\media\\*.dll",
                  "?:\\Windows\\Globalization\\*.dll",
                  "?:\\Windows\\L2Schemas\\*.dll",
                  "?:\\Windows\\LiveKernelReports\\*.dll",
                  "?:\\Windows\\ModemLogs\\*.dll",
                  "?:\\Windows\\ImmersiveControlPanel\\*.dll",
                  "?:\\$Recycle.Bin\\*.dll") and

	 /* DLL loaded from the process.executable current directory OR chrome_elf.dll that can be loader from a sub-dir by version number*/
	(endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1))) or dll.name : "chrome_elf.dll")

@Samirbous Samirbous added the Rule: Tuning tweaking or tuning an existing rule label Jan 23, 2026
@github-actions
Copy link
Contributor

Rule: Tuning - Guidelines

These guidelines serve as a reminder set of considerations when tuning an existing rule.

Documentation and Context

  • Detailed description of the suggested changes.
  • Provide example JSON data or screenshots.
  • Provide evidence of reducing benign events mistakenly identified as threats (False Positives).
  • Provide evidence of enhancing detection of true threats that were previously missed (False Negatives).
  • Provide evidence of optimizing resource consumption and execution time of detection rules (Performance).
  • Provide evidence of specific environment factors influencing customized rule tuning (Contextual Tuning).
  • Provide evidence of improvements made by modifying sensitivity by changing alert triggering thresholds (Threshold Adjustments).
  • Provide evidence of refining rules to better detect deviations from typical behavior (Behavioral Tuning).
  • Provide evidence of improvements of adjusting rules based on time-based patterns (Temporal Tuning).
  • Provide reasoning of adjusting priority or severity levels of alerts (Severity Tuning).
  • Provide evidence of improving quality integrity of our data used by detection rules (Data Quality).
  • Ensure the tuning includes necessary updates to the release documentation and versioning.

Rule Metadata Checks

  • updated_date matches the date of tuning PR merged.
  • min_stack_version should support the widest stack versions.
  • name and description should be descriptive and not include typos.
  • query should be inclusive, not overly exclusive. Review to ensure the original intent of the rule is maintained.

Testing and Validation

  • Validate that the tuned rule's performance is satisfactory and does not negatively impact the stack.
  • Ensure that the tuned rule has a low false positive rate.

….toml


Swap back to "endswith" and add chrome_elf.dll coverage.

Co-authored-by: Samirbous <[email protected]>
@ailiffa
Copy link
Contributor Author

ailiffa commented Jan 23, 2026

@Samirbous Thanks for the feedback and the suggested approach. I wanted to check my understanding of the FP concern. My initial thought was that legitimate apps loading from subdirectories would already be filtered out by the unsigned DLL condition, since vendors like Google, Microsoft, and most Electron app publishers sign their DLLs. Am I missing something in the FP scenarios you've seen?

@w0rk3r w0rk3r requested a review from Samirbous January 26, 2026 23:32
@Samirbous
Copy link
Contributor

Samirbous commented Jan 27, 2026

Am I missing something in the FP scenarios you've seen?

@ailiffa unfortunately we see many unsigned and legit DLLs loaded from sub-dirs as well as other directories (the code signature status decreases a bit FPs but not eliminate)

Copy link
Contributor

@Samirbous Samirbous left a comment

Choose a reason for hiding this comment

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

adds chrome_elf.dll in an OR condition to the current dir and Downloads to the list of suspicious folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport: auto Domain: Endpoint OS: Windows windows related rules Rule: Tuning tweaking or tuning an existing rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Rule Tuning] Unsigned DLL Side-Loading from a Suspicious Folder (58b0d8e5534f62bfc51f8de8ca370dc1b8699e69)

2 participants