Skip to main content
Impacket provides multiple methods for executing commands on remote Windows systems, each using different protocols and execution contexts.

Tool Comparison

psexec.py

PsExec-like functionality using RemComSvc. Executes commands as SYSTEM through a temporary service.

Basic Usage

Advanced Options

Example Output

smbexec.py

Executes commands through a temporary service without uploading a binary. Uses local SMB server in server mode.

Basic Usage

Characteristics

Advantages

  • No binary upload required
  • Works with any writable share
  • Server mode for restricted environments

Disadvantages

  • Generates event logs (service creation)
  • Commands timeout if they run too long
  • Not fully interactive

Example

wmiexec.py

Executes commands through WMI. Runs as the authenticated user (not SYSTEM) with less event log noise.

Basic Usage

Advanced Features

Example Session

dcomexec.py

Executes commands through DCOM objects. Supports multiple DCOM methods.

DCOM Objects

Usage Examples

atexec.py

Executes commands via Task Scheduler. Runs as SYSTEM with less noise than service-based methods.

Basic Usage

Example

Choosing the Right Tool

Most Stealthy to Least:
  1. wmiexec.py - Minimal event logs, runs as user
  2. dcomexec.py - DCOM-based, less common detection
  3. atexec.py - Task Scheduler, moderate logging
  4. smbexec.py - Service creation logs
  5. psexec.py - Service creation + binary upload

Common Issues

Next Steps

Credential Dumping

Extract credentials after gaining access

SMB Operations

Browse shares and access files

LDAP Operations

Enumerate and modify Active Directory