检测并移除WMI持久化后门
阅读原文时间:2023年10月02日阅读:1

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

参考链接:

http://www.ee50.com/xtaq/1815.html

https://www.bus123.net/9114.html

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章