Skip to content

Commit 17f889c

Browse files
authored
2025/06/02 false positive reduction (#976)
* 2025/06/02 false positive reduction Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
1 parent 1511b6d commit 17f889c

11 files changed

Lines changed: 49 additions & 10 deletions

File tree

rules/anti-behavior/blocklist/user.yara

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ rule common_username_block_list: critical {
3737
$ = "test" fullword
3838
$ = "w0fjuOVmCcP5A" fullword
3939
40+
$not_grafana1 = "self.webpackChunkgrafana=self.webpackChunkgrafana||[]"
41+
$not_grafana2 = "The Grafana LLM plugin is not installed."
42+
$not_grafana3 = "grafana.debug.scenes"
4043
$not_jitsu = "jitsu.com"
4144
$not_redpanda = "redpanda"
4245
$not_wireshark = "wireshark.org"

rules/anti-static/obfuscation/bitwise.yara

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ rule bidirectional_bitwise_math_php: high {
173173
filesize < 192KB and all of them
174174
}
175175

176-
rule bitwise_obfuscation: critical {
176+
rule bitwise_obfuscation: high {
177177
meta:
178178
description = "uses bitwise math to obfuscate code"
179179
ref = "https://www.reversinglabs.com/blog/python-downloader-highlights-noise-problem-in-open-source-threat-detection"

rules/anti-static/obfuscation/padding.yara

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ rule msxml2_http: critical {
55
strings:
66
$a = /M.{0,48}S.{0,48}X.{0,48}M.{0,48}L.{0,48}2.{0,48}\.X.{0,48}M.{0,48}L.{0,48}H.{0,48}T.{0,48}T.{0,48}P.{0,48}/
77
8+
$not_i18next1 = "i18nextHttpBackend"
9+
$not_i18next2 = "u[\"User-Agent\"]=\"i18next-http-backend (node/\".concat(S.process.version,\"; \")"
10+
811
condition:
9-
filesize < 128KB and $a and !a > 32
12+
filesize < 128KB and $a and !a > 32 and none of ($not*)
1013
}
1114

1215
rule obfuscation_base64_str_replace: medium {

rules/anti-static/obfuscation/url.yara

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import "math"
22

3-
rule decode_url_component_char_code: critical {
3+
rule decode_url_component_char_code: high {
44
meta:
55
description = "decodes obfuscated URL components"
66
filetypes = "js,ts"

rules/exec/remote_commands/code_eval.yara

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ rule js_eval_response: critical {
4646
strings:
4747
$val = /eval\(\w{0,16}\.responseText\)/
4848
49+
$not_ejs = /EJS\.|EJS=/
50+
4951
condition:
50-
filesize < 1MB and any of ($val*)
52+
filesize < 1MB and any of ($val*) and not #not_ejs > 0
5153
}
5254

5355
rule js_eval_near_enough_fromChar: medium {

rules/false_positives/socat.yara

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
rule socat_override: override {
2+
meta:
3+
description = "usr/bin/socat1"
4+
SEKOIA_Hacktool_Socat_Strings = "high"
5+
6+
strings:
7+
$socat1 = "socat by Gerhard Rieger and contributors - see www.dest-unreach.org"
8+
$socat2 = "/tmp/socat-bind.XXXXXX"
9+
$socat3 = "copyright_socat"
10+
$socat4 = "socat_"
11+
12+
condition:
13+
all of them
14+
}

rules/false_positives/sonarqube.yara

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ rule sonarqube_tutorial_app: override {
1515

1616
rule sonar_analyzer_override: override {
1717
meta:
18-
description = "SonarQube SonarAnalyzer.CSharp.dll"
19-
COD3NYM_Reactor_Indicators = "medium"
18+
description = "SonarQube SonarAnalyzer.CSharp.dll"
19+
COD3NYM_Reactor_Indicators = "medium"
20+
COD3NYM_SUSP_OBF_NET_Reactor_Indicators_Jan24 = "medium"
2021

2122
strings:
2223
$ = "SonarAnalyzer" fullword

rules/false_positives/sqlmap.yara

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
rule sqlmap_override: override {
2+
meta:
3+
description = "metasploit.py"
4+
SIGNATURE_BASE_HKTL_Sqlmap = "high"
5+
SIGNATURE_BASE_Hacktool_Strings_P0Wnedshell = "high"
6+
7+
strings:
8+
$sqlmap1 = "Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org/)"
9+
$sqlmap2 = "Visit 'https://github.com/sqlmapproject/sqlmap/#installation' for further details"
10+
$sqlmap3 = /SqlmapBaseException|SqlmapDataException|SqlmapFilePathException|SqlmapShellQuitException|SqlmapSilentQuitException|SqlmapUserQuitException/
11+
$sqlmap4 = "if \"sqlmap.sqlmap\" in sys.modules"
12+
13+
condition:
14+
all of them
15+
}

rules/persist/ssh_authorized_keys.yara

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ rule ssh_authorized_key_append: critical {
2424
$append = "appendFile"
2525
$ssh_rsa = /ssh-[dr]sa [\w\+\/\=]{0,1024} [\w\-\.]{0,32}\@[\w\.\-]{1,64}/
2626
27-
$not_ssh_client = "SSH_AUTH_SOCK"
28-
$not_example = "/home/user/.ssh/authorized_keys"
27+
$not_ssh_client = "SSH_AUTH_SOCK"
28+
$not_example = "/home/user/.ssh/authorized_keys"
29+
$not_example_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com"
2930
3031
condition:
3132
all of ($ssh*) and $append and none of ($not*)

tests/npm/2024.testerrrrrrrrrr/init.js.simple

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
anti-static/obfuscation/bool: medium
33
anti-static/obfuscation/hex: medium
44
anti-static/obfuscation/js: high
5-
anti-static/obfuscation/url: critical
5+
anti-static/obfuscation/url: high
66
c2/addr/server: medium
77
data/encoding/int: medium
88
data/encoding/url: medium

0 commit comments

Comments
 (0)