From 0c8e3aadb75af13e765aef29b4b3f3faba7b8199 Mon Sep 17 00:00:00 2001 From: Translator Date: Sun, 21 Jun 2026 13:53:42 +0000 Subject: [PATCH] Translated ['src/pentesting-cloud/azure-security/az-unauthenticated-enum --- .../az-monitor-alert-phishing.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/pentesting-cloud/azure-security/az-unauthenticated-enum-and-initial-entry/az-monitor-alert-phishing.md diff --git a/src/pentesting-cloud/azure-security/az-unauthenticated-enum-and-initial-entry/az-monitor-alert-phishing.md b/src/pentesting-cloud/azure-security/az-unauthenticated-enum-and-initial-entry/az-monitor-alert-phishing.md new file mode 100644 index 000000000..95ca3a601 --- /dev/null +++ b/src/pentesting-cloud/azure-security/az-unauthenticated-enum-and-initial-entry/az-monitor-alert-phishing.md @@ -0,0 +1,62 @@ +# Az - Monitor Alert 钓鱼 + +{{#include ../../../banners/hacktricks-training.md}} + +## Monitor Alert 钓鱼 + +目前[^disclosure]可以绕过 Azure Monitoring Action Group 的通知,即当用户被添加到 monitoring group 时不会触发提示,从而允许攻击者以来自 `azure-monitor@microsoft.com` 的、部分可自定义 monitoring 消息和标题,向任意地址发送邮件,并且具备完整的 DMARC 验证。 + +[^disclosure]: 这已于 3/17/2026 报告给 Microsoft。等你读到这里时,他们可能已经修复,也可能没有。 + +执行此攻击,你需要一个 Azure subscription 和一个目标列表。 + +### Setup +#### Entra ID +对于你想要攻击的每个用户,在你的 tenant 中创建一个 Entra ID 用户。所有设置都可以保持默认,用户名可使用任意内容。 +唯一重要的设置是 `Contact Information` 下的 `Email` 属性。将其设置为实际的目标邮箱地址。 + +创建好用户后,为它们在 ***SUBSCRIPTION*** 上分配 `Monitoring Reader`。 + +然后,等待 24 小时让权限传播[^slow]。实际情况似乎只需要几个小时,但 Microsoft 就是 Microsoft。 + +[^slow]: [确实就是这么慢](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/action-groups#email-azure-resource-manager) + +#### Azure Monitor Action Group +`Name` 和 `Display Name` 会对受害者可见,所以请选择合适的内容。 +如果你知道受害者已订阅的某个 Action Group 的名称,那可能是个不错的选择。 + +将通知类型设置为 `Email Azure Resource Manager`,目标设置为 `Monitoring Reader`。不要启用 `Common Alert Schema`。 +虽然这样攻击仍然“能用”,但可自定义字段会藏得更深,邮件前部还会包含更多上下文,可能会让其说服力稍弱。 + + +#### Azure Monitor Alert Rule +这里是最重要的自定义发生的地方! + +名称会出现在邮件主题中,并且也会出现在邮件顶部附近。这也是克隆现有 alert 可能有用的另一个位置。 +描述将是你想放置“payload”的地方。无法修改这里周围的格式,但你可以完全自定义内容,例如使用一个 [OAuth App Phish](./az-oauth-apps-phishing.md) 链接。 + + +最后,将触发条件设置为某个你可以控制其触发时机的内容。一个例子可能是针对特定资源范围的 `ServiceApiHit`。 + +如果你仍在等待 Entra Role 分配传播,考虑先禁用该规则,直到你准备好,以避免规则被意外触发时重复发出邮件。 + +### Execution + +只需触发你使用的那个 metric 即可。如果你使用的是带有 keyvault 资源且阈值为“greater than zero”的 `ServiceApiHit`,你可以使用 +`az keyvault show --name $VAULT` 来触发 alert。 + +根据你对 Alert Rule 的配置方式,你可能希望在 Alert Rule 仍处于 Alert 状态时禁用 Action Group,以避免在 alert “Resolved” 时发送第二封邮件。 + +
攻击者在真实环境中利用此手法的示例。
+ + + +### OPSEC Considerations +无法通过此攻击隐藏某些可识别信息。 +特别是这包括你的 subscription ID,它可以被反推出你的 tenant ID、tenant domains 等。 +如果你使用自己的 Azure 账户执行此操作,请确保这个账户在 Microsoft 发现时被标记你也能接受。 + +## References +- [https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/action-groups#email-azure-resource-manager](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/action-groups#email-azure-resource-manager) + +{{#include ../../../banners/hacktricks-training.md}}