MCPcopy Index your code
hub / github.com/TheManticoreProject/Delegations

github.com/TheManticoreProject/Delegations @v1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.1 ↗ · + Follow
33 symbols 190 edges 25 files 30 documented · 91%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

  Delegations is a tool that allows you to work with all types of Kerberos delegations (unconstrained, constrained, and resource-based constrained delegations) in Active Directory.



  <a href="https://github.com/TheManticoreProject/Delegations/actions/workflows/release.yaml" title="Build"><img alt="Build and Release" src="https://github.com/TheManticoreProject/Delegations/actions/workflows/release.yaml/badge.svg"></a>
  <img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/TheManticoreProject/Delegations">
  <img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/TheManticoreProject/Delegations">
  <a href="https://twitter.com/intent/follow?screen_name=podalirius_" title="Follow"><img src="https://img.shields.io/twitter/follow/podalirius_?label=Podalirius&style=social"></a>
  <a href="https://www.youtube.com/c/Podalirius_?sub_confirmation=1" title="Subscribe"><img alt="YouTube Channel Subscribers" src="https://img.shields.io/youtube/channel/subscribers/UCF_x5O7CSfr82AfNVTKOv_A?style=social"></a>

Features

  • [x] Audit mode:
  • [x] Audit existing unconstrained delegations
  • [x] Audit existing constrained delegations with or without protocol transition
  • [x] Audit existing resource-based constrained delegations
  • [x] Add mode:
  • [x] Add new unconstrained delegations
  • [x] Add new constrained delegations with or without protocol transition
  • [x] Add new resource-based constrained delegations
  • [x] Find mode:
  • [x] Find unconstrained delegations
  • [x] Find constrained delegations with or without protocol transition
  • [x] Find resource-based constrained delegations
  • [x] Clear mode:
  • [x] Clear existing unconstrained delegations
  • [x] Clear existing constrained delegations with or without protocol transition
  • [x] Clear existing resource-based constrained delegations
  • [x] Remove mode:
  • [x] Remove existing unconstrained delegations
  • [x] Remove existing constrained delegations with or without protocol transition
  • [x] Remove existing resource-based constrained delegations
  • [x] Monitor mode:
  • [x] Monitor modifications of all types of delegations in real-time
  • [x] Protocol transition mode:
  • [x] Add protocol transition on a constrained delegation
  • [x] Remove protocol transition on a constrained delegation

Installation

To get this tool you can either download the latest release from the GitHub release page or install it with the following go command:

go install github.com/TheManticoreProject/Delegations@latest

Demonstration

Audit Mode

The audit mode allows you to scan your Active Directory environment for all types of delegations:

./Delegations audit --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p "Admin123!"

Demonstration of Audit Mode

Add Mode

The add mode allows you to add a constrained, unconstrained, or resource-based constrained delegation on an object:

./Delegations add constrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!' --allowed-to-delegate-to "HOST/PC02.MANTICORE.local"

Demonstration of Add Mode

./Delegations add constrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!' --allowed-to-delegate-to "HOST/PC02.MANTICORE.local" --with-protocol-transition

Demonstration of Add Mode

./Delegations add unconstrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Add Mode

./Delegations add rbcd --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Add Mode

Clear Mode

The clear mode allows you to clear a constrained, unconstrained, or resource-based constrained delegation on an object:

./Delegations clear constrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Clear Mode

./Delegations clear constrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!' --with-protocol-transition

Demonstration of Clear Mode

./Delegations clear unconstrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Clear Mode

./Delegations clear rbcd --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Clear Mode

Find Mode

The find mode allows you to find a constrained, unconstrained, or resource-based constrained delegation on an object:

./Delegations find constrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Find Mode

./Delegations find constrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!' --with-protocol-transition

Demonstration of Find Mode

./Delegations find unconstrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Find Mode

./Delegations find rbcd --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Find Mode

Remove Mode

The remove mode allows you to remove a constrained, unconstrained, or resource-based constrained delegation from an object:

./Delegations remove constrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!' --allowed-to-delegate-to "HOST/PC02.MANTICORE.local"

Demonstration of Remove Mode

./Delegations remove constrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!' --allowed-to-delegate-to "HOST/PC02.MANTICORE.local" --with-protocol-transition

Demonstration of Remove Mode

./Delegations remove unconstrained --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Remove Mode

./Delegations remove rbcd --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Remove Mode

Protocol Transition Mode

The protocol transition mode allows you to add or remove protocol transition for a constrained delegation on an object:

./Delegations add protocoltransition --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Protocol Transition Mode

./Delegations remove protocoltransition --distinguished-name "CN=PC01,CN=Computers,DC=MANTICORE,DC=local" --dc-ip "192.168.56.101" -d "MANTICORE.local" -u "Administrator" -p 'Admin123!'

Demonstration of Protocol Transition Mode

Usage

The first positional argument of the program is the mode:

./Delegations 
Delegations - by Remi GASCOU (Podalirius) @ TheManticoreProject - v1.0.0

Usage: Delegations <add|audit|clear|find|monitor|remove>

   add      Add a constrained, unconstrained, or resource-based constrained delegation to a user or group.
   audit    Audit constrained, unconstrained, and resource-based constrained delegations in Active Directory.
   clear    Clear a constrained, unconstrained, or resource-based constrained delegation from a user or group.
   find     Find a constrained, unconstrained, or resource-based constrained delegation from a user or group.
   monitor  Monitor constrained, unconstrained, and resource-based constrained delegations in Active Directory.
   remove   Remove a constrained, unconstrained, or resource-based constrained delegation from a user or group.

Then for modes add, remove and find, the second positional argument is the delegation type:

./Delegations add 
Delegations - by Remi GASCOU (Podalirius) @ TheManticoreProject - v1.0.0

Usage: Delegations add <constrained|rbcd|unconstrained>

   constrained    Add a constrained delegation to a user or group.
   unconstrained  Add a unconstrained delegation to a user or group.
   rbcd           Add a ressource-based delegation to a user or group.

For mode audit all delegation types are audited at once, no more positional arguments are needed, only options:

./Delegations audit
Delegations - by Remi GASCOU (Podalirius) @ TheManticoreProject - v1.0.0

Usage: Delegations audit --domain <string> --username <string> [--password <string>] [--hashes <string>] [--debug] --dc-ip <string> [--ldap-port <tcp port>] [--use-ldaps] [--use-kerberos]


  Authentication:
    -d, --domain <string>   Active Directory domain to authenticate to.
    -u, --username <string> User to authenticate as.
    -p, --password <string> Password to authenticate with. (default: "")
    -H, --hashes <string>   NT/LM hashes, format is LMhash:NThash. (default: "")

  Configuration:
    -d, --debug     Debug mode. (default: false)

  LDAP Connection Settings:
    -dc, --dc-ip <string>       IP Address of the domain controller or KDC (Key Distribution Center) for Kerberos. If omitted, it will use the domain part (FQDN) specified in the identity parameter.
    -lp, --ldap-port <tcp port> Port number to connect to LDAP server. (default: 389)
    -L, --use-ldaps             Use LDAPS instead of LDAP. (default: false)
    -k, --use-kerberos          Use Kerberos instead of NTLM. (default: false)

Contributing

Pull requests are welcome. Feel free to open an issue if you want to add other features.

Credits

Core symbols most depended-on inside this repo

RemoveProtocolTransition
called by 5
core/mode_remove/RemoveProtocolTransition.go
LookupSID
called by 4
core/utils/utils.go
SIDFromValue
called by 2
core/utils/utils.go
UpdateNTSecurityDescriptorDACL
called by 2
core/utils/utils.go
SPNExists
called by 2
core/utils/utils.go
AddProtocolTransition
called by 2
core/mode_add/AddProtocolTransition.go
parseArgs
called by 1
main.go
DNExists
called by 1
core/utils/utils.go

Shape

Function 32
Struct 1

Languages

Go100%

Modules by API surface

core/utils/utils.go7 symbols
main.go2 symbols
core/mode_monitor/monitor.go2 symbols
core/mode_remove/UnconstrainedDelegations.go1 symbols
core/mode_remove/RessourceBasedConstrainedDelegations.go1 symbols
core/mode_remove/RemoveProtocolTransition.go1 symbols
core/mode_remove/ConstrainedDelegationsWithProtocolTransition.go1 symbols
core/mode_remove/ConstrainedDelegations.go1 symbols
core/mode_find/UnconstrainedDelegations.go1 symbols
core/mode_find/RessourceBasedConstrainedDelegations.go1 symbols
core/mode_find/ConstrainedDelegationsWithProtocolTransition.go1 symbols
core/mode_find/ConstrainedDelegations.go1 symbols

For agents

$ claude mcp add Delegations \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact