Attachment: ICS with Suspicious Office 365 app authorization (OAuth) link
Detects inbound messages with ICS calendar invites containing a suspicious Office 365 app authorization (OAuth) link. The app may be compromised or was stood up for malicious purposes. Once the app has been authorized, the attacker will have read or write permissions to the user's Office 365 account.
Sublime rule (View on GitHub)
1name: "Attachment: ICS with Suspicious Office 365 app authorization (OAuth) link"
2description: "Detects inbound messages with ICS calendar invites containing a suspicious Office 365 app authorization (OAuth) link. The app may be compromised or was stood up for malicious purposes. Once the app has been authorized, the attacker will have read or write permissions to the user's Office 365 account."
3references:
4 - "https://info.phishlabs.com/blog/office-365-phishing-uses-malicious-app-persist-password-reset"
5type: "rule"
6severity: "high"
7source: |
8 type.inbound
9 and any(attachments,
10 (
11 .file_type == "ics"
12 or .file_extension == "ics"
13 or .content_type in ("application/ics", "text/calendar")
14 )
15 //
16 // This rule makes use of a beta feature and is subject to change without notice
17 // using the beta feature in custom rules is not suggested until it has been formally released
18 //
19 and any(beta.file.parse_ics(.).events,
20 any(.links,
21 (
22 .href_url.domain.domain in (
23 'login.microsoftonline.com',
24 'login.microsoft.com'
25 )
26 or strings.icontains(.href_url.query_params,
27 "login.microsoftonline.com",
28 'login.microsoft.com'
29 )
30 )
31 and (
32 strings.ilike(.href_url.query_params,
33 '*offline_access*',
34 '*.readwrite*',
35 '*.read*',
36 '*ctx=*',
37 '*prompt=none*'
38 )
39 or (
40 strings.icontains(.href_url.path, '/common/reprocess')
41 and strings.icontains(.href_url.query_params, 'ctx=')
42 and strings.icontains(.href_url.query_params,
43 'sessionId='
44 )
45 )
46 )
47 )
48 )
49 )
50attack_types:
51 - "Credential Phishing"
52tactics_and_techniques:
53 - "Evasion"
54 - "Social engineering"
55 - "ICS Phishing"
56detection_methods:
57 - "File analysis"
58 - "Content analysis"
59 - "URL analysis"
60related_detections:
61 - "link_office365_suspicious_app_authorization.yml"
62 - "attachment_link_office365_suspicious_app_authorization.yml"
63 - "attachment_eml_link_office365_suspicious_app_authorization.yml"
64id: "6e9ab0a4-db49-533f-b6f3-7ba8d6d47348"