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

Address false positives seen with argocd, grafana, jupyterhub, and reflex #475

Merged
merged 5 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/compile/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var badRules = map[string]bool{
"ELASTIC_Macos_Creddump_Keychainaccess_535C1511": true,
"SIGNATURE_BASE_Reconcommands_In_File": true,
"SIGNATURE_BASE_Apt_CN_Tetrisplugins_JS": true,
"CAPE_Sparkrat": true,
// ThreatHunting Keywords (some duplicates)
"Adobe_XMP_Identifier": true,
"Antivirus_Signature_signature_keyword": true,
Expand Down
10 changes: 6 additions & 4 deletions rules/combo/degrader/edr_killer.yara
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ rule win_kill_proc_likely : high {
$debug_uhf = "UnhandledExceptionFilter"
$kill_gmh = "GetModuleHandle"
$kill_tp = "TerminateProcess"

condition:
filesize < 1MB and 1 of ($kill*) and 2 of ($debug*) and 1 of ($f*)
filesize < 1MB and 1 of ($kill*) and 2 of ($debug*) and 1 of ($f*)
}

rule win_kill_proc : critical {
rule win_kill_proc : high {
meta:
description = "Windows EDR/Antivirus bypass"
strings:
Expand All @@ -28,8 +29,9 @@ rule win_kill_proc : critical {
$debug_uhf = "UnhandledExceptionFilter"
$kill_gmh = "GetModuleHandle"
$kill_tp = "TerminateProcess"

condition:
filesize < 1MB and all of ($kill*) and 3 of ($debug*) and 1 of ($f*)
filesize < 1MB and all of ($kill*) and 3 of ($debug*) and 1 of ($f*)
}

rule edr_stopper : critical {
Expand All @@ -40,4 +42,4 @@ rule edr_stopper : critical {
$stop = "stopservice"
condition:
filesize < 1MB and $stop and any of ($kind*)
}
}
4 changes: 2 additions & 2 deletions rules/combo/stealer/browser.yara
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rule multiple_browser_credentials : high {
3 of ($c_*) and none of ($not_*)
}

rule multiple_browser_refs : critical {
rule multiple_browser_refs : high {
meta:
description = "Makes references to multiple browser credentials"
hash_1985_actions_UserGet = "e3a457ec75e3a042fb34fa6d49e0e833265d21d26c4e0119aaa1b6ec8a9460ec"
Expand Down Expand Up @@ -152,4 +152,4 @@ rule chrome_encrypted_cookies : critical {
$select = /SELECT.{0,64}encrypted_value{0,64}cookies/
condition:
$select
}
}
3 changes: 2 additions & 1 deletion rules/combo/stealer/crypto.yara
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rule js_crypto_stealer : critical {
rule js_crypto_stealer : high {
meta:
description = "steals private cryptographic data"
strings:
Expand All @@ -11,6 +11,7 @@ rule js_crypto_stealer : critical {
$url = /https{0,1}:\/\/[\w][\w\.\/\-_\?=\@]{8,64}/

$POST = "POST"

condition:
filesize < 50KB and $url and $POST and any of ($pk*)
}
3 changes: 2 additions & 1 deletion rules/obfuscation/js/char_codes.yara
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "math"

rule child_process : critical {
rule child_process : high {
meta:
description = "obfuscated javascript that relies on character manipulation"
filetypes = "javascript"
Expand All @@ -16,6 +16,7 @@ rule child_process : critical {
$const = "const "
$function = "function("
$return = "{return"

Copy link
Collaborator

Choose a reason for hiding this comment

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

also mark this as a "high"

Copy link
Member Author

Choose a reason for hiding this comment

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

If we move these to high, I can remove the exclusions. That would be a lot cleaner.

Copy link
Collaborator

@tstromberg tstromberg Oct 1, 2024

Choose a reason for hiding this comment

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

Works for me. In my mind, "CRITICAL" rules should never be broad enough for false positives to easily happen.

condition:
filesize < 128KB and all of them
}
3 changes: 2 additions & 1 deletion rules/obfuscation/js/function_spam.yara
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
rule js_const_func_obfuscation : critical {
rule js_const_func_obfuscation : medium {
meta:
description = "javascript obfuscation (excessive const functions)"
strings:
$const = "const "
$function = "function("
$return = "{return"

condition:
filesize < 256KB and #const > 32 and #function > 48 and #return > 64
}
3 changes: 2 additions & 1 deletion rules/obfuscation/js/parseInt.yara
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rule js_const_func_obfuscation : critical {
rule js_const_func_obfuscation : high {
meta:
description = "javascript obfuscation (integer parsing)"
filetypes = "javascript"
Expand All @@ -7,6 +7,7 @@ rule js_const_func_obfuscation : critical {
$function = "function("
$return = "{return"
$parseInt = "parseInt"

condition:
filesize < 256KB and #const > 16 and #function > 32 and #parseInt > 8 and #return > 32
}