檢測並移除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
 
參考鏈接:
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM