Detection rules › Sublime MQL
Attachment: HTML file contains exclusively Javascript
Attached HTML file does not contain any HTML other than a <script> block.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | Credential Phishing, Malware/Ransomware |
| Tactics and techniques | Evasion, HTML smuggling, Scripting |
Event coverage
| Message attribute |
|---|
| attachments (collection) |
| type |
Rule body MQL
type.inbound
and any(attachments,
(
.file_extension in~ ("html", "htm", "shtml", "dhtml")
or .file_extension in~ $file_extensions_common_archives
or .file_type == "html"
)
and any(file.explode(.),
length(.scan.strings.strings) == 1
and any(.scan.strings.strings,
regex.imatch(., '\s{0,}<script.*')
)
and any(.scan.strings.strings,
strings.ends_with(., "</script>")
)
)
)
Detection logic
Scope: inbound message.
Attached HTML file does not contain any HTML other than a <script> block.
- inbound message
any of
attachmentswhere all hold:any of:
- .file_extension in ('html', 'htm', 'shtml', 'dhtml')
- .file_extension in $file_extensions_common_archives
- .file_type is 'html'
any of
file.explode(.)where all hold:- length(.scan.strings.strings) is 1
any of
.scan.strings.stringswhere:- . matches '\\s{0,}<script.*'
any of
.scan.strings.stringswhere:- . ends with '</script>'
Inspects: attachments[].file_extension, attachments[].file_type, type.inbound. Sensors: file.explode, regex.imatch, strings.ends_with. Reference lists: $file_extensions_common_archives.
Indicators matched (7)
| Field | Match | Value |
|---|---|---|
attachments[].file_extension | member | html |
attachments[].file_extension | member | htm |
attachments[].file_extension | member | shtml |
attachments[].file_extension | member | dhtml |
attachments[].file_type | equals | html |
regex.imatch | regex | \s{0,}<script.* |
strings.ends_with | suffix | </script> |