Skip to content

Commit a59c789

Browse files
[PR #3027] modified rule: Link: Multiple HTTP protocols in single URL
1 parent 7ef09cf commit a59c789

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

detection-rules/3027_link_multiple_http_protocols_in_single_url.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ source: |
88
and any(body.current_thread.links,
99
.visible
1010
// no ability to loop query_params_decoded, so create the non-decoded equivlent
11+
and not strings.icontains(.href_url.url, 'unsubscribe')
12+
and not strings.icontains(.display_text, 'unsubscribe')
1113
and any(regex.extract(.href_url.query_params,
1214
'[?&](?P<name>[^=&]+)(?:=(?P<value>[^&]*))?'
1315
),
@@ -16,7 +18,7 @@ source: |
1618
regex.contains(.named_groups['value'],
1719
'^(?:https?(?:%253[Aa]|%3[Aa]|:))?(?:%252[Ff]|%2[Ff]|/)(?:%252[Ff]|%2[Ff]|/)'
1820
)
19-
// the number of unique domains in the URL query param is greater or equal to 2
21+
// the number of unique domains in the URL query param is greater or equal to three
2022
and length(distinct(map(filter(regex.iextract(.named_groups['value'],
2123
'(?:https?(?:%253[Aa]|%3[Aa]|:))?(?:%252[Ff]|%2[Ff]|/)(?:%252[Ff]|%2[Ff]|/)(?P<domain>[^/\s&%]+)'
2224
),
@@ -32,7 +34,7 @@ source: |
3234
), .)
3335
) >= 3
3436
35-
// there are five or more total URLs in that query param
37+
// there are three or more total URLs in that query param
3638
and regex.count(.named_groups['value'],
3739
'(?:https?(?:%253[Aa]|%3[Aa]|:))?(?:%252[Ff]|%2[Ff]|/)(?:%252[Ff]|%2[Ff]|/)'
3840
) >= 3
@@ -52,4 +54,4 @@ detection_methods:
5254
id: "dea82f37-8cfd-5233-9deb-bc436aba8182"
5355
og_id: "92f9d241-ebd2-53b8-9c67-6f9ec3e263b8"
5456
testing_pr: 3027
55-
testing_sha: c54242faa3be72f6990dc70be2dba12603690f97
57+
testing_sha: 908c8e4b153d3186056418f2295bf2e2e62fd89e

0 commit comments

Comments
 (0)