diff --git a/lib/msf/core/post/windows/registry.rb b/lib/msf/core/post/windows/registry.rb index c5c76fc85f..abe32cded7 100644 --- a/lib/msf/core/post/windows/registry.rb +++ b/lib/msf/core/post/windows/registry.rb @@ -29,6 +29,51 @@ module Registry # REGISTRY_VIEW_64_BIT = 2 + # + # Windows Registry Constants. + # + REG_NONE = 1 + REG_SZ = 1 + REG_EXPAND_SZ = 2 + REG_BINARY = 3 + REG_DWORD = 4 + REG_LITTLE_ENDIAN = 4 + REG_BIG_ENDIAN = 5 + REG_LINK = 6 + REG_MULTI_SZ = 7 + + HKEY_CLASSES_ROOT = 0x80000000 + HKEY_CURRENT_USER = 0x80000001 + HKEY_LOCAL_MACHINE = 0x80000002 + HKEY_USERS = 0x80000003 + HKEY_PERFORMANCE_DATA = 0x80000004 + HKEY_CURRENT_CONFIG = 0x80000005 + HKEY_DYN_DATA = 0x80000006 + + # + # Lookup registry hives by key. + # + def registry_hive_lookup(hive) + case hive + when 'HKCR' + HKEY_LOCAL_MACHINE + when 'HKCU' + HKEY_CURRENT_USER + when 'HKLM' + HKEY_LOCAL_MACHINE + when 'HKU' + HKEY_USERS + when 'HKPD' + HKEY_PERFORMANCE_DATA + when 'HKCC' + HKEY_CURRENT_CONFIG + when 'HKDD' + HKEY_DYN_DATA + else + HKEY_LOCAL_MACHINE + end + end + # # Load a hive file # diff --git a/lib/rex.rb b/lib/rex.rb index e3e5d16ccb..8952a1a33f 100644 --- a/lib/rex.rb +++ b/lib/rex.rb @@ -106,9 +106,6 @@ require 'rex/parser/ini' # Compatibility require 'rex/compat' -# Platforms -require 'rex/platforms' - # SSLScan require 'rex/sslscan/scanner' require 'rex/sslscan/result' diff --git a/lib/rex/platforms.rb b/lib/rex/platforms.rb deleted file mode 100644 index c6d29dfc7f..0000000000 --- a/lib/rex/platforms.rb +++ /dev/null @@ -1,2 +0,0 @@ -# -*- coding: binary -*- -require 'rex/platforms/windows' diff --git a/lib/rex/platforms/windows.rb b/lib/rex/platforms/windows.rb deleted file mode 100644 index 86e877f1c4..0000000000 --- a/lib/rex/platforms/windows.rb +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: binary -*- -module Rex -module Platforms -module Windows - - - -# -# Windows Registry Constants -# - REG_NONE = 1 - REG_SZ = 1 - REG_EXPAND_SZ = 2 - REG_BINARY = 3 - REG_DWORD = 4 - REG_LITTLE_ENDIAN = 4 - REG_BIG_ENDIAN = 5 - REG_LINK = 6 - REG_MULTI_SZ = 7 - - HKEY_CLASSES_ROOT = 0x80000000 - HKEY_CURRENT_USER = 0x80000001 - HKEY_LOCAL_MACHINE = 0x80000002 - HKEY_USERS = 0x80000003 - HKEY_PERFORMANCE_DATA = 0x80000004 - HKEY_CURRENT_CONFIG = 0x80000005 - HKEY_DYN_DATA = 0x80000006 - - def registry_hive_lookup(hive) - case hive - when 'HKCR' - HKEY_LOCAL_MACHINE - when 'HKCU' - HKEY_CURRENT_USER - when 'HKLM' - HKEY_LOCAL_MACHINE - when 'HKU' - HKEY_USERS - when 'HKPD' - HKEY_PERFORMANCE_DATA - when 'HKCC' - HKEY_CURRENT_CONFIG - when 'HKDD' - HKEY_DYN_DATA - else - HKEY_LOCAL_MACHINE - end - end - -end -end -end diff --git a/modules/auxiliary/admin/backupexec/registry.rb b/modules/auxiliary/admin/backupexec/registry.rb index 6cef2bf11d..291932af6a 100644 --- a/modules/auxiliary/admin/backupexec/registry.rb +++ b/modules/auxiliary/admin/backupexec/registry.rb @@ -10,7 +10,7 @@ require 'msf/core' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::DCERPC - include ::Rex::Platforms::Windows + include Msf::Post::Windows::Registry def initialize(info = {}) super(update_info(info, diff --git a/modules/auxiliary/admin/serverprotect/file.rb b/modules/auxiliary/admin/serverprotect/file.rb index 61bf21da5b..81222d0790 100644 --- a/modules/auxiliary/admin/serverprotect/file.rb +++ b/modules/auxiliary/admin/serverprotect/file.rb @@ -10,7 +10,7 @@ require 'msf/core' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::DCERPC - include Rex::Platforms::Windows + include Msf::Post::Windows::Registry def initialize(info = {}) super(update_info(info,