Skip to content

Commit bdf0735

Browse files
committed
Switch errors over to windows_error gem...
1 parent 2a703d6 commit bdf0735

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ PATH
4646
sshkey
4747
tzinfo
4848
tzinfo-data
49+
windows_error
4950

5051
GEM
5152
remote: https://rubygems.org/
@@ -277,6 +278,7 @@ GEM
277278
thread_safe (~> 0.1)
278279
tzinfo-data (1.2016.6)
279280
tzinfo (>= 1.0.0)
281+
windows_error (0.0.2)
280282
xpath (2.0.0)
281283
nokogiri (~> 1.3)
282284
yard (0.9.0)

lib/msf/core/exploit/smb/client/psexec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# -*- coding: binary -*-
22
require 'rex/proto/dcerpc/svcctl'
3+
require 'windows_error'
4+
require 'windows_error/win32'
5+
6+
include WindowsError::Win32
37

48
module Msf
59

lib/rex/constants/windows.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ module Windows
1010

1111
STANDARD_RIGHTS_REQUIRED = 0x000F0000
1212

13-
##
14-
#
15-
# Errors
16-
#
17-
##
18-
19-
ERROR_SUCCESS = 0x0
20-
ERROR_FILE_NOT_FOUND = 0x2
21-
ERROR_ACCESS_DENIED = 0x5
22-
ERROR_SERVICE_REQUEST_TIMEOUT = 0x41D
23-
ERROR_SERVICE_EXISTS = 0x431
24-
2513
##
2614
#
2715
# SVCCTL Protocol Functions

lib/rex/proto/dcerpc/svcctl/packet.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ module Rex
77
###
88
module Proto::DCERPC::SVCCTL
99

10+
require 'windows_error'
11+
require 'windows_error/win32'
1012
require 'rex/constants/windows'
1113
NDR = Rex::Encoder::NDR
1214

1315

1416
class Client
1517

18+
include WindowsError::Win32
1619
include Rex::Constants::Windows
1720

1821
attr_accessor :dcerpc_client

metasploit-framework.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ Gem::Specification.new do |spec|
102102
spec.add_runtime_dependency 'sshkey'
103103
# BitStruct Library used for handling certain Protocol Header/Packet construction
104104
spec.add_runtime_dependency 'bit-struct'
105+
# Library for interpreting Windows error codes and strings
106+
spec.add_runtime_dependency 'windows_error'
105107

106108
#
107109
# Protocol Libraries

0 commit comments

Comments
 (0)