Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update spam_image_hidden_element.yml #2309

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions detection-rules/spam_image_hidden_element.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ source: |
or
// the hidden span/div is before the body/meta
regex.contains(body.html.raw,
'<(?:span|div)[^\>]*style=\x22[^\x22]*\s*(?:display\s*\x3a\s*none|visibility\s*\x3a\s*hidden)\x3b[^\x22]*\x22(?:\s*\w+=\"\w+\")*>\s*\<(?:body|meta)'
'<(?:span|div)[^\>]*style=\x22[^\x22]*\s*(?:display\s*\x3a\s*none|visibility\s*\x3a\s*hidden)\x3b[^\x22]*\x22(?:\s*\w+=\"\w+\")*>\s*\<(?:body|meta|(?:<?div[^\>]+\>\s*(?:[^\<]*|<[a-z]+>\s*)<\/div>\s*){2,})'
)
// the length of the inner text is greather than or equal to 10x more than the display text
// this attempts to generically cover multiple methods of hidding text
// this attempts to generically cover multiple methods of hiding text
or length(body.html.inner_text) >= (length(body.html.display_text) * 10)
)
)
Expand Down
Loading