CVE-2023-42793 JetBrains TeamCity 权限绕过
source link: https://y4er.com/posts/cve-2023-42793-jetbrains-teamcity-auth-bypass-rce/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
CVE-2023-42793 JetBrains TeamCity 权限绕过
https://www.jetbrains.com/zh-cn/teamcity/download/other.html
https://download.jetbrains.com.cn/teamcity/plugins/internal/CVE-2023-42793-fix-recent-versions.zip
补丁下下来发现这是个插件,其中只有一个类 org.jetbrains.teamcity.FixRPC2Requests
唯一作用就是从RequestInterceptors对象中拿到myPreHandlingDisabled字段值,然后移除掉/**/RPC2
在RequestInterceptors类中
public static String getPathSuffix() {
return "/RPC2";
}
也就是说默认myPreHandlingDisabled添加了/app/agents/**
和/**/RPC2/
在这个RequestInterceptors拦截器中的preHandle函数中
match函数中用ant风格匹配uri
所以我们找路由可以构成/**/RPC2
的利用点即可
在rest-api插件中jetbrains.buildServer.server.rest.request.UserRequest#createToken(java.lang.String, java.lang.String, java.lang.String)
满足/RPC2
的条件,可以给任意用户创建一个name为RPC2的token,然后用token调用即可绕过鉴权。
然后有这个token,你可以直接添加一个用户
或者直接加header头,访问/admin/admin.html也行。
随便改改补丁插件包,后台传插件rce
加内存马什么的,随便写。
文笔垃圾,措辞轻浮,内容浅显,操作生疏。不足之处欢迎大师傅们指点和纠正,感激不尽。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK