Detection rules › Sublime MQL

Attachment: ICS calendar file with base64 encoded recipient address in URL parameters

Severity
high
Type
rule
Source
github.com/sublime-security/sublime-rules

Detects inbound messages containing ICS calendar attachments where event links have multiple URL parameters, and the base64 decoded combination of those parameters matches the recipient's email address. This technique may be used to personalize malicious links or track specific targets.

Threat classification

Sublime's own taxonomy (not MITRE ATT&CK).

CategoryValues
Attack typesCredential Phishing
Tactics and techniquesEvasion, Social engineering, ICS Phishing

Event coverage

Rule body MQL

type.inbound
and any(attachments,
        (
          .file_type == "ics"
          or .file_extension == "ics"
          or .content_type in ("application/ics", "text/calendar")
        )
        //
        // This rule makes use of a beta feature and is subject to change without notice
        // using the beta feature in custom rules is not suggested until it has been formally released
        //
        and any(beta.file.parse_ics(.).events,
                any(filter(.links, length(.href_url.query_params_decoded) > 1),
                    any(strings.scan_base64(strings.concat(coalesce(flatten(values(.display_url.query_params_decoded
                                                                            )
                                                                    )[0],
                                                                    ""
                                                           ),
                                                           coalesce(flatten(values(.display_url.query_params_decoded
                                                                            )
                                                                    )[1],
                                                                    ""
                                                           ),
                                                           coalesce(flatten(values(.display_url.query_params_decoded
                                                                            )
                                                                    )[2],
                                                                    ""
                                                           ),
                                                           coalesce(flatten(values(.display_url.query_params_decoded
                                                                            )
                                                                    )[3],
                                                                    ""
                                                           ),
                                                           coalesce(flatten(values(.display_url.query_params_decoded
                                                                            )
                                                                    )[4],
                                                                    ""
                                                           ),
                                                           coalesce(flatten(values(.display_url.query_params_decoded
                                                                            )
                                                                    )[5],
                                                                    ""
                                                           )
                                            )
                        ),
                        . == recipients.to[0].email.email
                    )
                )
        )
) 

Detection logic

Scope: inbound message.

Detects inbound messages containing ICS calendar attachments where event links have multiple URL parameters, and the base64 decoded combination of those parameters matches the recipient's email address. This technique may be used to personalize malicious links or track specific targets.

  1. inbound message
  2. any of attachments where all hold:
    • any of:
      • .file_type is 'ics'
      • .file_extension is 'ics'
      • .content_type in ('application/ics', 'text/calendar')
    • any of beta.file.parse_ics(.).events where:
      • any of filter(.links) where:
        • any of strings.scan_base64(...) where:
          • . is recipients.to[0].email.email

Inspects: attachments[].content_type, attachments[].file_extension, attachments[].file_type, recipients.to[0].email.email, type.inbound. Sensors: beta.file.parse_ics, strings.concat, strings.scan_base64.

Indicators matched (4)

FieldMatchValue
attachments[].file_typeequalsics
attachments[].file_extensionequalsics
attachments[].content_typememberapplication/ics
attachments[].content_typemembertext/calendar