winrar CVE-2025-8088复现学习
摘要:CVE-2025-8088 (CVSS 8.4)…
# Detects exposure to CVE-2025-8088 based on WinRAR.
# Vulnerable: WinRAR < 7.13 (Patched: 7.13+)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
function info { param([string]$m) Write-Host "[i] $m" }
function good { param([string]$m) Write-Host "[+] $m" -ForegroundColor Green }
function bad { param([string]$m) Write-Host "[-] $m" -ForegroundColor Red }
$fixedVersion = [version]'7.13.0'
# Common install locations
$candidates = @(
"$env:ProgramFiles\WinRAR\WinRAR.exe",
"${env:ProgramFiles(x86)}\WinRAR\WinRAR.exe"
) | Where-Object { $_ -and (Test-Path $_) }
if (-not $candidates) {
$cmd = Get-Command 'WinRAR.exe' -ErrorAction SilentlyContinue
if ($cmd) { $candidates = @($cmd.Source) }
}
if (-not $candidates) {
info "WinRAR not found. Nothing to check."
return
}
$entries = foreach ($p in $candidates) {
$v = (Get-Command $p).FileVersionInfo.ProductVersion
[pscustomobject]@{ Path = $p; Version = $v; V = [version]$v }
}
$winrar = $entries | Sort-Object V -Descending | Select-Object -First 1
info ("WinRAR path: " + $winrar.Path)
info ("WinRAR version: " + $winrar.Version)
if ($winrar.V -lt $fixedVersion) {
bad "CVE-2025-8088 IS exploitable (WinRAR < 7.13)."
} else {
good "CVE-2025-8088 is NOT exploitable (WinRAR >= 7.13)."
}



https://github.com/sxyrxyy/CVE-2025-8088-WinRAR-Proof-of-Concept-PoC-Exploit-?tab=readme-ov-file

该命令的实际效果
此命令将创建一个恶意RAR文件,其攻击流程如下:
读取文件:
诱饵:
clib.txt(需存在于当前目录)载荷:
run_decode.bat(需存在于当前目录)NTFS流附加:
将
run_decode.bat作为交替数据流(ADS)附加到clib.txt上流名称初始化为128字节的占位符(如
XXXXXXXX...)生成基础RAR:
调用WinRAR生成包含
clib.txt及其ADS流的普通RAR5文件二进制补丁:
在RAR头部搜索占位符字符串
替换为路径遍历字符串:
..\..\..\...(16层)\Desktop\CVE-2025-8088...\run_decode.batCRC32修复:
重新计算所有RAR块头的CRC32校验和,确保文件格式合法
输出文件:
默认生成:
cve-2025-8088-sxy-poc.rar中间文件:
cve-2025-8088-sxy-poc.base.rar(生成后自动删除)
攻击后果
当受害者使用存在漏洞的WinRAR版本解压时:
表面上看:只解压出
clib.txt实际上:
run_decode.bat会被释放到:C:\Users\Administrator\Desktop\CVE-2025-8088-WinRAR-PoC-Exploit\run_decode.bat
(3)生成攻击rar

通过7z l -sns来检查生成的rar,

这里的载荷文件是run_decode.bat;
或者 NtfsStreamEditor 来查看,

直接出来了ADS中包含的启动载荷run_decode.bat的内容。
(4)互联网中公布的利用
我们再来看一个更为明显的载荷,hta启动


顺便借用个攻击链过程图,


可以看到通过“恶意邮件:附件-->CVE-2025-8088-->释放恶意HTA载荷文件-->连接下载服务器-->下载后续载荷文件-->连接C2服务器”。
5、winrar解压缩的表现特征
这里借用网上的恶意文件。用winrar解压,

这时,报错。将这段内容复制出来,粘贴到文本中,再看下,

完整的就是不一样了,出现了“Bang_Luong_Thang_11_2025.csv:..\..\..\..\..\..\..\..\Users\sosona\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Update.exe”
6、改造poc.py
以下是修改 poc.py 的代码建议,它会在生成 RAR 文件后,为其附加一个模拟的 Zone.Identifier ADS 流。
修改说明:
(1). 新增 attach_motw 函数,用于创建 Zone.Identifier 流。
(2). 在 main 函数最后调用该函数,为输出的 RAR 文件添加 ADS。
defattach_motw(path: Path):
"""Attach Zone.Identifier to mimic a downloaded file (ZoneId=3)."""
motw = textwrap.dedent("""\
[ZoneTransfer]
ZoneId=3
HostUrl=about:internet
""")
try:
withopen(f"{path}:Zone.Identifier", "w") as f:
f.write(motw)
print(f"[+] Attached Zone.Identifier (Mark of the Web) to {path}")
exceptExceptionas e:
print(f"[-] Failed to attach MOTW: {e}")
应用上述修改后,再次运行 PoC 脚本生成的 RAR 文件将会在文件系统层面拥有一个 Zone.Identifier ADS 流,这有助于模拟真实的攻击场景(即通过网络下载的恶意文件)。
如果想验证修改后的效果,可以在运行脚本后使用 PowerShell 命令 Get-Item -Path cve-2025-8088-sxy-poc.rar -Stream * 查看是否成功添加了 ADS 流。



三、总结
1、CVE-2025-8088针对是7.13以下版本的winrar,危害性很大,各位网友赶快升级到最新版本7.13;
2、通过上面的“检测与复现”,了解该漏洞的构造、传播过程以及ADS 将恶意二进制文件隐藏起来,使其无法被随意检查和一些传统的安全工具发现,从而延迟了检测。同时,我们分享了两种检测ADS流的方法,并改造poc.py使其更加具备生成的文件Zone.Identifier ADS 流;
3、我们本文为漏洞复现,内容非常详细,网上还未看到相关文章,复现分析是为了更好地防范攻击,一定不要用于危害活动,否则跟本人无关。







