Skip to content

Back to the category index / Back to the command index

Examines a privilege escalation path from a child domain to the forest root. It retrieves credentials through DRS and creates a ticket containing SIDHistory.

ItemDetails
Implementationexamples/raiseChild.py
CategoryKerberos / ticket handling
Size1,306 lines
DistributionInstalled as a script through scripts=examples/*.py in setup.py

Run python examples/raiseChild.py -h for the current option definitions.

ArgumentDescription
targetdomain/username[:password]
-tsAdd a timestamp to each log message
-debugEnable debug output
-wWrite the Golden Ticket in ccache format to the specified path
-target-execHost on which to run PSEXEC after the main attack completes
-targetRIDRID of the user whose credentials to dump; defaults to Administrator (500)
-hashesNTLM hashes in LMHASH:NTHASH format
-no-passDo not prompt for a password (useful with -k)
-kUse Kerberos authentication. Look for matching credentials in the ccache file named by KRB5CCNAME; if none are valid, use those specified on the command line
-aesKeyAES key for Kerberos authentication (128 or 256 bits)

The tool discovers the child and parent domains, SIDs, and DCs, then obtains account and krbtgt keys through NRPC, LSA, and DRS. It builds and signs a ticket with the parent enterprise admin RID and other values in the PAC, then obtains a service ticket in the root domain. With -target-exec, it passes control to the PSEXEC path.

The child and root domains in a forest have separate krbtgt keys and domain SIDs. This command examines the trust and replication path from privileges in the child domain to the root. It gathers the required SIDs and key material, then builds a PAC and ticket with additional SIDs, covering the full process.

During discovery, NRPC obtains DC and domain information, and LSA resolves SIDs and names. To obtain credentials, it uses DRSUAPI name cracking and replication requests, then selects RC4 or AES keys from the target account record. Fallbacks such as _get_preferred_aes_key() account for differences in enctypes supported by the KDC and account.

At the ticket stage, it adds privileged SIDs from the root domain to the child identity’s validation information and signs the PAC checksums and encrypted ticket part with the correct keys. The resulting ticket is saved or passed to service execution on a root-domain host. Domain discovery, DRS secret parsing, PAC generation, and PSEXEC cleanup have separate failure boundaries. A single generic exception must not obscure how far execution progressed.

SymbolLocationWhere to trace its responsibility
RemComMessage113Structure or constant definition
RemComResponse123Structure or constant definition
RetryableGoldenTicketError135Structure or constant definition
PSEXEC138__init__(), run(), openPipe()
Pipes266__init__(), connectPipe()
RemoteStdOutPipe298__init__(), run()
RemoteStdErrPipe325__init__(), run()
RemoteShell343__init__(), connect_transferClient(), do_help(), do_shell(), do_get(), do_put(), do_lcd(), emptyline(), default(), send_data()
RemoteStdInPipe451__init__(), run()
RAISECHILD460__init__(), getChildInfo(), getMachineName(), getDNSMachineName(), getParentSidAndTargetName(), DRSCrackNames(), DRSGetNCChanges(), getCredentials(), makeGolden(), raiseUp(), exploit()
ModuleMain names used
impacketversion
impacket.krb5.typesKerberosTime, Principal
impacket.krb5constants
impacket.krb5.kerberosv5KerberosError, getKerberosTGS, getKerberosTGT
impacket.krb5.asn1AD_IF_RELEVANT, AS_REP, AuthorizationData, EncTicketPart
impacket.krb5.crypto_enctype_table, get_kerberos_key_for_enctype, get_matching_aes_key
impacket.dcerpc.v5.ndrNDRULONG
impacket.dcerpc.v5.samrGROUP_MEMBERSHIP, NULL, SE_GROUP_ENABLED, SE_GROUP_ENABLED_BY_DEFAULT, SE_GROUP_MANDATORY
impacket.exampleslogger, remcomsvc, serviceinstall
impacket.examples.utilsparse_identity
impacket.ntlmLMOWFv1, NTOWFv1
impacket.dcerpc.v5.dtypesMAXIMUM_ALLOWED, RPC_SID
impacket.dcerpc.v5.rpcrtRPC_C_AUTHN_GSS_NEGOTIATE, RPC_C_AUTHN_LEVEL_PKT_PRIVACY
impacket.dcerpc.v5.nrpcMSRPC_UUID_NRPC, hDsrGetDcNameEx
impacket.dcerpc.v5.lsatLSAP_LOOKUP_LEVEL, MSRPC_UUID_LSAT, POLICY_LOOKUP_NAMES, hLsarLookupSids
impacket.dcerpc.v5.lsadPOLICY_INFORMATION_CLASS, hLsarOpenPolicy2, hLsarQueryInformationPolicy2
impacket.krb5.pacKERB_SID_AND_ATTRIBUTES, PACTYPE, PAC_CLIENT_INFO_TYPE, PAC_INFO_BUFFER, PAC_LOGON_INFO, PKERB_SID_AND_ATTRIBUTES_ARRAY, VALIDATION_INFO, sign_pac
impacket.dcerpc.v5drsuapi, epm, samr, transport
impacket.smbconnectionSMBConnection, SessionError, smb
impacket.nt_errorsSTATUS_NO_LOGON_SERVERS
impacket.structureStructure
impacket.krb5.ccacheCCache
Import nameDistribution packageImport path and declaration status
pyasn1pyasn1Imported directly; declared
sixsixImported directly; declared

Output, side effects, and required privileges

Section titled “Output, side effects, and required privileges”
  • The tool primarily makes queries and authentication attempts. Frequent runs can affect audit logs, account lockouts, and target load.
  • Options may create or update local files. Check how existing files are handled and the permissions on output containing secrets.
  • Some paths use temporary resources such as remote services, tasks, files, shares, and WMI/RPC resources. Cleaning them up after an abnormal exit is part of the behavior contract.
  • On failure, use protocol status codes to determine whether name resolution, connection, authentication, service state, or permissions caused the stop.
  • Even without an explicit cleanup function, check for finally-equivalent paths and closure or deletion of protocol handles.

The code depends on drsuapi, nrpc, lsad, samr, krb5.*, PAC/NDR, and SMB/serviceinstall. RAISECHILD separates discovery, credentials, and tickets into distinct methods. If you change cryptographic key fallbacks or retries, preserve the basis for selecting RC4 or AES.