Skip to main content
Impacket provides extensive SMB (Server Message Block) functionality for file access, registry operations, and Windows service management.

File & Share Access

smbclient.py

Interactive SMB client for browsing shares and transferring files.

Shell Commands

Example Session

smbserver.py

Create a local SMB server for file transfers and attacks.

smbserver.py Use Cases

Registry Operations

reg.py

Remote registry access and manipulation.

registry-read.py

Read registry keys and values remotely.

regsecrets.py

Extract secrets from saved registry hives (offline).

Service Management

services.py

Manage Windows services remotely.

Example Service Manipulation

Specialized SMB Tools

smbmap

While not part of Impacket, it’s worth mentioning for enumeration:

attrib.py

Manage file attributes via SMB.

ntfs-read.py

Direct NTFS filesystem access (requires raw disk access).

Attack Scenarios

Network Utilities

sniffer.py / sniff.py

Capture network traffic (requires raw socket access).

ping.py / ping6.py

ICMP ping implementations.

getArch.py

Detect target system architecture.

machine_role.py

Determine machine role (workstation, server, DC).

Common Issues & Solutions

Best Practices

Stealth

  • Avoid multiple failed auth attempts
  • Use legitimate-looking service names
  • Clean up uploaded files after use
  • Restore original registry values

Reliability

  • Verify file transfers completed
  • Test commands before automation
  • Handle errors gracefully
  • Keep logs for troubleshooting

Security

  • Use Kerberos when possible
  • Encrypt sensitive file transfers
  • Securely delete extracted data
  • Don’t leave backdoors accessible

Documentation

  • Record all modifications made
  • Document created services/files
  • Note original configurations
  • Maintain cleanup checklist

Next Steps

Remote Execution

Execute commands after accessing shares

Credential Dumping

Extract credentials via registry access

LDAP Operations

Enumerate Active Directory objects