效果:定时触发反弹
现如今,WMI攻击在很多APT行为中也经常被利用:
Mof实现
执行命令:
Mofcomp xx.mof
效果:每30分钟触发反弹。
也可以直接执行vbs脚本文件:
instance ofActiveScriptEventConsumer as $Cons
{
Name = "ASEC";
ScriptingEngine = "VBScript";
ScriptFileName = "c:\\asec.vbs";
};
安全防御
查看:
#List EventFilters
Get-WMIObject-Namespace root\Subscription -Class __EventFilter
#List EventConsumers
Get-WMIObject-Namespace root\Subscription -Class __EventConsumer
#List EventBindings
Get-WMIObject-Namespace root\Subscription -Class __FilterToConsumerBinding
删除:
#Filter
Get-WMIObject-Namespace root\Subscription -Class __EventFilter -Filter"Name='BotFilter82'" | Remove-WmiObject -Verbose
#Consumer
Get-WMIObject-Namespace root\Subscription -Class CommandLineEventConsumer -Filter"Name='BotConsumer23'" | Remove-WmiObject -Verbose
#Binding
Get-WMIObject-Namespace root\Subscription -Class __FilterToConsumerBinding -Filter"__Path LIKE '%BotFilter82%'" | Remove-WmiObject -Verbose