{
  "Name": "S2 NetBox RCE",
  "Description": "Embedthis GoAhead before 3.6.5 allows remote code execution if CGI is enabled and a CGI program is dynamically linked. This is a result of initializing the environment of forked CGI scripts using untrusted HTTP request parameters in the cgiHandler function in cgi.c. When combined with the glibc dynamic linker, this behaviour can be abused for remote code execution using special parameter names such as LD_PRELOAD. An attacker can POST their shared object payload in the body of the request, and reference it using /proc/self/fd/0.",
  "Product": "S2NetBox",
  "Homepage": "https://www.s2sys.com/solutions/products/access-control-systems/s2-netbox",
  "DisclosureDate": "2017-12-12",
  "Author": "gobysec@gmail.com",
  "GobyQuery": "title=\"S2 NetBox Login\" && server=\"GoAhead-Webs\"",
  "Level": "3",
  "Impact": "When combined with the glibc dynamic linker, this behaviour can be abused for remote code execution using special parameter names such as LD_PRELOAD.",
  "Recommendation": "",
  "References": [
    "http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.html",
    "http://www.securitytracker.com/id/1040702",
    "https://github.com/elttam/advisories/tree/master/CVE-2017-17562",
    "https://github.com/embedthis/goahead/commit/6f786c123196eb622625a920d54048629a7caa74",
    "https://github.com/embedthis/goahead/issues/249",
    "https://www.elttam.com.au/blog/goahead/",
    "https://www.exploit-db.com/exploits/43360/",
    "https://www.exploit-db.com/exploits/43877/",
    "https://nvd.nist.gov/vuln/detail/CVE-2017-17562",
    "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17562"
  ],
  "HasExp": true,
  "ExpParams": [
    {
      "Name": "AttackType",
      "Type": "select",
      "Value": "goby_shell_linux"
    }
  ],
  "ExpTips": {
    "Type": "",
    "Content": ""
  },
  "ScanSteps": [
    "AND",
    {
      "Request": {
        "data": "",
        "data_type": "text",
        "follow_redirect": false,
        "method": "GET",
        "uri": "/cgi-bin/licrefresh.cgi?LD_DEBUG=help"
      },
      "ResponseTest": {
        "checks": [
          {
            "bz": "",
            "operation": "contains",
            "type": "item",
            "value": "LD_DEBUG_OUTPUT",
            "variable": "$body"
          }
        ],
        "operation": "AND",
        "type": "group"
      }
    }
  ],
  "ExploitSteps": null,
  "Tags": null,
  "CVEIDs": [
    "CVE-2017-17562"
  ],
  "CVSSScore": "8.1",
  "AttackSurfaces": {
    "Application": null,
    "Support": null,
    "Service": null,
    "System": null,
    "Hardware": ["S2NetBox"]
  },
  "Disable": false
}