diff --git a/Gemfile.lock b/Gemfile.lock index 9ea972c9d2..dc4d692ed9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,6 +46,7 @@ PATH sshkey tzinfo tzinfo-data + windows_error GEM remote: https://rubygems.org/ @@ -277,6 +278,7 @@ GEM thread_safe (~> 0.1) tzinfo-data (1.2016.6) tzinfo (>= 1.0.0) + windows_error (0.0.2) xpath (2.0.0) nokogiri (~> 1.3) yard (0.9.0) diff --git a/lib/msf/core/exploit/smb/client/psexec.rb b/lib/msf/core/exploit/smb/client/psexec.rb index d64defeff0..7bae99e984 100644 --- a/lib/msf/core/exploit/smb/client/psexec.rb +++ b/lib/msf/core/exploit/smb/client/psexec.rb @@ -1,5 +1,9 @@ # -*- coding: binary -*- require 'rex/proto/dcerpc/svcctl' +require 'windows_error' +require 'windows_error/win32' + +include WindowsError::Win32 module Msf diff --git a/lib/rex/constants/windows.rb b/lib/rex/constants/windows.rb index 6921414a77..fc77d6d5f7 100644 --- a/lib/rex/constants/windows.rb +++ b/lib/rex/constants/windows.rb @@ -10,18 +10,6 @@ module Windows STANDARD_RIGHTS_REQUIRED = 0x000F0000 - ## - # - # Errors - # - ## - - ERROR_SUCCESS = 0x0 - ERROR_FILE_NOT_FOUND = 0x2 - ERROR_ACCESS_DENIED = 0x5 - ERROR_SERVICE_REQUEST_TIMEOUT = 0x41D - ERROR_SERVICE_EXISTS = 0x431 - ## # # SVCCTL Protocol Functions diff --git a/lib/rex/proto/dcerpc/svcctl/packet.rb b/lib/rex/proto/dcerpc/svcctl/packet.rb index 7e65cb86cd..c1a1cc1fd6 100644 --- a/lib/rex/proto/dcerpc/svcctl/packet.rb +++ b/lib/rex/proto/dcerpc/svcctl/packet.rb @@ -7,12 +7,15 @@ module Rex ### module Proto::DCERPC::SVCCTL + require 'windows_error' + require 'windows_error/win32' require 'rex/constants/windows' NDR = Rex::Encoder::NDR class Client + include WindowsError::Win32 include Rex::Constants::Windows attr_accessor :dcerpc_client diff --git a/metasploit-framework.gemspec b/metasploit-framework.gemspec index 05e76a9370..52abbba707 100644 --- a/metasploit-framework.gemspec +++ b/metasploit-framework.gemspec @@ -102,6 +102,8 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency 'sshkey' # BitStruct Library used for handling certain Protocol Header/Packet construction spec.add_runtime_dependency 'bit-struct' + # Library for interpreting Windows error codes and strings + spec.add_runtime_dependency 'windows_error' # # Protocol Libraries