vsxlourrane/PROJETO-Microsoft-Sentinel
GitHub: vsxlourrane/PROJETO-Microsoft-Sentinel
一个完整的 SOC 蓝队实战项目,演示如何使用 Microsoft Sentinel 和 KQL 检测 Azure AD 密码喷洒攻击并执行完整的事件响应流程。
Stars: 0 | Forks: 0
# 使用 Microsoft Sentinel 检测 Password Spray




# 场景
监控系统在 12 分钟内检测到针对 Azure AD 账户的 **847 次登录失败尝试**。随后,来自罗马尼亚 IP 的 **3 次成功登录** ——该公司日志中从未出现过该国家。
**任务:**作为 SOC N1 分析师,检测、调查、遏制并记录此次攻击。
# 项目目标
- 通过 Microsoft Sentinel 中的 KQL 检测 Password Spray 攻击
- 通过事件关联识别受损账户
- 对可疑 IP 执行 IOC Enrichment
- 执行包含遏制措施的应急响应
- 编写完整的 Incident Report
# 使用的工具
| Microsoft Sentinel | SIEM — 检测与调查 |
| :--- | :--- |
| KQL (Kusto Query Language) | 用于日志分析的查询语言 |
| Azure AD Sign-in Logs | 身份数据源 |
| AbuseIPDB | 可疑 IP 的 IOC enrichment |
| ipinfo.io | IP 地理定位 |
| MITRE ATT&CK Navigator | 攻击技术映射 |
# MITRE ATT&CK
| Initial Access | T1078 | Valid Accounts | 使用受损的合法凭证 |
| :--- | :--- | :--- | :--- |
| Credential Access | T1110.003 | Password Spraying | 使用常见密码进行多次尝试 |
| Persistence | T1556 | MFA Manipulation | 绕过多因素认证 |
# KQL 查询
# Query 1 — 检测 Password Spray
```
SigninLogs
| where TimeGenerated > ago(1h)
| where ResultType != 0
| summarize
TotalFalhas = count(),
UsuariosAfetados = dcount(UserPrincipalName),
PrimeiroEvento = min(TimeGenerated),
UltimoEvento = max(TimeGenerated),
ListaUsuarios = make_set(UserPrincipalName, 5)
by IPAddress
| where TotalFalhas > 20 and UsuariosAfetados > 5
| extend
DuracaoMinutos = datetime_diff('minute', UltimoEvento, PrimeiroEvento),
RiscoNivel = case(
TotalFalhas > 500, "🔴 CRITICO",
TotalFalhas > 100, "🟠 ALTO",
TotalFalhas > 20, "🟡 MEDIO",
"🟢 BAIXO")
| project
IPAddress,
RiscoNivel,
TotalFalhas,
UsuariosAfetados,
DuracaoMinutos,
PrimeiroEvento,
UltimoEvento,
ListaUsuarios
| sort by TotalFalhas desc
```
### Query 2 — 受损账户(失败后的登录)
```
let IPsSuspeitos = SigninLogs
| where TimeGenerated > ago(2h)
| where ResultType != 0
| summarize Falhas = count() by IPAddress
| where Falhas > 15
| project IPAddress;
SigninLogs
| where TimeGenerated > ago(2h)
| where ResultType == 0
| where IPAddress in (IPsSuspeitos)
| project
TimeGenerated,
UserPrincipalName,
IPAddress,
Location,
AppDisplayName
| order by TimeGenerated desc
```
# 事件时间线
| 14:32 | 开始登录尝试 — IP 45.33.32.156 (罗马尼亚) |
| :--- | :--- |
| 14:44 | 累计 847 次失败 — Sentinel 触发警报 |
| 14:45 | 登录成功 — 账户 user@empresa.com |
| 14:47 | N1 分析师收到警报并开始调查 |
| 14:52 | 通过 Conditional Access Policy 封锁 IP |
| 14:55 | 重置密码 + 对受影响账户强制执行 MFA |
| 15:10 | 事件已遏制 — 未确认有数据窃取 |
# 已识别的 IOC
| IP | 45.33.32.156 | 🔴 恶意 — AbuseIPDB 评分 100 |
| :--- | :--- | :--- |
| IP | 91.108.4.0/22 | 🔴 恶意 — 可疑 ASN |
| 源国家 | 罗马尼亚 (RO) | ⚠️ 以往日志中从未出现 |
| 时间 | 14:32–14:44 UTC | ⚠️ 非工作时间 |
# 应急响应
### 遏制
- ✅ 通过 Azure AD 中的 Conditional Access Policy 封锁 IP
- ✅ 终止受影响账户的活跃会话
- ✅ 重置 3 个受损用户的密码
### 根除
- ✅ 在所有账户上启用并强制执行 MFA
- ✅ 审查受影响账户的权限
### 经验教训
- 实施连续 10 次失败后的自动锁定机制
- 针对非常见国家/地区的登录创建警报
- 审查密码策略 —— 弱密码助长了 spray 攻击
# 仓库结构
```
soc-projeto1-sentinel/
├── README.md
├── queries/
│ ├── password-spray-detection.kql
│ └── compromised-account-detection.kql
└── docs/
└── incident-report.md
```
# 关于
本项目作为信息安全分析师(Blue Team)职位的 SOC 作品集的一部分开发。
**展示的技能:**
KQL • Microsoft Sentinel • Incident Response • MITRE ATT&CK •
Log Analysis • IOC Enrichment • Detection Engineering
标签:AbuseIPDB, AMSI绕过, Azure AD, Cloudflare, Incident Response, IOC enrichment, KQL, Kusto查询语言, Microsoft Sentinel, MITRE ATT&CK, 云端安全, 信标 enrichment, 初级安全分析师, 威胁情报, 威胁检测, 安全运营中心, 密码喷射, 开发者工具, 攻击溯源, 网络安全, 网络映射, 蓝队演练, 身份安全, 防御策略, 隐私保护