检测并移除WMI持久化后门

 
  WMI型后门只能由具有管理员权限的用户运行。WMI后门通常使用powershell编写的,可以直接从新的WMI属性中读取和执行后门代码,给代码加密。通过这种方式攻击者会在系统中安装一个持久性的后门,且不会在磁盘中留下任何文件。
  WMI型后门主要有两个特征:无文件和无进程。其基本原理是:将代码加密存储在WMI中,达到所谓的无文件;当设定的条件满足时,系统将自动启动powershell进程去执行后门程序,当后门程序执行后进程就会消失。
 
检查WMI后门,CommandLineTemplate的内容就是程序要执行的命令。
Get-WMIObject -Namespace root\Subscription -Class CommandLineEventConsumer -Filter "Name='Updater'"
 
清除WMI后门的常用方法有:
1.删除自动运行列表中的恶意WMI条目。
2.在powershell中使用Get-WMIObject命令删除与WMI持久化相关的组件。
 
WMI后门检测
# Reviewing WMI Subscriptions using Get-WMIObject
# Event Filter
Get-WMIObject -Namespace root\Subscription -Class __EventFilter -Filter "Name='Updater'"
# Event Consumer
Get-WMIObject -Namespace root\Subscription -Class CommandLineEventConsumer -Filter "Name='Updater'"
# Binding
Get-WMIObject -Namespace root\Subscription -Class __FilterToConsumerBinding -Filter "__Path LIKE '%Updater%'"
 
使用Remove-WMIObject命令来删除WMI持久性后门的所有组件。
# Removing WMI Subscriptions using Remove-WMIObject
# Event Filter
Get-WMIObject -Namespace root\Subscription -Class __EventFilter -Filter "Name='Updater'" | Remove-WmiObject -Verbose
# Event Consumer
Get-WMIObject -Namespace root\Subscription -Class CommandLineEventConsumer -Filter "Name='Updater'" | Remove-WmiObject -Verbose
# Binding
Get-WMIObject -Namespace root\Subscription -Class __FilterToConsumerBinding -Filter "__Path LIKE '%Updater%'" | Remove-WmiObject -Verbose
 
参考链接:
 
posted @ 2020-02-17 19:48  micr067  阅读(890)  评论(0编辑  收藏  举报