Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
MSDT_CVE-2022-30190 — 这个仓库从Defender视角讨论Follina MSDT。 | Kitploit
工具/GitHubGitHub/archanchoudhury/msdt_cve-2022-30190
危害指标 (IOC) 管理漏洞分析恶意软件分析威胁情报学习与教育事件响应
GitHubarchanchoudhury/msdt_cve-2022-30190

MSDT_CVE-2022-30190

这个仓库从Defender视角讨论Follina MSDT。

查看仓库
3710254年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

MSDT_CVE-2022-30190

本仓库从 Defender 视角讨论 Follina MSDT 漏洞

目录

  • 关于
  • 时间线
  • 理解漏洞利用
  • IOC 列表
  • 检测策略
  • 测试与研究
  • 缓解方案
  • 参考

关于

该漏洞是 Microsoft Windows 支持诊断工具 (MSDT) 的远程代码执行漏洞,由 Shadow Chaser Group 的 crazyman 报告。Microsoft 现已将其跟踪为 CVE-2022-30190。该漏洞影响所有仍在接收安全更新的 Windows 版本(Windows 7+ 及 Server 2008+)。

正如安全研究员 nao_sec 发现的,威胁行为者利用该漏洞通过 MSDT 执行恶意 PowerShell 命令,Microsoft 将其描述为打开或预览 Word 文档时的任意代码执行 (ACE) 攻击。

"成功利用此漏洞的攻击者可以以调用应用程序的权限运行任意代码," Microsoft 解释道。

时间线

  • 2022年4月12日 — APT 狩猎组织 Shadowchasing1 的负责人首次向 Microsoft MSRC 报告。该文档是一个针对俄罗斯的野外真实世界漏洞利用,以俄罗斯求职面试为主题。
  • 2022年4月21日 — Microsoft MSRC 关闭了工单,称这不是安全问题(值得注意的是,在宏禁用的情况下 msdt 仍能执行确实是个问题)
  • 2022年5月??日 — Microsoft 可能曾在 Office 365 Insider 频道中尝试修复或意外修复了该问题,但没有记录 CVE 或任何地方的书面说明。其他产品仍然存在漏洞。
  • 2022年5月27日 — 安全厂商 Nao 在 Twitter 上发布了一份来自白俄罗斯的上传文档,这也是一次野外攻击。
  • 2022年5月27日 — 再次向 MSRC 报告。
  • 2022年5月29日 — Andy Ful 公开确认这是一次零日攻击,因为它仍然适用于 Office 365 Semi Annual 频道以及 'on prem' Office 版本,并且 EDR 产品未能检测到。

理解漏洞利用

  • 您可以参考 Huntress 的博客 此处 来全面了解该漏洞利用的工作原理。
  • 观看此 视频 以理解漏洞利用及其修复方法。

IOC 列表

  • 主要对象 - 05-2022-0438.doc
    • sha256 4a24048f81afbe9fb62e7a6a49adbd1faf41f266b5f9feecdceb567aec096784
    • sha1 06727ffda60359236a8029e0b3e8a0fd11c23313
    • md5 52945af1def85b171870b31fa4782e52
  • 释放的可执行文件
    • sha256 C:\Users\admin\AppData\Local\Temp\SDIAG_ecb8c0a2-7a1e-4b6c-8ae0-2245f03bcc15\DiagPackage.dll 3218488d62cb0858101d2ec63ec73a032bc9787f5f87cb46abbea4477c97b16f
    • sha256 C:\Users\admin\AppData\Local\Temp\SDIAG_ecb8c0a2-7a1e-4b6c-8ae0-2245f03bcc15\en-US\DiagPackage.dll.mui c6d837ec0850e22c83b400fcded1791a2f4f99f0c56d6fc7d93e92a8b72c098d
    • sha256 C:\Users\admin\AppData\Local\Temp\r5qxr4ie.dll aa967ae9f6d80bdbd0f315defa17aaee0e756e7e2ad0e5261d8254bc0af1cc02
    • sha256 C:\Users\admin\AppData\Local\Temp\t52wyhbe.dll daf716cbe8810085251e6ef1e39869a9e61d929fac12ea5684c3b2caf993666b
    • sha256 C:\Users\admin\AppData\Local\Temp\qtwoghs1.dll f5361b6c9db8ac25433ae21f9a7b6490cc372ce2b1f802e2b06d5b904ce97109
  • DNS 请求
    • 域名 www[.]xmlformats[.]com
  • 连接
    • ip 141.105.65.149
    • ip 20.42.65.85
    • ip 13.107.42.16
  • HTTP/HTTPS 请求
    • url hxxps://www[.]xmlformats[.]com/office/word/2022/wordprocessingDrawing/
    • url hxxps://www[.]xmlformats[.]com/office/word/2022/
    • url hxxps://www[.]xmlformats[.]com/office/word/2022/wordprocessingDrawing/RDF842l[.]html

