File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
modules/exploits/windows/smb Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -257,8 +257,10 @@ def verify_arch
257
257
return true if !datastore [ 'VerifyArch' ]
258
258
259
259
pkt = Rex ::Proto ::DCERPC ::Packet . make_bind (
260
- 'e1af8308-5d1f-11c9-91a4-08002b14a0fa' , '3.0' , # Abstract Syntax: EPMv4 V3.0
261
- '71710533-beba-4937-8319-b5dbef9ccc36' , '1.0' # Transfer Syntax[1]: 64bit NDR V1
260
+ # Abstract Syntax: EPMv4 V3.0
261
+ 'e1af8308-5d1f-11c9-91a4-08002b14a0fa' , '3.0' ,
262
+ # Transfer Syntax[1]: 64bit NDR V1
263
+ '71710533-beba-4937-8319-b5dbef9ccc36' , '1.0'
262
264
) . first
263
265
264
266
sock = connect ( false ,
@@ -270,13 +272,24 @@ def verify_arch
270
272
res = sock . get_once
271
273
disconnect ( sock )
272
274
273
- return false if res . nil?
275
+ begin
276
+ resp = Rex ::Proto ::DCERPC ::Response . new ( res )
277
+ rescue Rex ::Proto ::DCERPC ::Exceptions ::InvalidPacket => e
278
+ print_error ( e . to_s )
279
+ return false
280
+ end
274
281
275
282
case target_arch . first
276
283
when ARCH_X64
277
- ( ret = true ) if res [ 36 ] == "\x00 " # Ack result: Acceptance (0)
284
+ # Ack result: Acceptance (0)
285
+ if resp . ack_result . first == 0
286
+ ret = true
287
+ end
278
288
when ARCH_X86
279
- ( ret = true ) if res [ 36 ] != "\x00 " # Ack result: Provider rejection (2)
289
+ # Ack result: Provider rejection (2)
290
+ if resp . ack_result . first != 0
291
+ ret = true
292
+ end
280
293
end
281
294
282
295
if ret
You can’t perform that action at this time.
0 commit comments