-
Notifications
You must be signed in to change notification settings - Fork 557
[New Rule] Potential PowerShell Obfuscation via Reverse Keywords #4609
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
base: main
Are you sure you want to change the base?
Conversation
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
⛔️ Test failed Results
|
| WHERE event.code == "4104" | ||
|
||
// Filter for scripts that contains these keywords using MATCH, boosts the query performance, match will ignore the | and look for the individual words | ||
| WHERE powershell.file.script_block_text : "rahc|metsys|stekcos|tcejboimw|ecalper|ecnerferpe|noitcennoc|nioj|eman|vne|gnirts|tcejbo-wen|_23niw|noisserpxe|ekovni|daolnwod" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious if we might be able to work with SecML on an ML job that identifies obfuscation, regardless of pattern with the right algorithm or model. Or maybe it already exists?
rules/windows/defense_evasion_posh_obfuscation_reverse_keyword.toml
Outdated
Show resolved
Hide resolved
⛔️ Test failed Results
|
⛔️ Test failed Results
|
Issues
Part of https://github.com/elastic/ia-trade-team/issues/533
Summary
Identifies PowerShell scripts that use reversed strings as a form of obfuscation. These methods are designed to evade
static analysis and bypass security protections such as the Antimalware Scan Interface (AMSI).
3 hits last 90d on telemetry, no FPs
Additional information
From my testing, the | KEEP condition doesn’t need to specify any fields other than the metadata ones (_id and _index), as the engine appears to populate the alert using them. However, I’m keeping it as-is because it significantly improves performance in Discovery and makes the results more understandable if someone uses the query for hunting.
Sample Match