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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2025-6218 — 针对WinRAR路径遍历漏洞(CVE-2025-6218)的概念验证利用工具,能够通过精心构造的存档文件实现远程代码执行。包含RAR格式测试工具集。 | Kitploit
工具/GitHubGitHub/ignis-sec/cve-2025-6218
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试二进制利用
GitHubignis-sec/cve-2025-6218

CVE-2025-6218

针对WinRAR路径遍历漏洞(CVE-2025-6218)的概念验证利用工具,能够通过精心构造的存档文件实现远程代码执行。包含RAR格式测试工具集。

查看仓库
126441年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2025-6218 | ZDI-CAN-27198 | ZDI-25-409 - WinRAR 路径遍历 -> 远程代码执行 (RCE)

概念验证

更多信息:

  • https://www.win-rar.com/singlenewsview.html?&L=0
  • https://www.cvedetails.com/cve/CVE-2025-6218/
  • https://www.zerodayinitiative.com/advisories/ZDI-25-409/

RARLAB WinRAR 目录遍历远程代码执行漏洞。此漏洞允许远程攻击者在受影响的 RARLAB WinRAR 安装上执行任意代码。漏洞利用需要用户交互,即目标必须访问恶意页面或打开恶意文件。

具体缺陷存在于存档文件中文件路径的处理。精心构造的文件路径可导致进程遍历到意外的目录。攻击者可利用此漏洞在当前用户上下文中执行代码。之前编号为 ZDI-CAN-27198。

发布时间 2025-06-21 00:09:03 更新时间 2025-06-23 20:16:22 来源 Zero Day Initiative

漏洞类别:目录遍历 | 执行代码

这是 CVE-2025-6218 WinRAR 路径遍历漏洞的一个非常简洁的概念验证。(还包括:我用于漏洞测试的 RAR 格式工具集)

概念验证中不包含路径遍历到 RCE 的完整利用链,但在 Windows 上从任意文件写入到 RCE 是轻而易举的。

创建概念验证:

root@kitploit:~
$ python3 cve-2025-6218.py

如果你解压此存档,test.txt 将会被解压到当前目录的上一级目录。

该问题源于 WinRAR 可执行文件(版本 7.11 及之前)在清理空格与扫描路径遍历之间存在特定冲突:

一个经过简化和清理的版本:

root@kitploit:~
void file_name_check(char *a1){
  cur_filename = a1;
  j = 0;
  cur_pos = 0;
  if ( *(a1 + 4) > 0 )
  {
    offset = 0;
    while ( 1 )
    {
      if ( (cur_pos + 1) == cur_filename[2] )
        goto BREAK;
      str = cur_filename;
      if ( cur_filename[3] > 7 )
        str = *cur_filename;
      if ( str[offset + 1] == '\\' || str[offset + 1] == '/' )
      {
BREAK:
        if ( cur_pos >= 0 )
          break;
      }
LOOP_START:
      ++cur_pos;
      ++offset;
      if ( cur_pos >= *(cur_filename + 4) )
        goto LABEL_47;
    }
    while ( 1 )
    {
      if ( str[offset] != '.' )
      {
        if ( str[offset] != ' ' )
          goto LOOP_START;
      }
      if ( !cur_pos )
      {
        if ( str[offset] == ' ' )
        {
          str[offset] = '_';
          goto LOOP_START;
        }
      }
      if ( str[offset] == '.' )
      {
        if ( !cur_pos )
          goto LOOP_START;
        if ( str[offset - 1] == '\\' || str[offset - 1] == '/' )
          goto LOOP_START;
        if ( cur_pos == 2 )
        {
          if ( is_safe_character(cur_filename) )
            goto LOOP_START;
        }
        else if ( cur_pos < 1 )
        {
          goto DELETE;
        }
        if ( str[offset - 1] == '.' )
        {
          if ( cur_pos == 1 )
            goto LOOP_START;
          if ( str[offset - 2] == '\\' || str[offset - 2] == '/' || cur_pos == 3 && is_safe_character(cur_filename) )
            goto LOOP_START;
        }
      }
DELETE:
      delete_char(cur_filename, cur_pos, 1u);
      --offset;
      if ( --cur_pos < 0 )
        goto LOOP_START;
    }
  }

//...
}

在 7.12 之后:

root@kitploit:~
void __fastcall file_name_check(char **a1){
  cur_filename = a1;
  j = 0;
  if ( *(a1 + 4) > 0 )
  {
    offset = 0;
    fname_index = 1;
    do
    {
      if ( fname_index == cur_filename[2] )
        goto HANDLE_DIR_NEXT;
      str = cur_filename;
      if ( str[offset + 1] == '\\' || str[offset + 1] == '/' )
      {
HANDLE_DIR_NEXT:
        if ( offset >= 0 )
        {
          if ( str[offset] == '.' )
            goto FILENAME_BEGINS;
          if ( str[offset] == ' ' )
          {
FILENAME_BEGINS:
            if ( str[offset] != '.' )
              goto CONT;
            if ( offset )
            {
              if ( str[offset - 1] != '\\'
                && str[offset - 1] != '/'
                && (offset != 2 || !is_safe_character(cur_filename)) )
              {
                if ( str[offset - 1] != '.' )
                  goto CONT;
                if ( offset != 1 )
                {
                  if ( str[offset - 2] != '\\'
                    && str[offset - 2] != '/'
                    && (offset != 3 || !is_safe_character(cur_filename)) )
                  {
CONT:
                    str[offset] = '_';
                  }
                }
              }
            }
          }
        }
      }
      ++j;
      ++offset;
      ++fname_index;
    }
    while ( j < *(cur_filename + 4) );
  }

//...
}
下载工具