Attachment: Google share.google URL shortener in undocumented redirect forms

Detects inbound messages whose attachments contain 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. ICS calendar attachments are covered by a separate rule.

Sublime rule (View on GitHub)

 1name: "Attachment: Google share.google URL shortener in undocumented redirect forms"
 2description: "Detects inbound messages whose attachments contain 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. ICS calendar attachments are covered by a separate rule."
 3type: "rule"
 4severity: "medium"
 5source: |
 6  type.inbound
 7  and any(attachments,
 8          not (
 9            .file_type == "ics"
10            or .file_extension == "ics"
11            or .content_type in ("application/ics", "text/calendar")
12          )
13          and any(file.explode(.),
14                  any(.scan.url.urls,
15                      (
16                        .domain.sld == "google"
17                        and strings.istarts_with(.path, '/share.google')
18                        and 'q' in keys(.query_params_decoded)
19                      )
20                      or (
21                        .domain.root_domain == "share.google"
22                        and any(["link", "_task", "_mbox", "_mimeclass"],
23                                . in keys(..query_params_decoded)
24                        )
25                      )
26                  )
27          )
28  )  
29attack_types:
30  - "Spam"
31  - "Credential Phishing"
32tactics_and_techniques:
33  - "Open redirect"
34  - "Social engineering"
35detection_methods:
36  - "URL analysis"
37  - "Content analysis"
38  - "File analysis"
39related_detections:
40  - "link_google_share_google.yml"
41  - "attachment_ics_google_share_google_link.yml"
42id: "840d7a90-3b3a-5fe1-a9c6-eac5deb4c14f"
to-top