Skip to content
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

Updated to exclude false positives from common CLI searches like "fin… #5209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kagebunsher
Copy link

…dstr /i eyJ0eX".

Summary of the Pull Request

The original rule generated too many false positives because it simply looked for the presence of JWT tokens (eyJ0eX or eyJhbG) anywhere in the command line. This caused benign processes—especially those involving legitimate use of JWTs—to be flagged unnecessarily.

For instance, in the example provided, the token is used as a query parameter in a legitimate process (such as opening a link in a browser), and there is no indication of malicious activity. Attackers often use tools like findstr to search for tokens within process memory dumps (e.g., strings64.exe WINWORD.EXE.dmp | findstr /i eyJ0eX). Consequently, just seeing a JWT in the command line is insufficient to consider it malicious or suspicious.

By requiring the presence of findstr together with the JWT token pattern (e.g., eyJ0eX), the new rule focuses on the actual technique attackers typically use:

Dumping process memory (using tools such as strings64.exe),
Searching for JWT tokens with findstr.
This approach reduces false positives while still detecting malicious behavior. In other words, the updated rule is more precise because it only triggers when a suspect JWT search command (findstr) occurs rather than every instance of JWT usage.

I don't want to just edit this rule, it really produces a lot of false positives.
I would appreciate it if you could write my nickname (kagebunsher) somewhere in the rule.

Changelog

update: description - Edited according to the new code.
delete: new: detection:selection:CommandLine|contains - It increases the false positive rate.
new: detection:selection:CommandLine|regex - The regex containing findstr was written to include all jwt starts already in the code.

Example Log Event

I can't provide the event log. The following log would normally be found, but will not be detected due to the enhancement, which is now FP-reduced.

Processes.parent_process="C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE",
Processes.parent_process_name="OUTLOOK.EXE",
Processes.process=""C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --single-argument ?tk=&languageId=1",
Processes.process_exec="msedge.exe",
Processes.process_name="msedge.exe",
Processes.user="",

Fixed Issues

6d3a3952-6530-44a3-8554-cf17c116c615

SigmaHQ Rule Creation Conventions

  • My PR don't adds new rules.

@github-actions github-actions bot added Rules Windows Pull request add/update windows related rules labels Feb 24, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @kagebunsher 👋

It looks like this is your first pull request on the Sigma rules repository!

Please make sure to read the SigmaHQ conventions document to make sure your contribution is adhering to best practices and has all the necessary elements in place for a successful approval.

Thanks again, and welcome to the Sigma community! 😃

Comment on lines +21 to +23
CommandLine|regex:
- '(?i)findstr.*(?i)eyJhbG[a-zA-Z0-9]*'
- '(?i)findstr.*(?i)eyJ0eX[a-zA-Z0-9]*'
Copy link
Member

Choose a reason for hiding this comment

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

This will reduce the coverage by a lot and invalidate the original logic of the rule.

findstr is only one of many ways one could search for these strings, do not take only public reporting as a use case.

If you say this is creating a lot of FPs. Please provide some anonymized examples. As the presence of JWT in CLI is common but limited and can be excluded.

We could downgrade it to low and/or move it as a hunting rule, if necessary and after seeing some data if possible.

@nasbench nasbench added the Author Input Required changes the require information from original author of the rules label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author Input Required changes the require information from original author of the rules Rules Windows Pull request add/update windows related rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants