detecting-email-account-compromise
它能做什么
这个工具可以帮你发现邮箱账户是否被入侵。它会查找可疑活动,比如奇怪的转发规则、从异常地点发起的登录,或未经授权的应用使用情况。
适用场景
- ✓怀疑有人入侵了你的邮箱账户时。
- ✓检查是否有邮件规则在未经你允许的情况下把邮件转发到别处。
- ✓调查可能的身份盗用或诈骗攻击时。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-email-account-compromise/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我检查一下我的邮箱账户有没有被入侵。”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会分析你的邮箱账户活动日志和登录记录,查找黑客可能已获得访问权限的迹象,比如有邮件规则在向外转发邮件,或者登录地点相距非常遥远。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Detecting Email Account Compromise
Overview
Email account compromise (EAC) is a prevalent attack vector where adversaries gain unauthorized access to mailboxes to exfiltrate sensitive data, conduct business email compromise (BEC), or establish persistence through inbox rule manipulation. Attackers commonly create forwarding rules to siphon emails, delete rules to hide evidence, or use OAuth tokens for persistent access. Detection relies on analyzing Microsoft 365 Unified Audit Logs, Azure AD sign-in logs for impossible travel or suspicious locations, inbox rule creation events (Set-InboxRule, New-InboxRule), and Microsoft Graph API access patterns. Key indicators include forwarding rules to external addresses, rules that delete or move messages matching keywords like "invoice" or "payment", and sign-ins from unusual user agents such as python-requests.
When to Use
- When investigating security incidents that require detecting email account compromise
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
Prerequisites
- Microsoft 365 with Unified Audit Logging enabled
- Azure AD P1/P2 for risk detection APIs
- Python 3.9+ with
requests,msallibraries - Microsoft Graph API application registration with Mail.Read, AuditLog.Read.All permissions
- Understanding of OAuth2 client credential flows
Steps
- Export audit logs or connect to Microsoft Graph API using MSAL authentication
- Query inbox rules for all monitored mailboxes via
/users/{id}/mailFolders/inbox/messageRules - Analyze rules for external forwarding (ForwardTo, RedirectTo external addresses)
- Detect suspicious rule patterns: deletion rules, keyword-matching rules targeting financial terms
- Query sign-in logs via
/auditLogs/signInsfor unusual locations and impossible travel - Check for suspicious user agent strings (python-requests, PowerShell, curl)
- Identify OAuth application consent grants for suspicious third-party apps
- Correlate findings across users to detect campaign-level compromise
- Generate compromise indicators report with severity scores
Expected Output
A JSON report listing compromised or suspicious accounts, malicious inbox rules detected, impossible travel events, suspicious OAuth grants, and recommended containment actions with severity ratings.
常见问题
什么是“转发规则”?
这是你可以在邮箱中设置的功能,用来自动把特定邮件转发到另一个地址。黑客可能会创建这类规则来窃取你的信息。
什么是“不可能的旅行”(impossible travel)?
指日志显示你在很短时间内从相距很远的地点登录,这说明可能有其他人在使用你的账户。
使用这个工具需要技术知识吗?
不需要,这个工具就是为所有人设计的,它能简化邮箱账户安全问题的检测过程。
详情
作者的原始描述
Detect compromised O365 and Google Workspace email accounts by analyzing Unified Audit Logs and Azure AD sign-in logs for impossible travel, inbox rule creation/deletion (Set-InboxRule, New-InboxRule), external mail forwarding rules, and unusual Microsoft Graph API access or OAuth token use. Use when investigating suspected business email compromise (BEC), account takeover, or mailbox persistence
热度
- GitHub 星标
- 35k
- 排名
- #7825
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。