๐ฆImpacket
Impacket is a collection of Python classes for working with network protocols. This guide covers common security testing techniques using Impacket tools for Active Directory environments.
AS-REP Roasting (GetNPUsers)
AS-REP Roasting is an attack technique that targets user accounts that have "Do not require Kerberos preauthentication" enabled. This allows attackers to request authentication data for any user and receive an encrypted TGT that can be cracked offline.
AS-REP Roasting with User List
# AS-REP Roasting using a user list from 'users.txt'
impacket-GetNPUsers -no-pass -usersfile users.txt domain.htb/ 2>/dev/nullAS-REP Roasting for Specific User
# AS-REP Roasting for a specific user
impacket-GetNPUsers domain.htb/user -no-pass 2>/dev/nullKerberoasting Attack (GetUserSPNs)
Kerberoasting is an attack technique that targets service accounts in Active Directory. It involves requesting service tickets for Service Principal Names (SPNs) and attempting to crack the encrypted portion offline.
Kerberoasting with Valid Credentials
# Kerberoasting Attack with valid credentials and NTLM authentication
impacket-GetUserSPNs -dc-ip 10.10.10.10 domain.htb/user -request 2>/dev/null
impacket-GetUserSPNs -dc-ip 10.10.10.10 domain.htb/user:'password' -request 2>/dev/nullKerberoasting with Kerberos Authentication
Kerberoasting without Domain Credentials
Obtaining Ticket Granting Ticket [TGT] (getTGT)
The Ticket Granting Ticket (TGT) is used in Kerberos authentication to obtain service tickets. These commands show different methods to obtain a TGT.
TGT with Password Authentication
TGT with NTLM Hash
TGT with Kerberos Authentication
Resource Based Constrained Delegation [RBCD] (getST)
Resource Based Constrained Delegation (RBCD) is a delegation mechanism that allows a service to impersonate users to other services. This attack technique can be used for privilege escalation.
RBCD with NTLM Authentication
RBCD with Pass-the-Hash
RBCD with Kerberos Authentication
Important Notes
Replace
domain.htbwith your target domainReplace IP addresses with appropriate target IPs
Ensure you have proper authorization before conducting any security testing
These techniques should only be used in authorized penetration testing scenarios
Always follow responsible disclosure practices
Prerequisites
Impacket toolkit installed
Network access to target domain controller
Appropriate permissions for security testing activities
Last updated