Skip to content

Back to the Category Index / Back to the Command Index

Reads a computer account’s msDS-AllowedToActOnBehalfOfOtherIdentity attribute and adds or removes accounts allowed to delegate to it.

ItemDetails
Implementationexamples/rbcd.py
CategoryActive Directory / LDAP / Account Management
Size331 lines
DistributionInstalled as a script through scripts=examples/*.py in setup.py

Check python examples/rbcd.py -h for the current option definitions.

ArgumentDescription
identitydomain.local/username[:password]
-delegate-toTarget account whose DACL is read or changed (required).
-delegate-fromAccount controlled by the attacker to add to -delegate-to’s RBCD property (with -action write).
-actionOperation on msDS-AllowedToActOnBehalfOfOtherIdentity (choices: read, write, remove, flush; default: read).
-ldaps / -use-ldapsUse LDAPS instead of LDAP.
-tsAdd timestamps to log output.
-debugEnable debug logging.
-hashesNTLM hashes in LMHASH:NTHASH format.
-no-passSkip the password prompt (useful with -k).
-kUse Kerberos authentication. Read credentials from the ccache (KRB5CCNAME) based on the target; fall back to command-line credentials if none are valid.
-aesKey128- or 256-bit AES key for Kerberos authentication.
-dc-ipDomain controller or Kerberos KDC IP address. Defaults to the domain (FQDN) in identity.
-dc-hostDomain controller or Kerberos KDC hostname. Uses -dc-ip if omitted.

Related technology: self-relative security descriptors in LDAP and S4U2proxy / PA_PAC_OPTIONS in Kerberos.

The command resolves delegate-to and delegate-from to SIDs through LDAP and retrieves the target attribute’s security descriptor. read displays permitted SIDs; write adds an allow ACE; remove deletes the matching ACE; flush writes back an empty descriptor.

RBCD permissions are stored on the destination computer object, not on the delegating account, in msDS-AllowedToActOnBehalfOfOtherIdentity. The value is a self-relative security descriptor, not a simple SID array. read parses its DACL and displays allow ACE trustee SIDs as account names.

write obtains the delegate-from SID and creates an allow ACE with the required access mask, appending it to the existing DACL. remove deletes only ACEs for the specified SID; flush clears the entire attribute. The difference is whether other existing delegates are retained.

A binary descriptor passed to LDAP modify must have consistent revision, owner/group, ACL size, and ACE count. Check that parsing and serialization round-trip without losing existing information, including duplicate ACEs, unknown ACEs, and unresolved SIDs.

SymbolLocationEntry Point for Tracing Behavior
RBCD69__init__(), read(), write(), remove(), flush(), get_allowed_to_act(), get_user_info(), get_sid_info()
create_empty_sd()36Module function
create_allow_ace()56Module function
parse_args()258Module function
main()300Module function
ModuleMain Names Used
impacketversion
impacket.exampleslogger, utils
impacket.ldapldaptypes
impacket.examples.utilsinit_ldap_session, parse_identity
Import NameDistribution PackageUsage / Declaration Status
ldap3ldap3Imported directly; declared dependency
ldapdomaindumpldapdomaindumpImported directly; declared dependency

Output, Side Effects, and Required Privileges

Section titled “Output, Side Effects, and Required Privileges”
  • Some operations change the target’s state. Confirm the target name, SID, and path before making changes.
  • On failure, use protocol status to determine whether name resolution, connection, authentication, service state, or permissions stopped the operation.

This command depends on ldap3, ldapdomaindump, and ldaptypes. create_empty_sd() and create_allow_ace() build the binary descriptor. Keep actions that preserve existing ACEs distinct from clearing everything.