检测策略

  • 要进行威胁狩猎,您可以在此处找到 Sigma 规则 此处

  • 以下是可进一步调整的检测规则。感谢 Bala Ganesh。完整文章见 此处

  • MS Defender:

root@kitploit:~
DeviceProcessEvents | where ((ProcessCommandLine contains "WINWORD.EXE") and (ProcessCommandLine contains "msdt.exe") and (ProcessCommandLine contains "sdiagnhost.exe" or ProcessCommandLine contains "csc.exe" or ProcessCommandLine contains "PCWDiagnostic" or ProcessCommandLine contains "IT_ReBrowserForFile" or ProcessCommandLine contains "IT_BrowserForFile" or ProcessCommandLine contains "conhost.exe"))
  • Splunk:
root@kitploit:~
[Doc Malware]
alert.severity = 2
description = Detection (Rule ID: 74566a6a66aaasdq2ed)
cron_schedule = 0 * * * *
disabled = 1
is_scheduled = 1
is_visible = 1
dispatch.earliest_time = -60m@m
dispatch.latest_time = now
search = (source="WinEventLog:*" AND (CommandLine="*WINWORD.EXE*") AND (CommandLine="*msdt.exe*") AND (CommandLine="*sdiagnhost.exe*" OR CommandLine="*csc.exe*" OR CommandLine="*PCWDiagnostic*" OR CommandLine="*IT_ReBrowserForFile*" OR CommandLine="*IT_BrowserForFile*" OR CommandLine="*conhost.exe*"))
alert.suppress = 0
alert.track = 1
  • Qradar:
root@kitploit:~
SELECT UTF8(payload) from events where LOGSOURCETYPENAME(devicetype)='Microsoft Windows Security Event Log' and ("Process CommandLine" ilike '%WINWORD.EXE%') and ("Process CommandLine" ilike '%msdt.exe%') and ("Process CommandLine" ilike '%sdiagnhost.exe%' or "Process CommandLine" ilike '%csc.exe%' or "Process CommandLine" ilike '%PCWDiagnostic%' or "Process CommandLine" ilike '%IT_ReBrowserForFile%' or "Process CommandLine" ilike '%IT_BrowserForFile%' or "Process CommandLine" ilike '%conhost.exe%')
  • GrayLog
root@kitploit:~
(CommandLine.keyword:*WINWORD.EXE* AND CommandLine.keyword:*msdt.exe* AND CommandLine.keyword:(*sdiagnhost.exe* *csc.exe* *PCWDiagnostic* *IT_ReBrowserForFile* *IT_BrowserForFile* *conhost.exe*))
Sumologic
(_sourceCategory=*windows* AND (CommandLine = "*WINWORD.EXE*") AND (CommandLine = "*msdt.exe*") AND (CommandLine = "*sdiagnhost.exe*" OR CommandLine = "*csc.exe*" OR CommandLine = "*PCWDiagnostic*" OR CommandLine = "*IT_ReBrowserForFile*" OR CommandLine = "*IT_BrowserForFile*" OR CommandLine = "*conhost.exe*"))
  • Elastic KQL:
root@kitploit:~
(process.command_line:*WINWORD.EXE* AND process.command_line:*msdt.exe* AND process.command_line:(*sdiagnhost.exe* OR *csc.exe* OR *PCWDiagnostic* OR *IT_ReBrowserForFile* OR *IT_BrowserForFile* OR *conhost.exe*))

以下查询由 Brent Murphy 描述,见 此处,也可使用:

root@kitploit:~
process where event.type in ("start" , "process_created") and (process.pe.original_file_name : "msdt.exe" or process.name : "msdt.exe") and (process.parent.pe.original_file_name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe") or process.parent.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe"))
  • 您可以使用 Cortex XDR 中的 XQL 搜索来狩猎此攻击:了解更多 此处
root@kitploit:~
# office processes spawning msdt.exe

config case_sensitive = false timeframe = 30d
| dataset = xdr_data
| filter event_type = ENUM.PROCESS and action_process_image_command_line contains "msdt.exe" and actor_process_image_name in ("winword.exe", "powerpnt.exe", "excel.exe", "msaccess.exe","visio.exe","onenote.exe","powershell.exe")
| fields agent_hostname , action_process_image_command_line , action_process_image_path , actor_process_command_line , actor_process_image_path , causality_actor_process_image_path

# msdt.exe execution with suspicious argument

config case_sensitive = false timeframe = 30d
| dataset = xdr_data
| filter event_type = ENUM.PROCESS and action_process_image_command_line contains "msdt.exe" and
action_process_image_command_line contains "it_browseforfile"
| fields agent_hostname , action_process_image_command_line , action_process_image_path , actor_process_command_line , actor_process_image_path , causality_actor_process_image_path
  • 除了狩猎行为外,在大规模查询注册表项 HKEY_USERS*SID\SOFTWARE\Microsoft\Office\16.0\Common\Internet\Server Cache* 并分析结果也很有用!参考完整帖子 此处
  • Velociraptor 创建了检测逻辑 此处 来识别返回 Office Internet Server Cache 注册表键和值,以识别恶意打开的 Office 文档中可能的 C2 URL。
  • Joe Security 开发的 YARA 规则可在此找到 此处
  • Crowdstrike 查询可按如下方式进行:
root@kitploit:~
index=main (ProcessRollup2 OR SyntheticProcessRollup2 OR ProcessBlocked*) ParentBaseFileName IN ("OUTLOOK.EXE","WINWORD.EXE","EXCEL.EXE") CommandLine="*msdt.exe*"
| table ComputerName ParentBaseFileName CommandLine FileName
  • 执行时会在 %localappdata%\Diagnostics 和 %localappdata%\ElevatedDiagnostics(对于提升的实例)中生成 "PCW.debugreport.xml" 文件,其中包含 payload。查看 此处
  • 当前的概念验证迭代将从 Microsoft Office 应用程序调用 msdt.exe。在 Crowdstrike Falcon 中的通用狩猎查询可在此找到:
root@kitploit:~
index=main sourcetype=ProcessRollup* event_simpleName=ProcessRollup2
| search ParentBaseFileName IN (winword.exe, excel.exe, powerpnt.exe, outlook.exe) 
| search FileName=msdt.exe
| table _time, aid, ComputerName, UserName, UserSid_readable, ParentBaseFileName, FileName, CommandLine
| lookup local=true aid_master aid OUTPUT AgentVersion, Version, MachineDomain, OU, SiteName
  • 要进一步分析并在环境中建立正常的 msdt.exe 使用基线,可以在 Crowdstrike Falcon 中使用以下查询:
root@kitploit:~
index=main sourcetype=ProcessRollup* event_simpleName=ProcessRollup2
| search FileName=msdt.exe
| eval FileName=lower(FileName)
| eval ParentBaseFileName=lower(ParentBaseFileName)
| stats dc(aid) as endpointCount, count(aid) as executionCount by FileName, ParentBaseFileName
| sort -executionCount
  • Elastic Security 团队更新了 SIEM 中的现有规则,并为 msdt.exe 作为 lolbin 添加了新规则。查看检测 规则1 和 规则2
  • 如果您使用 MS Sentinel,可以使用以下查询:
