Skip to content

Commit 3f5ed75

Browse files
committed
Relocate Rex::Platform:Windows content (fixes MS-1714)
1 parent 27018b4 commit 3f5ed75

File tree

6 files changed

+47
-59
lines changed

6 files changed

+47
-59
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,

0 commit comments

Comments
 (0)