Google Share Notification with Suspicious Comments

This detection rule matches on messages which contain suspicious language within the comments of a Google share notification. Suspicious content within the comments section of the notification is deemed as email abbreviations such as FW:, FWD:, and RE: or by containing words that reference a file share.

Sublime rule (View on GitHub)

 1name: "Google Share Notification with Suspicious Comments"
 2description: "This detection rule matches on messages which contain suspicious language within the comments of a Google share notification.  Suspicious content within the comments section of the notification is deemed as email abbreviations such as FW:, FWD:, and RE: or by containing words that reference a file share."
 3type: "rule"
 4severity: "high"
 5source: |
 6  type.inbound
 7  and 
 8  // message is from google actual
 9  sender.email.domain.domain == 'google.com'
10  and (
11    sender.email.local_part == "drive-shares-noreply"
12    or sender.email.local_part == "drive-shares-dm-noreply"
13  )
14  // contains a comment
15  and strings.icontains(body.html.raw,
16                        '<div style="margin-top:24px; color:#5F6368">'
17  )
18  // those comments contain what appears to be an email
19  and (
20    regex.icontains(body.html.raw,
21                    '</div>\s*<div style="margin-top:24px; color:#5F6368">\s*(?:RE|FWD?)\s*:'
22    )
23    // the comment contains wording that relates to sharing a file
24    // the list before being sent through regexp-assemble
25    //   "request to view", "shared a file",   "sent you a file",
26    //   "file access request", "view shared document",
27    //   "pending file request", "document shared", "view a file",
28    //   "file sent to you", "invited to view", "file access invite",
29    //   "click to view", "open shared file", "drive file request"
30    or regex.icontains(body.html.raw,
31                       '</div>\s*<div style="margin-top:24px; color:#5F6368">[^<]*(?:<[^\/][^<]*)*(?:file (?:access (?:request|invite)|sent to you)|(?:s(?:ent you|hared) a|open shared) file|d(?:rive file request|ocument shared)|(?:invited|request|click) to view|view (?:shared document|a file)|pending file request)[^<]*(?:<[^\/][^<]*)*</div>\s*</td>'
32    )
33  )
34  // not where the sender display name of the message is within org_display_names
35  and not (
36    // the message is from google actual
37    sender.email.email in (
38      'comments-noreply@docs.google.com',
39      'drive-shares-dm-noreply@google.com',
40      'drive-shares-noreply@google.com',
41      'calendar-notification@google.com'
42    )
43    and headers.auth_summary.dmarc.pass
44    // but the sender display name is within org_display_names
45    and (
46      any(regex.iextract(sender.display_name,
47                                 '^(?P<sender_display_name>.*)\((?:via )?Google'
48                  ),
49                  .named_groups["sender_display_name"] in~ $org_display_names
50      )
51      or (
52        length(headers.reply_to) == 1
53        and all(headers.reply_to, .email.domain.domain in $org_domains)
54      )
55    )
56  )  
57attack_types:
58  - "Credential Phishing"
59tactics_and_techniques:
60  - "Impersonation: VIP"
61  - "Free file host"
62detection_methods:
63  - "HTML analysis"
64  - "Header analysis"
65  - "Sender analysis"
66  - "Content analysis"
67id: "c69c9924-33ed-564d-9ec3-5b3c5e1321c5"
to-top