关于 performing-active-directory-compromise-investigation
面向事件响应人员的 Active Directory 入侵调查技能,指导分析凭据、Kerberos、组策略和权限变更,以追踪攻击路径并评估影响范围。
主要功能
- 01分析 NTDS.dit 与复制活动
- 02排查 Kerberos 票据异常
- 03检查组策略持久化修改
- 04追踪特权组成员变更
- 05审查信任关系与横向移动
- 06规划凭据重置和环境修复
适用场景
- 01调查疑似域控制器或域服务失陷
- 02分析 Kerberoasting 与伪造票据迹象
- 03评估凭据失窃及持久化范围
- 04制定 Active Directory 修复方案
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill performing-active-directory-compromise-investigation安装后在 Claude Code 中输入/performing-active-directory-compromise-investigation确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
LICENSEassets/template.mdreferences/api-reference.mdstandards.mdworkflows.mdscripts/agent.pyprocess.py详细介绍
执行 Active Directory 入侵调查
概述
Active Directory(AD)入侵调查是一项关键的 Incident Response 能力,重点在于识别攻击者如何获取域服务的访问权限、建立了哪些持久化机制,以及凭证泄露的范围。由于 88% 的泄露事件涉及凭证泄露(Verizon 2025 DBIR),AD 是企业级攻击的主要目标。调查人员必须分析 NTDS.dit 数据库完整性、Kerberos 票据授予活动、Group Policy 修改、复制元数据以及特权组成员身份变更,以重建攻击链并确定完整的入侵范围。
何时使用
- 当进行涉及执行 Active Directory 入侵调查的安全评估时
- 当遵循相关安全事件的事件响应流程时
- 当执行计划的安全测试或审计活动时
- 当通过实操测试验证安全控制措施时
前提条件
- 熟悉事件响应概念和工具
- 可访问测试或实验环境以安全执行
- Python 3.8+ 并安装所需依赖
- 对任何测试活动拥有适当授权
关键调查领域
1. NTDS.dit 数据库分析
NTDS.dit 文件是核心 Active Directory 凭证数据库,包含域账户的所有密码哈希。攻击者通常使用 ntdsutil、secretsdump.py 等工具或通过 Mimikatz 进行 DCSync 攻击来窃取此文件。
检测指标:
- 事件 ID 4662:以复制权限访问目录服务对象
- 事件 ID 4742:域控制器上的计算机账户修改
- 域控制器上的卷影副本创建(事件 ID 8222)
- 异常的 ntdsutil.exe 或 vssadmin.exe 执行
- 来自非 DC 来源的复制流量(DCSync 检测)
2. Kerberos 攻击检测
Golden Ticket 指标:
- TGT 票据生命周期异常长(默认 10 小时)
- 事件 ID 4769 使用加密类型 0x17(RC4)而非 AES
- 签发 TGT 但没有对应的事件 ID 4768(AS-REQ)
- Kerberos 票据引用不存在或已禁用的账户
Silver Ticket 指标:
- 服务票据没有对应的 TGT 请求
- 事件 ID 4769 带有异常服务名称
- 带有伪造 PAC 数据的票据
Kerberoasting 指标:
- 针对服务账户的事件 ID 4769 高频出现
- 对支持 AES 的账户请求 RC4 加密
- 来自通常不访问这些服务的工作站的请求
3. Group Policy 滥用
- 授予新权限的 GPO 修改(事件 ID 5136)
- 通过 GPO 部署计划任务
- 向域中添加软件安装策略
- 登录脚本修改
- 基于注册表的策略更改以实现持久化
4. 特权组枚举
跟踪以下关键组的修改:
- Domain Admins、Enterprise Admins、Schema Admins
- Account Operators、Backup Operators
- DnsAdmins(可在 DC 上执行任意 DLL)
- Group Policy Creator Owners
- Protected Users 组成员身份变更
5. 信任关系分析
- 新建的林/域信任(事件 ID 4706)
- 用于权限提升的 SID History 注入
- 信任票据伪造指标
- 跨域身份验证异常
调查方法
阶段 1:范围界定与证据收集
1. Identify potentially compromised domain controllers
2. Collect Security, System, Directory Service event logs
3. Extract AD replication metadata using repadmin
4. Capture ntdsutil snapshots for offline analysis
5. Collect DNS server logs and zone transfer records
6. Export Group Policy Object configurations
7. Document current privileged group memberships
阶段 2:身份验证日志分析
1. Parse Event ID 4624/4625 for logon patterns
2. Identify pass-the-hash indicators (Event ID 4624 Type 3 with NTLM)
3. Analyze Event ID 4768/4769/4771 for Kerberos anomalies
4. Review Event ID 4776 for NTLM authentication failures
5. Cross-reference logon events with known compromised accounts
6. Map lateral movement paths through authentication chains
阶段 3:持久化与后门检测
1. Enumerate AdminSDHolder ACL modifications
2. Check for SID History abuse on accounts
3. Verify krbtgt account password age
4. Audit DSRM password configuration
5. Check for skeleton key malware indicators
6. Review AD Certificate Services for rogue certificates
7. Validate DNS records for poisoning
阶段 4:修复计划
1. Double-rotate krbtgt password (wait replication between rotations)
2. Reset all compromised account passwords
3. Remove unauthorized privileged group members
4. Revoke rogue certificates if AD CS compromised
5. Rebuild domain controllers from clean media if needed
6. Implement tiered administration model
7. Enable Protected Users group for privileged accounts
AD 调查的关键事件 ID
| 事件 ID | 来源 | 描述 |
|---|---|---|
| 4624 | Security | 登录成功 |
| 4625 | Security | 登录失败 |
| 4648 | Security | 使用显式凭据登录 |
| 4662 | Security | 对 AD 对象的操作 |
| 4768 | Security | 请求了 Kerberos TGT |
| 4769 | Security | 请求了 Kerberos 服务票据 |
| 4771 | Security | Kerberos 预身份验证失败 |
| 4776 | Security | NTLM 凭据验证 |
| 5136 | Security | 目录对象已修改 |
| 5137 | Security | 目录对象已创建 |
| 4706 | Security | 信任已创建 |
| 4707 | Security | 信任已移除 |
| 4742 | Security | 计算机账户已更改 |
| 8222 | System | 已创建卷影副本 |
用于 AD 调查的工具
| 工具 | 用途 |
|---|---|
| BloodHound | 攻击路径映射与权限提升分析 |
| Pingcastle | AD 安全评估与风险评分 |
| Purple Knight | 由 Semperis 提供的 AD 漏洞扫描 |
| ADRecon | Active Directory 数据收集 |
| Mimikatz | 凭据提取与 Kerberos 分析 |
| Impacket | DCSync 检测与 NTLM 中继分析 |
| Velociraptor | 远程取证工件收集 |
| Timeline Explorer | 事件日志时间线分析 |
MITRE ATT&CK 映射
| 技术 | ID | 相关性 |
|---|---|---|
| DCSync | T1003.006 | NTDS.dit 凭据提取 |
| Golden Ticket | T1558.001 | Kerberos TGT 伪造 |
| Silver Ticket | T1558.002 | 服务票据伪造 |
| Kerberoasting | T1558.003 | 服务账户哈希提取 |
| Pass-the-Hash | T1550.002 | NTLM 哈希重用 |
| Group Policy Modification | T1484.001 | 通过 GPO 实现持久化 |
| Account Manipulation | T1098 | 特权组更改 |
| SID-History Injection | T1134.005 | 权限提升 |
参考资料
评论
支持 Markdown