Skip to content

Commit 1b8e82d

Browse files
committed
2025/06/02 false positive reduction
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
1 parent 1511b6d commit 1b8e82d

10 files changed

Lines changed: 51 additions & 5 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: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ rule bitwise_obfuscation: critical {
188188
$f_substr = "substr("
189189
$f_ord = "ord("
190190
191+
$not_phpseclib1 = "http://phpseclib.sourceforge.net"
192+
$not_phpseclib2 = "Pure-PHP PKCS#1 (v2.1) compliant implementation of RSA."
193+
$not_phpseclib3 = "Pure-PHP ASN.1 Parser"
194+
$not_phpseclib4 = "Pure-PHP arbitrary precision integer arithmetic library."
195+
$not_phpseclib5 = "Pure-PHP implementation of SFTP."
196+
$not_phpseclib6 = "Pure-PHP implementation of SSHv2."
197+
$not_symfony1 = "This file is part of the Symfony package."
198+
$not_symfony2 = "(c) Fabien Potencier <fabien@symfony.com>"
199+
$not_voku1 = "namespace voku\\helper;"
200+
$not_voku2 = "final class ASCII"
201+
191202
condition:
192-
filesize < 192KB and $php and any of ($bit*) and 3 of ($f*)
203+
filesize < 192KB and $php and any of ($bit*) and 3 of ($f*) and none of ($not*)
193204
}

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

rules/false_positives/sonarqube.yara

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ rule sonar_analyzer_override: override {
1717
meta:
1818
description = "SonarQube SonarAnalyzer.CSharp.dll"
1919
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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
strings:
7+
$sqlmap1 = "Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org/)"
8+
$sqlmap2 = "Visit 'https://github.com/sqlmapproject/sqlmap/#installation' for further details"
9+
$sqlmap3 = /SqlmapBaseException|SqlmapDataException|SqlmapFilePathException|SqlmapShellQuitException|SqlmapSilentQuitException|SqlmapUserQuitException/
10+
$sqlmap4 = "if \"sqlmap.sqlmap\" in sys.modules"
11+
condition:
12+
all of them
13+
}

rules/persist/ssh_authorized_keys.yara

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ rule ssh_authorized_key_append: critical {
2626
2727
$not_ssh_client = "SSH_AUTH_SOCK"
2828
$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)