Skip to content

Commit 9073a9a

Browse files
authored
Reduce "HIGH" rule hits based on initial Wolfi analysis (#118)
* Decrease rate of HIGH alert triggers * Fix base64_decode rule * Revert ignoreTagsFlag change * Split package_install, improve ssh auth key * More rule cleanup * Minor tweaks * More risk score lowering
1 parent 1284b51 commit 9073a9a

31 files changed

+91
-70
lines changed

rules/admin/package-install.yara

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rule yum_installer : suspicious {
1+
rule yum_installer : notable {
22
meta:
33
description = "Installs software using yum"
44
strings:
@@ -7,7 +7,7 @@ rule yum_installer : suspicious {
77
$val
88
}
99

10-
rule dnf_installer : suspicious {
10+
rule dnf_installer : notable {
1111
meta:
1212
description = "Installs software using dnf"
1313
strings:
@@ -16,7 +16,7 @@ rule dnf_installer : suspicious {
1616
$val
1717
}
1818

19-
rule rpm_installer : suspicious {
19+
rule rpm_installer : notable {
2020
meta:
2121
description = "Installs software using rpm"
2222
strings:
@@ -25,7 +25,7 @@ rule rpm_installer : suspicious {
2525
$val
2626
}
2727

28-
rule apt_installer : suspicious {
28+
rule apt_installer : notable {
2929
meta:
3030
description = "Installs software using apt"
3131
strings:
@@ -34,7 +34,7 @@ rule apt_installer : suspicious {
3434
$val
3535
}
3636

37-
rule apt_get_installer : suspicious {
37+
rule apt_get_installer : notable {
3838
meta:
3939
description = "Installs software using apt-get"
4040
strings:
@@ -45,7 +45,7 @@ rule apt_get_installer : suspicious {
4545
$val and not $foo
4646
}
4747

48-
rule apk_installer : suspicious {
48+
rule apk_installer : notable {
4949
meta:
5050
description = "Installs software using APK"
5151
strings:
@@ -62,18 +62,3 @@ rule pip_installer_regex : notable {
6262
condition:
6363
any of them
6464
}
65-
66-
rule pip_installer : suspicious {
67-
meta:
68-
description = "Installs software using pip from python"
69-
strings:
70-
$pip_install = "os.system('pip install"
71-
$pip_install_spaces = "'pip', 'install'"
72-
$pip_install_args = "'pip','install'"
73-
$pip3_install = "os.system('pip3 install"
74-
$pip3_install_spaces = "'pip3', 'install'"
75-
$pip3_install_args = "'pip3','install'"
76-
condition:
77-
any of them
78-
}
79-

rules/admin/pip_install.yara

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
rule pip_installer : suspicious {
2+
meta:
3+
description = "Installs software using pip from python"
4+
strings:
5+
$pip_install = "os.system('pip install"
6+
$pip_install_spaces = "'pip', 'install'"
7+
$pip_install_args = "'pip','install'"
8+
$pip3_install = "os.system('pip3 install"
9+
$pip3_install_spaces = "'pip3', 'install'"
10+
$pip3_install_args = "'pip3','install'"
11+
condition:
12+
any of them
13+
}
14+

rules/admin/shutdown.yara

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
rule shutdown_s : suspicious {
2+
rule shutdown_val : notable {
33
meta:
44
description = "calls shutdown command"
55
strings:

rules/combo/backdoor/php.yara

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ rule php_possible_backdoor : critical {
99
hash_2023_0xShell_0xShellori = "506e12e4ce1359ffab46038c4bf83d3ab443b7c5db0d5c8f3ad05340cb09c38e"
1010
hash_2023_0xShell_wesoori = "bab1040a9e569d7bf693ac907948a09323c5f7e7005012f7b75b5c1b2ced10ad"
1111
strings:
12-
$php = "php"
12+
$php = "<?php"
1313
$php_or = "<? "
1414
$f_base64_decode = "base64_decode"
1515
$f_strrev = "strrev"
@@ -77,6 +77,7 @@ rule php_bin_hashbang : critical {
7777

7878
rule php_urlvar_recon_exec : critical {
7979
meta:
80+
description = "Runs programs, gets URL data, and looks up system info"
8081
ref = "Backdoor.PHP.Llama"
8182
hash_2023_PHP_Backdoor_PHP_Goonshell_a = "42e5fafe25af2d2600691a26144cc47320ccfd07a224b72452dfa7de2e86ece3"
8283
hash_2023_PHP_Backdoor_PHP_Llama = "8de0f8ef54bff5e3b694b7585dc66ef9fd5a4b019a6650b8a2211db888e59dac"
@@ -87,6 +88,8 @@ rule php_urlvar_recon_exec : critical {
8788
hash_2023_Sysrv_Hello_sys_x86_64 = "cd784dc1f7bd95cac84dc696d63d8c807129ef47b3ce08cd08afb7b7456a8cd3"
8889
hash_2023_0xShell_0xShellori = "506e12e4ce1359ffab46038c4bf83d3ab443b7c5db0d5c8f3ad05340cb09c38e"
8990
strings:
91+
$php = "<?php"
92+
9093
$e_popen = "popen("
9194
$e_exec = "exec("
9295
$f_uname = "uname("
@@ -96,7 +99,7 @@ rule php_urlvar_recon_exec : critical {
9699
97100
$not_php = "PHP_VERSION_ID"
98101
condition:
99-
any of ($e*) and any of ($f*) and any of ($x*) and none of ($not*)
102+
any of ($p*) and any of ($e*) and any of ($f*) and any of ($x*) and none of ($not*)
100103
}
101104

102105
rule php_system_to_perl {

rules/combo/recon/capabilities.yara

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
rule hostinfo_collector : suspicious {
1+
rule process_capabilities_val : notable {
22
meta:
3-
description = "enumerates process capabilities"
3+
description = "enumerates Linux capabilities for process"
44
strings:
55
$capsh = "capsh" fullword
66
$self_status = "/proc/self/status"

rules/combo/stealer/browser.yara

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ rule multiple_browser_credentials_2 {
5454
}
5555

5656

57-
rule multiple_browser_refs : suspicious {
57+
rule multiple_browser_refs : notable {
5858
meta:
5959
description = "Uses HTTP, archives, and references multiple browsers"
6060
strings:
61+
$d_config = ".config" fullword
62+
$d_app_support = "Application Support" fullword
63+
6164
$h_http = "http" fullword
6265
$h_POST = "POST" fullword
6366
@@ -72,5 +75,5 @@ rule multiple_browser_refs : suspicious {
7275
$b_Safari = "Safari"
7376
$b_Chrome = "Chrome"
7477
condition:
75-
any of ($h*) and any of ($z*) and 2 of ($b*)
78+
any of ($d*) and any of ($h*) and any of ($z*) and 2 of ($b*)
7679
}

rules/combo/stealer/telegram.yara

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ rule discord_password_post_chat : suspicious {
22
meta:
33
description = "gets passwords, makes HTTP requests, and uses Telegram"
44
strings:
5-
$c3 = "api.telegram"
6-
$c4 = "Telegram"
5+
$c3 = "api.telegram.org"
76
87
$h1 = "get("
98
$h2 = "post("

rules/combo/wiper/crypto.yara

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
rule uname_hostname_encrypt_wipe_kill : suspicious {
33
meta:
4+
description = "May encrypt, wipe files, and kill processes"
45
hash_2023_Royal = "06abc46d5dbd012b170c97d142c6b679183159197e9d3f6a76ba5e5abf999725"
56
hash_2023_blackcat_x64 = "45b8678f74d29c87e2d06410245ab6c2762b76190594cafc9543fb9db90f3d4f"
67
hash_2021_miner_gkqjh = "00ae07c9fe63b080181b8a6d59c6b3b6f9913938858829e5a42ab90fb72edf7a"

rules/combo/worm/ssh.yara

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ rule ssh_snake_worm : suspicious {
1010
1111
$u_base64 = "base64"
1212
$u_uname = "uname"
13+
14+
$strict_host = "StrictHostKeyChecking"
1315
condition:
14-
all of ($s*) and any of ($h*) and any of ($u*)
16+
$strict_host and all of ($s*) and any of ($h*) and any of ($u*)
1517
}
1618

1719
rule ssh_worm_router : suspicious {

rules/crypto/file-encrypter.yara

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rule file_crypter : suspicious {
1+
rule file_crypter : notable {
22
meta:
33
description = "Encrypts files"
44
strings:

0 commit comments

Comments
 (0)