Attachment: ICS calendar invite with Google share.google URL shortener in undocumented redirect forms

Detects inbound messages with ICS calendar invites containing links in either of two undocumented Google share.google redirect forms: google./share.google?q=, and share.google/?link=. Both inherit Google domain reputation to mask an attacker-controlled destination. Google publishes the share.google shortener as a share.google/ path, but neither the on-Google-domain ‘q’ form nor the ‘link’ parameter form is documented.

Sublime rule (View on GitHub)

 1name: "Attachment: ICS calendar invite with Google share.google URL shortener in undocumented redirect forms"
 2description: "Detects inbound messages with ICS calendar invites containing links in either of two undocumented Google share.google redirect forms: google.<tld>/share.google?q=<code>, and share.google/?link=<url>. Both inherit Google domain reputation to mask an attacker-controlled destination. Google publishes the share.google shortener as a share.google/<code> path, but neither the on-Google-domain ‘q’ form nor the ‘link’ parameter form is documented."
 3type: "rule"
 4severity: "medium"
 5source: |
 6  type.inbound
 7  and any(attachments,
 8          (
 9            .file_type == "ics"
10            or .file_extension == "ics"
11            or .content_type in ("application/ics", "text/calendar")
12          )
13          //
14          // This rule makes use of a beta feature and is subject to change without notice
15          // using the beta feature in custom rules is not suggested until it has been formally released
16          //
17          and any(beta.file.parse_ics(.).events,
18                  any(.links,
19                      (
20                        .href_url.domain.sld == "google"
21                        and strings.istarts_with(.href_url.path, '/share.google')
22                        and 'q' in keys(.href_url.query_params_decoded)
23                      )
24                      or (
25                        .href_url.domain.root_domain == "share.google"
26                        and any(["link", "_task", "_mbox", "_mimeclass"],
27                                . in keys(..href_url.query_params_decoded)
28                        )
29                      )
30                  )
31          )
32  )  
33attack_types:
34  - "Spam"
35  - "Credential Phishing"
36tactics_and_techniques:
37  - "Open redirect"
38  - "Social engineering"
39detection_methods:
40  - "URL analysis"
41  - "Content analysis"
42  - "File analysis"
43related_detections:
44  - "link_google_share_google.yml"
45  - "attachment_google_share_google_link.yml"
46id: "49d95b8b-e2c6-5ac1-8a41-61afff9da2c2"
to-top