Skip to content

Commit e0e4676

Browse files
committed
Clean up false positives
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
1 parent 85e092d commit e0e4676

7 files changed

Lines changed: 27 additions & 25 deletions

File tree

pkg/report/report.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func TrimPrefixes(path string, prefixes []string) string {
365365
return path
366366
}
367367

368-
// fileMatchesRules checks the scanned file's type against a rule's defined filetypes
368+
// fileMatchesRules checks the scanned file's type against a rule's defined filetypes.
369369
func fileMatchesRule(meta []yarax.Metadata, mime string) bool {
370370
for _, m := range meta {
371371
if m.Identifier() == "filetypes" {

rules/c2/tool_transfer/download.yara

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ rule download_sites: high {
2626
$not_manual = "manually upload"
2727
$not_paste_go = "paste.go"
2828
$not_netlify = "netlify.app"
29+
$not_misp_galaxy = "misp-galaxy:"
2930
3031
condition:
3132
any of ($d_*) and none of ($not*)
@@ -56,8 +57,10 @@ rule pastebin: medium {
5657
strings:
5758
$d_pastebin = /[\w\.]{1,128}astebin[\w\.\/]{1,128}/
5859
60+
$not_misp_galaxy = "misp-galaxy:"
61+
5962
condition:
60-
any of ($d_*)
63+
any of ($d_*) and none of ($not*)
6164
}
6265

6366
rule program_dropper_url: medium {

rules/c2/tool_transfer/exe_url.yara

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ rule http_url_with_exe: high {
55
strings:
66
$exe_url = /https*:\/\/[\w\.]{0,160}[:\/\w\_\-\?\@=]{6,160}\.exe/
77
$not_mongodb_404 = "https://docs.mongodb.com/manual/reference/method/Bulk.exe"
8-
$not_elastic = "\"license\": \"Elastic License v2\""
8+
$not_elastic = "\"license\": \"Elastic License v2\""
99
1010
condition:
1111
any of ($exe*) and none of ($not*)
@@ -15,7 +15,6 @@ rule http_ip_url_with_exe: critical {
1515
meta:
1616
description = "accesses hardcoded executable endpoint via IP"
1717

18-
1918
strings:
2019
$exe_url = /https*:\/\/[\d\.\:\[\]]{8,64}[:\/\w\_\-\?\@=]{6,160}\.exe/
2120

rules/exfil/discord.yara

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ rule discord_bot: high {
33
description = "Uses the Discord webhooks API"
44

55
strings:
6-
$webhook_endpoint = /discordapp.com\/api\/webhooks[\/\d]{0,32}/
6+
$webhook_endpoint = /discordapp.com\/api\/webhooks[\/\d]{0,32}/
77
$webhook_endpoint2 = /discord.com\/api\/webhooks[\/\d]{0,32}/
8-
$l_discordjs = "discord.js"
9-
$l_discord4j = "discord4j"
10-
$l_discordgo = "discordgo"
11-
$l_discord = "import discord"
12-
$l_disnake = "import disnake"
13-
$l_hikari = "import hikari"
14-
$l_interactions = "import interactions"
15-
$l_nextcord = "import nextcord"
16-
$l_jda = "net.dv8tion:JDA"
17-
$l_discordia = "discordia"
18-
$l_eris = /require\(("|')eris("|')\);/
19-
$l_oceanic = /require\(("|')oceanic.js("|')\);/
20-
$l_discordphp = "use Discord\\Discord;"
8+
$l_discordjs = "discord.js"
9+
$l_discord4j = "discord4j"
10+
$l_discordgo = "discordgo"
11+
$l_discord = "import discord"
12+
$l_disnake = "import disnake"
13+
$l_hikari = "import hikari"
14+
$l_interactions = "import interactions"
15+
$l_nextcord = "import nextcord"
16+
$l_jda = "net.dv8tion:JDA"
17+
$l_discordia = "discordia"
18+
$l_eris = /require\(("|')eris("|')\);/
19+
$l_oceanic = /require\(("|')oceanic.js("|')\);/
20+
$l_discordphp = "use Discord\\Discord;"
2121
22-
$not_pypi_index = /\"index_date\":\"\d{4}-\d{2}\d{2}\"/
22+
$not_pypi_index = /\"index_date\":\"\d{4}-\d{2}\d{2}\"/
2323
$not_pypi_index2 = "\"package_names\""
2424
2525
condition:

rules/impact/remote_access/botnet.yara

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ rule botnet_high: high {
2828
description = "References a 'botnet'"
2929

3030
strings:
31-
$bot_deployed = "bot deployed"
32-
$botnet = "Botnet"
33-
$not_phishing = "phishing"
34-
$not_keylogger = "keylogger"
31+
$bot_deployed = "bot deployed"
32+
$botnet = "Botnet"
33+
$not_phishing = "phishing"
34+
$not_keylogger = "keylogger"
3535
$not_wikiticker_contribution = "Undid revision 680586363 by"
3636
3737
condition:

rules/impact/remote_access/reverse_shell.yara

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ rule possible_reverse_shell: medium {
2727
$sh_bash = "/bin/bash"
2828
$sh = "/bin/sh"
2929
30+
$not_elastic = "\"license\": \"Elastic License v2\""
3031
$not_uc2 = "ucs2reverse"
3132
$not_pypi_index = "testpack-id-lb001"
3233

tests/linux/clean/misp_sample.ndjson.log.simple

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# linux/clean/misp_sample.ndjson.log: high
1+
# linux/clean/misp_sample.ndjson.log: medium
22
c2/addr/ip: medium
33
c2/addr/url: medium
4-
c2/tool_transfer/download: high
54
c2/tool_transfer/os: low
65
crypto/aes: low
76
crypto/decrypt: low

0 commit comments

Comments
 (0)