Suspicious Hyper-V Cmdlet Execution
Adversaries may use Hyper-V PowerShell cmdlets to create and manipulate virtual machines to conceal malicious activity or establish persistence.
Adversaries may abuse native Hyper-V management cmdlets to perform environment-based evasion. By creating, configuring, and starting virtual machines (VMs) via PowerShell, an attacker can isolate malicious activity within a virtualized instance, effectively hiding secondary stages or command-and-control communication from host-based security tools that may not have visibility into the guest OS or the virtualized environment. This technique is often used to establish stealthy persistence or to provide a sandbox environment for executing secondary payloads while avoiding direct interaction with the primary host filesystem or network stack. Monitoring for the misuse of these cmdlets in administrative or user-context scripts is essential for identifying potential efforts to weaponize the virtualization layer.
Impact
Successful execution of these commands allows attackers to create stealthy infrastructure within an already compromised host. This can lead to persistent backdoors, secondary command-and-control channels, or the staging of further malicious operations, potentially complicating incident response and forensics as the malicious environment resides within a virtual disk file.
Recommendation
- Enable PowerShell Script Block Logging (Event ID 4104) to capture the execution of specific Hyper-V management cmdlets.
- Deploy the provided Sigma rule to monitor for the creation or modification of virtual machines by unexpected processes.
- Establish a baseline of authorized administrative scripts that utilize Hyper-V cmdlets and tune alerting to exclude these signed or approved scripts.
Threat Hunt
Search for script block logs containing Hyper-V cmdlets in non-standard execution paths
Data: Powershell Script Block Logging (Event ID 4104)
Detection coverage 1
Detect Suspicious Hyper-V Cmdlet Execution
mediumDetects the use of PowerShell cmdlets related to VM creation and configuration which may indicate an attempt to conceal activity within a virtual machine.
Detection queries are available on the platform. Get full rules →