smb_file_exist check for rubysmb

GSoC/Meterpreter_Web_Console
Jacob Robles 2018-06-28 18:10:39 -05:00
parent 8e36551b22
commit 5e02e7a2c8
No known key found for this signature in database
GPG Key ID: 3EC9F18F2B12401C
1 changed files with 2 additions and 0 deletions

View File

@ -220,6 +220,8 @@ module Msf
def smb_file_exist?(file)
begin
fd = simple.open(file, 'o')
rescue RubySMB::Error::UnexpectedStatusCode => e
found = false
rescue Rex::Proto::SMB::Exceptions::ErrorCode => e
# If attempting to open the file results in a "*_NOT_FOUND" error,
# then we can be sure the file is not there.