Skip to main content
Collection of Python scripts for interacting with Windows protocols from Linux. Covers Kerberos, SMB, remote execution, credential dumping, ACL editing, and AD enumeration. All tools follow a consistent auth model.

Auth & Kerberos Setup

Every impacket tool accepts credentials in the same three forms. Set up once, reuse everywhere.
Pass credentials inline: domain/user:password@target
Always use the DC/target hostname with -k, never the IP. If DNS doesn’t resolve, add the host to /etc/hosts and point to $DC_IP.

krb5.conf Template

Linux Kerberos tools read /etc/krb5.conf to know which KDC to contact and how to map realms to domains. Without it, most tools either fail or fall back to DNS discovery (which may not work inside a lab).
Replace DOMAIN.LOCAL with your domain in uppercase, domain.local with the lowercase FQDN, and dc01.domain.local with the DC hostname. Add /etc/hosts entries if DNS does not resolve the DC hostname:
For multiple domains or child domains, add a block per realm:

Remote Execution

Pick based on noise level: psexec creates a service (very loud), wmiexec runs in WMI (quieter), atexec uses the task scheduler (least trace).

Credential Dumping

secretsdump.py

Kerberos Tooling

getTGT.py / getST.py / ticketConverter.py

GetUserSPNs.py (Kerberoasting)

GetNPUsers.py (AS-REP Roasting)

smbclient.py

Interactive SMB client. Works like the native smbclient but is part of impacket — useful when the native tool isn’t available or you need PTH/Kerberos from Linux.
Inside the interactive shell:

ACL Editing (dacledit.py)

Read and write DACLs on AD objects. Required for granting DCSync rights, GenericAll, WriteDacl, etc. from Linux.

Computer Accounts (addcomputer.py)

Create machine accounts — prerequisite for RBCD and other attacks when ms-DS-MachineAccountQuota > 0.

Delegation Enumeration (findDelegation.py)

Find all accounts with unconstrained, constrained, or RBCD delegation configured.

Enumeration

MSSQL (mssqlclient.py)

Interactive MSSQL client. Type SQL directly or use built-in helpers for xp_cmdshell.

Connecting

Situational Awareness

xp_cmdshell

Impersonation

Linked Server Abuse

Built-in helpers (enable_xp_cmdshell, enum_impersonate, etc.) are local only. Everything on a linked server must be sent as a raw SQL string via EXEC ('...') AT [TARGET]. Single quotes inside the string must be escaped as ''.

DPAPI (dpapi.py)

Decrypt Windows DPAPI-protected secrets: browser saved passwords, credential manager, Wi-Fi keys, and anything else encrypted with a masterkey. The masterkey is encrypted with the user’s password (or the domain backup key for domain accounts).

Extracting the Files from the Target

dpapi.py runs on your attacker box, so you first need to pull the encrypted masterkey and the target blob (credential file, vault, Chrome data) off the Windows host. These all live in hidden directories: list them with -Force or they look empty.
Exfil each file by base64-encoding it on the target and decoding on the attacker: no SMB share or file server needed, works over any shell.
Run dpapi.py credential -file dpapi.blob with no key first: it parses the header and prints the masterkey GUID the blob needs, so you know which file to grab from Protect\$SID\.

Masterkeys

Credential Files

Chrome / Browser Saved Passwords

Generic Blob Decryption

Vault Files

Ticket Forging (ticketer.py)

Forge Kerberos tickets offline. Requires hashes extracted via secretsdump.

Golden Ticket

Requires the krbtgt NT hash and domain SID. Valid for any user, any service, any host.

Silver Ticket

Requires the target service account’s NT hash. Valid for a single service on a single host — no contact with the DC needed.

PAC Validation — Why Silver Tickets Sometimes Fail

A service ticket’s PAC carries two signatures: a server signature (the service account’s key) and a KDC signature (the krbtgt key). When you forge a Silver Ticket you hold the service hash, so the server signature is valid, but you cannot produce a valid KDC signature. Whether that matters depends on whether the target service performs PAC validation: calling back to a DC over Netlogon (KERB_VERIFY_PAC) to check the KDC signature.
  • Services running as NT AUTHORITY\SYSTEM or holding SeTcbPrivilege (“Act as part of the OS”) are treated as trusted and skip PAC validation. Most core Windows services land here — this is why Silver Tickets work so often.
  • Services running under a plain domain account without SeTcbPrivilege validate the PAC, and the forged ticket is rejected.
  • S4U2self / protocol transition always triggers KDC-signature checks, so a Silver Ticket cannot be used to pivot through constrained delegation.
Impacket ≥ 0.11 ticketer.py embeds PAC_ATTRIBUTES and a PAC_REQUESTOR buffer so the forged PAC survives the structural checks from the Nov 2021 updates (CVE-2021-42287). It still cannot forge the KDC signature, so any service that actually calls back to a DC stays out of reach.

ExtraSids (Child to Parent Domain)

Ticket Inspection (describeTicket.py)

Inspect ccache and kirbi files to check validity, SIDs, session key, and expiry.

NTLM Relay (ntlmrelayx.py)

Relay incoming NTLM authentication to other services. Requires capturing NTLM auth via Responder, printerbug, PetitPotam, or similar coercion.

Relay to SMB

Relay to LDAP

Relay to MSSQL

Relay to HTTP / ADCS (ESC8)

Password Change (changepasswd.py)

Change or force-reset passwords. Supports SAMR and Kerberos set-password protocols.

AD User Enumeration (GetADUsers.py)

Quick user enumeration via LDAP — returns all users or a specific account with attributes.

SMB File Server (smbserver.py)

Serve a local directory over SMB. Useful for file transfer, hosting payloads, or forcing NTLM authentication from a target that reads from a UNC path.

WMI Queries (wmiquery.py)

Execute arbitrary WMI queries on a remote host.

Child to Parent Escalation (raiseChild.py)

Automates the ExtraSids attack: DCSync from a compromised child domain, forge a Golden Ticket with the Enterprise Admins SID, and get a shell on the parent DC. Requires child domain DC admin.