georgearun1585/Threat-Hunting-Scenario---Second-Vector-BEC-Power-Automate-Abuse-and-Conditional-Access-Bypass-
GitHub: georgearun1585/Threat-Hunting-Scenario---Second-Vector-BEC-Power-Automate-Abuse-and-Conditional-Access-Bypass-
一个基于 Microsoft Sentinel 的威胁狩猎场景,详细记录并分析了利用 Power Automate 滥用和 Conditional Access 绕过实施的 BEC 攻击。
Stars: 0 | Forks: 0
# 威胁狩猎场景 - 第二攻击向量 BEC:Power Automate 滥用与 Conditional Access 绕过
商业电子邮件入侵 (BEC)、Power Automate 滥用以及 Conditional Access 绕过。
# 狩猎 08 – 第二攻击向量
## 商业电子邮件入侵、Power Automate 滥用与 Conditional Access 绕过
### 环境
**平台:** Microsoft Sentinel
**工作区:** law-cyber-range
**事件:** 87241
**数据源:**
* SigninLogs
* CloudAppEvents
* OfficeActivity
* MicrosoftGraphActivityLogs
* EmailEvents
* IdentityLogonEvents
* BehaviorAnalytics
* AuditLogs
# 执行摘要
本次调查确认了一起针对 Microsoft 365 用户账户的商业电子邮件入侵 (BEC) 攻击。攻击者从匿名的境外 IP 地址进行身份验证,通过 Microsoft Graph 执行了云侦察,滥用 Power Automate 自动化欺诈操作,建立了邮箱持久化,访问了敏感文件,并尝试了付款重定向欺诈。
调查显示,由于攻击者利用了旧版身份验证路径,导致 Conditional Access 控制从未被应用,使得单因素会话绕过了 MFA 强制执行。
# 阶段 1 – 初始访问调查
本次调查始于身份保护告警,该告警指示了来自匿名 IP 地址的登录。
### 识别攻击者登录
```
SigninLogs
| where TimeGenerated between (datetime(2026-06-11 00:00:00) .. datetime(2026-06-12 00:00:00))
| where IPAddress == "103.69.224.136"
| project TimeGenerated, AppDisplayName, ResultType,
ConditionalAccessStatus, UserAgent
| order by TimeGenerated asc
```
### 调查结果
| 字段 | 值 |
| -------------- | --------------------------------------------------------- |
| 源 IP | 103.69.224.136 |
| 位置 | 荷兰阿姆斯特丹 |
| User Agent | Linux / Chrome |
| 风险检测 | 匿名 IP |
| 账户 | [m.smith@lognpacific.org](mailto:m.smith@lognpacific.org) |
该源 IP 与匿名化基础设施相关联,表明攻击者故意隐藏了其来源。
# 阶段 2 – 身份验证分析
### 识别凭据失败
```
SigninLogs
| where TimeGenerated between (datetime(2026-06-11 00:00:00) .. datetime(2026-06-12 00:00:00))
| where IPAddress == "103.69.224.136"
| where ResultType == 50126
```
### 调查结果
结果代码 50126 出现了两次。
这证实了攻击者在获取有效凭据之前,最初的身份验证失败了。
# 阶段 3 – MFA 调查
一个关键问题是 MFA 是否已实际完成。
### 审查身份验证详细信息
```
SigninLogs
| where IPAddress == "103.69.224.136"
| project TimeGenerated,
AppDisplayName,
AuthenticationDetails
```
### 调查结果
身份验证记录显示:
* 密码正确
* 先前已满足的声明
* 身份验证进行中
* 无成功的 MFA 挑战
结果:
**MFA Satisfied Count = 0**
攻击者使用的是已存在的已验证会话进行操作,而不是成功完成了 MFA。
# 阶段 4 – Conditional Access 调查
### 评估 Conditional Access
```
SigninLogs
| where IPAddress == "103.69.224.136"
| summarize count() by ConditionalAccessStatus
```
### 调查结果
ConditionalAccessStatus:
```
notApplied
```
### 评估
Conditional Access 策略从未被评估。
攻击者使用的是存在于 Conditional Access 强制执行范围之外的旧版身份验证路径。
**结论:** 未应用 Conditional Access;旧版身份验证绕过了 Conditional Access。
# 阶段 5 – 会话关联
调查需要将登录、云活动和邮箱操作关联到单一的攻击者会话。
### 身份保护告警分析
```
SecurityAlert
| where AlertName contains "Identity"
| project Entities
```
### 调查结果
Session ID:
```
005d431a-380b-1f5e-e554-16d5010dc28e
```
此标识符出现在多个 Microsoft 365 服务中。
# 阶段 6 – 云侦察
### Microsoft Graph 活动
```
MicrosoftGraphActivityLogs
| where IPAddress == "103.69.224.136"
| project TimeGenerated,
RequestMethod,
RequestUri
| order by TimeGenerated asc
```
### 调查结果
观察到的请求包括:
```
/roleManagement/directory/estimateAccess
/users/{id}?$select=mail
/users/{id}?$select=signInActivity
/reports/authenticationMethods/userRegistrationDetails
```
攻击者系统性地探测了:
* 账户权限
* MFA 注册状态
* 租户许可
* 用户信息
# 阶段 7 – MFA 注册侦察
### 身份验证注册枚举
```
MicrosoftGraphActivityLogs
| where RequestUri contains "/reports/authenticationMethods"
```
### 调查结果
查询的资源:
```
userRegistrationDetails
```
攻击者在继续下一步之前,专门调查了 MFA 注册状态。
MITRE ATT&CK:
**T1087.004 – Account Discovery: Cloud Account**
# 阶段 8 – 组成员身份枚举
### 查询
```
MicrosoftGraphActivityLogs
| where RequestUri contains "/me/memberOf"
```
### 调查结果
攻击者枚举了受害者的 Azure AD 组成员身份,以了解其权限和组织访问权限。
# 阶段 9 – 支付欺诈侦察
### 历史邮件审查
```
EmailEvents
| where TimeGenerated between (datetime(2026-01-01) .. datetime(2026-06-12))
| project TimeGenerated,
Subject,
SenderFromAddress,
RecipientEmailAddress
```
### 调查结果
攻击者审查了历史付款审批对话,包括:
```
Q1 Vendor Payment Schedule - Review Required
```
这使得攻击者在尝试欺诈之前了解了内部付款工作流程。
# 阶段 10 – 欺诈执行
### 邮件流分析
```
EmailEvents
| where SenderFromAddress == "m.smith@lognpacific.org"
| project TimeGenerated,
Subject,
RecipientEmailAddress
```
### 调查结果
欺诈邮件:
```
FW: Updated Banking Details - Pacific IT Monthly
```
收件人:
```
j.reynolds@lognpacific.org
```
攻击者试图通过修改后的银行详细信息进行付款重定向。
# 阶段 11 – 邮箱持久化
### 收件箱规则调查
```
OfficeActivity
| where Operation has "InboxRule"
| project TimeGenerated,
Operation,
Parameters
```
### 调查结果
规则 1:
```
Invoice Processing
```
操作:
```
MoveToFolder = Archive
```
规则 2:
```
Backup Copy
```
操作:
```
ForwardTo = merovingian1337@proton.me
```
### 评估
攻击者压制了来自欺诈目标的回复,并秘密复制了未来的通信。
# 阶段 12 – SharePoint 和 OneDrive 活动
### 文件操作
```
OfficeActivity
| where ClientIP contains "103.69.224.136"
| summarize count() by Operation
```
### 调查结果
观察到:
* FileAccessed
* FileDownloaded
* PageViewed
* ListViewed
下载的文件:
```
3
```
有限数量的下载表明这是蓄意选择,而不是批量收集。
# 阶段 13 – 凭据发现
### 访问的文件
```
OfficeActivity
| where Operation == "FileAccessed"
| project OfficeObjectId
```
### 调查结果
识别出的敏感文件:
```
VPN-Access-Credentials.txt
```
这将范围扩大到了电子邮件入侵之外,表明攻击者对基础设施访问存在潜在兴趣。
# 阶段 14 – Power Automate 滥用
### Graph 转发操作
```
MicrosoftGraphActivityLogs
| where RequestUri contains "/forward"
| project TimeGenerated,
IPAddress,
AppId,
UserAgent,
SessionId
```
### 调查结果
源 IP:
```
20.150.129.194
```
Application ID:
```
7ab7862c-4c57-491e-8a45-d52a7e023983
```
User Agent:
```
azure-logic-apps/1.0
microsoft-flow/1.0
```
### 评估
邮件转发操作源自通过 Microsoft Graph API 的 Power Automate,而不是直接来自攻击者的工作站。
# 阶段 15 – 入侵范围
### 跨表可见性
```
let attackerIP = "103.69.224.136";
```
攻击者 IP 出现在:
* SigninLogs
* CloudAppEvents
* OfficeActivity
* MicrosoftGraphActivityLogs
* EmailEvents
* IdentityLogonEvents
* BehaviorAnalytics
总计:
```
7 in-scope telemetry sources
```
# 根本原因分析
入侵成功的原因是:
1. 获得了有效凭据。
2. 旧版身份验证绕过了 Conditional Access。
3. 从未成功完成 MFA。
4. 现有的已验证会话保持活动状态。
5. Power Automate 提供了持久化和自动化。
# 补救措施
### 立即遏制
1. 吊销所有活动会话。
2. 使 refresh token 失效。
3. 重置账户密码。
4. 移除恶意收件箱规则。
5. 移除恶意的 Power Automate 工作流。
6. 禁用旧版身份验证。
7. 审查 OAuth 权限。
8. 强制实施防钓鱼 MFA。
### 关键经验教训
仅重置密码并不能移除攻击者的访问权限。
现有的会话和 refresh token 在密码更改后仍然有效。
**要求序列:**
```
Revoke sessions → Remove persistence → Reset credentials
```
未能首先吊销会话将使攻击者能够立即重新创建流、收件箱规则和持久化机制。
# MITRE ATT&CK 映射
| 技术 | 描述 |
| --------- | ---------------------------------- |
| T1078.004 | Valid Accounts – Cloud Accounts |
| T1087.004 | Account Discovery – Cloud Accounts |
| T1098 | Account Manipulation |
| T1114 | Email Collection |
| T1213 | Data from Information Repositories |
| T1102 | Web Service Abuse |
# 结论
本次调查重构了一次完整的基于云的商业电子邮件入侵攻击,涉及凭据滥用、Conditional Access 绕过、Microsoft Graph 侦察、Power Automate 持久化、邮箱篡改以及有针对性的金融欺诈。
此次攻击展示了在账户被入侵后,云原生服务是如何被滥用的,并凸显了 Conditional Access 覆盖、会话吊销、Power Platform 治理以及全面的 Microsoft 365 遥测监控的重要性。
标签:KQL, Microsoft Sentinel, StruQ, 业务电子邮件入侵, 安全运营, 扫描框架