Added error handling when searching file contents

main
byt3bl33d3r 2015-10-09 19:44:02 -06:00
parent 39887088bf
commit b2f0533ff3
1 changed files with 17 additions and 14 deletions

View File

@ -2630,6 +2630,7 @@ def dir_list(files, ip, path, pattern, share, smb):
return
def search_content(smb, path, result, share, pattern, ip):
try:
rfile = RemoteFile(smb, path + '/' + result.get_longname(), share, access = FILE_READ_DATA)
rfile.open()
@ -2647,6 +2648,8 @@ def search_content(smb, path, result, share, pattern, ip):
print_att("//{}/{}/{} offset:{} pattern:{}".format(ip, path.replace("//",""), result.get_longname().encode('utf8'), rfile.tell(), pattern))
rfile.close()
return
except Exception:
pass
def enum_shares(smb):
permissions = {}