Land #10165, Fix missing RequestError in a few post modules
parent
95ee536705
commit
ce48ff4382
|
@ -33,7 +33,7 @@ class MetasploitModule < Msf::Post
|
||||||
def load_file(fname)
|
def load_file(fname)
|
||||||
begin
|
begin
|
||||||
data = cmd_exec("cat #{fname}")
|
data = cmd_exec("cat #{fname}")
|
||||||
rescue RequestError => e
|
rescue Rex::Post::Meterpreter::RequestError => e
|
||||||
print_error("Failed to retrieve file. #{e.message}")
|
print_error("Failed to retrieve file. #{e.message}")
|
||||||
data = ''
|
data = ''
|
||||||
end
|
end
|
||||||
|
|
|
@ -75,7 +75,7 @@ class MetasploitModule < Msf::Post
|
||||||
select(nil, nil, nil, datastore['DELAY'])
|
select(nil, nil, nil, datastore['DELAY'])
|
||||||
begin
|
begin
|
||||||
data = session.espia.espia_image_get_dev_screen
|
data = session.espia.espia_image_get_dev_screen
|
||||||
rescue RequestError => e
|
rescue Rex::Post::Meterpreter::RequestError => e
|
||||||
print_error("Error taking the screenshot: #{e.class} #{e} #{e.backtrace}")
|
print_error("Error taking the screenshot: #{e.class} #{e} #{e.backtrace}")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,7 +43,7 @@ class MetasploitModule < Msf::Post
|
||||||
begin
|
begin
|
||||||
# Download the remote file to the temporary file
|
# Download the remote file to the temporary file
|
||||||
client.fs.file.download_file(temp_path, 'C:\\WINDOWS\\System32\\drivers\\etc\\hosts')
|
client.fs.file.download_file(temp_path, 'C:\\WINDOWS\\System32\\drivers\\etc\\hosts')
|
||||||
rescue RequestError => re
|
rescue Rex::Post::Meterpreter::RequestError => re
|
||||||
# If the file doesn't exist, then it's okay. Otherwise, throw the
|
# If the file doesn't exist, then it's okay. Otherwise, throw the
|
||||||
# error.
|
# error.
|
||||||
if re.result != 2
|
if re.result != 2
|
||||||
|
|
Loading…
Reference in New Issue