File tree Expand file tree Collapse file tree 5 files changed +41
-11
lines changed
lib/rex/post/meterpreter/extensions/stdapi
modules/exploits/windows/local Expand file tree Collapse file tree 5 files changed +41
-11
lines changed Original file line number Diff line number Diff line change 14
14
metasploit-concern
15
15
metasploit-credential
16
16
metasploit-model
17
- metasploit-payloads (= 1.1.16 )
17
+ metasploit-payloads (= 1.1.19 )
18
18
metasploit_data_models
19
19
metasploit_payloads-mettle (= 0.0.6 )
20
20
msgpack
167
167
activemodel (~> 4.2.6 )
168
168
activesupport (~> 4.2.6 )
169
169
railties (~> 4.2.6 )
170
- metasploit-payloads (1.1.16 )
170
+ metasploit-payloads (1.1.19 )
171
171
metasploit_data_models (2.0.4 )
172
172
activerecord (~> 4.2.6 )
173
173
activesupport (~> 4.2.6 )
Original file line number Diff line number Diff line change @@ -51,6 +51,25 @@ def is_system?
51
51
getsid == SYSTEM_SID
52
52
end
53
53
54
+ #
55
+ # Returns a list of currently active drivers used by the target system
56
+ #
57
+ def getdrivers
58
+ request = Packet . create_request ( 'stdapi_sys_config_driver_list' )
59
+ response = client . send_request ( request )
60
+
61
+ result = [ ]
62
+
63
+ response . each ( TLV_TYPE_DRIVER_ENTRY ) do |driver |
64
+ result << {
65
+ basename : driver . get_tlv_value ( TLV_TYPE_DRIVER_BASENAME ) ,
66
+ filename : driver . get_tlv_value ( TLV_TYPE_DRIVER_FILENAME )
67
+ }
68
+ end
69
+
70
+ result
71
+ end
72
+
54
73
#
55
74
# Returns a hash of requested environment variables, along with their values.
56
75
# If a requested value doesn't exist in the response, then the value wasn't found.
Original file line number Diff line number Diff line change @@ -158,6 +158,10 @@ module Stdapi
158
158
TLV_TYPE_PROCESS_SESSION = TLV_META_TYPE_UINT | 2308
159
159
TLV_TYPE_PROCESS_ARCH_NAME = TLV_META_TYPE_STRING | 2309
160
160
161
+ TLV_TYPE_DRIVER_ENTRY = TLV_META_TYPE_GROUP | 2320
162
+ TLV_TYPE_DRIVER_BASENAME = TLV_META_TYPE_STRING | 2321
163
+ TLV_TYPE_DRIVER_FILENAME = TLV_META_TYPE_STRING | 2322
164
+
161
165
TLV_TYPE_IMAGE_FILE = TLV_META_TYPE_STRING | 2400
162
166
TLV_TYPE_IMAGE_FILE_PATH = TLV_META_TYPE_STRING | 2401
163
167
TLV_TYPE_PROCEDURE_NAME = TLV_META_TYPE_STRING | 2402
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ Gem::Specification.new do |spec|
65
65
# are needed when there's no database
66
66
spec . add_runtime_dependency 'metasploit-model'
67
67
# Needed for Meterpreter
68
- spec . add_runtime_dependency 'metasploit-payloads' , '1.1.16 '
68
+ spec . add_runtime_dependency 'metasploit-payloads' , '1.1.19 '
69
69
# Needed for the next-generation POSIX Meterpreter
70
70
spec . add_runtime_dependency 'metasploit_payloads-mettle' , '0.0.6'
71
71
# Needed by msfgui and other rpc components
Original file line number Diff line number Diff line change @@ -51,21 +51,28 @@ def initialize(info={})
51
51
end
52
52
53
53
def check
54
- if sysinfo [ 'OS' ] !~ /windows 7 /i
54
+ if sysinfo [ 'OS' ] !~ /windows (7|8) /i
55
55
return Exploit ::CheckCode ::Unknown
56
56
end
57
57
58
- if sysinfo [ 'Architecture' ] =~ /(wow|x)64/i
59
- arch = ARCH_X86_64
60
- else
58
+ if sysinfo [ 'Architecture' ] !~ /(wow|x)64/i
61
59
return Exploit ::CheckCode ::Safe
62
60
end
63
61
64
- file_path = expand_path ( '%windir%' ) << '\\system32\\capcom.sys'
65
- return Exploit ::CheckCode ::Safe unless file_exist? ( file_path )
62
+ # Validate that the driver has been loaded and that
63
+ # the version is the same as the one expected
64
+ client . sys . config . getdrivers . each do |d |
65
+ if d [ :basename ] . downcase == 'capcom.sys'
66
+ expected_checksum = '73c98438ac64a68e88b7b0afd11ba140'
67
+ target_checksum = client . fs . file . md5 ( d [ :filename ] )
68
+
69
+ if expected_checksum == Rex ::Text . to_hex ( target_checksum , '' )
70
+ return Exploit ::CheckCode ::Appears
71
+ end
72
+ end
73
+ end
66
74
67
- # TODO: check for the capcom.sys driver and its version.
68
- return Exploit ::CheckCode ::Appears
75
+ return Exploit ::CheckCode ::Safe
69
76
end
70
77
71
78
def exploit
You can’t perform that action at this time.
0 commit comments