root@kitploit:~
#Detects the exploitation of Follina Microsoft Code Execution vulnerability

SecurityEvent 
| where EventID==4688 
| where ParentProcessName has_any ('winword.exe','excel.exe','outlook.exe') 
| where NewProcessName contains "msdt.exe" or CommandLine contains "msdt.exe"
| project TimeGenerated, NewProcessId, NewProcessName, ParentProcessName, CommandLine, EventID, Activity, Computer

#The below query could return false-positives please verify the output and modify the query according to your environment.

SecurityEvent 
| where EventID==4688 
| where ParentProcessName has_any ('sdiagnhost.exe', 'msdt.exe')
//| where NewProcessName contains "powershell" or NewProcessname contains "cmd.exe"  //optional: you can include this line for directly finding powershell or cmd process spawns
| project TimeGenerated, NewProcessId, NewProcessName, ParentProcessName, CommandLine, EventID, Activity, Computer

测试与研究

⚠⚠请仅出于研究和学习目的使用以下内容

  • 利用附带的 样本
  • 利用 John Hammond 创建的出色代码和平台 此处
  • 武器化的 CVE-2021-40444 可在此找到 此处
  • 利用 Cas van Cooten 创建的此 POC 此处

缓解方案

  • 删除 ms-msdt 的协议处理程序可能是最安全的缓解措施,直到 Microsoft 发布官方回应。我们尚未在大型企业中测试此方法,因此广泛禁用协议处理程序可能会产生一些副作用。然而,考虑到成功利用(任意代码执行)的影响,这似乎是一个合理的基于风险的方法(至少在任何打开 Office 文档的系统上)。删除协议处理程序只需在提升的命令提示符下执行以下命令:
root@kitploit:~
reg delete HKEY_CLASSES_ROOT\ms-msdt /f

*请注意,在删除内容之前,您应备份此键的内容,以便在补丁可用时将其合并回注册表。

  • 您可以使用以下 PowerShell 脚本来实现注册表修改。感谢 Kelvin Tegelaar
root@kitploit:~
$ENV:ActivateWorkaround = "Yes"
if($ENV:ActivateWorkaround -eq "Yes") {
    New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR
    Set-Item -Path "HKCR:\ms-msdt" -Value "URL:ms-msdt_bak"
    Rename-Item -Path "HKCR:\ms-msdt" -newName "ms-msdt_bak"
} else {
    New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR
    Rename-Item -Path "HKCR:\ms-msdt_bak" -newName "ms-msdt"

    Set-Item -Path "HKCR:\ms-msdt" -Value "URL:ms-msdt"
}

  • 教育您的用户始终报告任何包含附件的电子邮件,并且不要打开它。此漏洞甚至仅通过悬停即可被利用。因此最终用户必须保持警惕。
  • 如果您在环境中使用 Microsoft Defender 的 攻击面减少 (ASR) 规则,在阻止模式下激活“阻止所有 Office 应用程序创建子进程”规则将防止此漏洞被利用。但是,如果您尚未使用 ASR,建议先在审计模式下运行该规则并监控结果,以确保不会对最终用户造成不良影响。

参考

  • https://thehackernews.com/2022/05/watch-out-researchers-spot-new.html
  • https://reaqta.com/2022/05/threat-analysis-msdt-exploit-with-maldocs/
  • https://www.joesandbox.com/analysis/636202/0/html
  • https://www.bleepingcomputer.com/news/microsoft/microsoft-shares-mitigation-for-office-zero-day-exploited-in-attacks/
  • https://nakedsecurity.sophos.com/2022/05/31/mysterious-follina-zero-day-hole-in-office-what-to-do/
  • https://www.theregister.com/2022/05/30/follina_microsoft_office_vulnerability/
  • https://msrc-blog.microsoft.com/2022/05/30/guidance-for-cve-2022-30190-microsoft-support-diagnostic-tool-vulnerability/
  • https://unit42.paloaltonetworks.com/cve-2022-30190-msdt-code-execution-vulnerability/
下载工具