Link: Suspicious Office 365 app authorization (OAuth) link

Detects inbound messages with body links to a suspicious Office 365 app authorization (OAuth) request. 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: "Link: Suspicious Office 365 app authorization (OAuth) link"
 2description: "Detects inbound messages with body links to a suspicious Office 365 app authorization (OAuth) request. 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([body.links, body.current_thread.links],
10          any(.,
11              (
12                .href_url.domain.domain in (
13                  'login.microsoftonline.com',
14                  'login.microsoft.com'
15                )
16                or strings.icontains(.href_url.query_params,
17                                     "login.microsoftonline.com",
18                                     'login.microsoft.com'
19                )
20              )
21              and (
22                strings.ilike(.href_url.query_params,
23                              '*offline_access*',
24                              '*.readwrite*',
25                              '*.read*',
26                              '*ctx=*',
27                              '*prompt=none*'
28                )
29                or (
30                  (
31                    strings.icontains(.href_url.path, '/common/reprocess')
32                    or strings.icontains(.href_url.query_params,
33                                         "/common/reprocess"
34                    )
35                  )
36                  and strings.icontains(.href_url.query_params, 'ctx=')
37                  and strings.icontains(.href_url.query_params, 'sessionId=')
38                )
39              )
40          )
41  )  
42attack_types:
43  - "Credential Phishing"
44detection_methods:
45  - "URL analysis"
46related_detections:
47  - "attachment_link_office365_suspicious_app_authorization.yml"
48  - "attachment_ics_link_office365_suspicious_app_authorization.yml"
49  - "attachment_eml_link_office365_suspicious_app_authorization.yml"
50id: "13a8c430-3e62-5c8f-86b5-3722599bead4"
to-top