From 14da99bb3d1f37398072d05f712d91d713dbeacf Mon Sep 17 00:00:00 2001 From: William Vu Date: Tue, 12 Jun 2018 17:11:29 -0500 Subject: [PATCH] Fix missing RequestError in a few post modules Should be Rex::Post::Meterpreter::RequestError. --- modules/post/linux/gather/pptpd_chap_secrets.rb | 2 +- modules/post/windows/gather/screen_spy.rb | 2 +- modules/post/windows/manage/inject_host.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/post/linux/gather/pptpd_chap_secrets.rb b/modules/post/linux/gather/pptpd_chap_secrets.rb index 535ea83bba..6f0624b2ab 100644 --- a/modules/post/linux/gather/pptpd_chap_secrets.rb +++ b/modules/post/linux/gather/pptpd_chap_secrets.rb @@ -33,7 +33,7 @@ class MetasploitModule < Msf::Post def load_file(fname) begin data = cmd_exec("cat #{fname}") - rescue RequestError => e + rescue Rex::Post::Meterpreter::RequestError => e print_error("Failed to retrieve file. #{e.message}") data = '' end diff --git a/modules/post/windows/gather/screen_spy.rb b/modules/post/windows/gather/screen_spy.rb index 32e8e77fa2..feb6442b98 100644 --- a/modules/post/windows/gather/screen_spy.rb +++ b/modules/post/windows/gather/screen_spy.rb @@ -75,7 +75,7 @@ class MetasploitModule < Msf::Post select(nil, nil, nil, datastore['DELAY']) begin 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}") return false end diff --git a/modules/post/windows/manage/inject_host.rb b/modules/post/windows/manage/inject_host.rb index d8e1aef734..30f1ce76d6 100644 --- a/modules/post/windows/manage/inject_host.rb +++ b/modules/post/windows/manage/inject_host.rb @@ -43,7 +43,7 @@ class MetasploitModule < Msf::Post begin # Download the remote file to the temporary file 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 # error. if re.result != 2