From 64c2bf3227fe2241a8e3a4352dd276db55deac2f Mon Sep 17 00:00:00 2001 From: rwhitcroft Date: Fri, 10 Apr 2015 16:23:33 -0400 Subject: [PATCH] don't raise exception if file download fails --- .../ui/console/command_dispatcher/stdapi/fs.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb index 13d30de62d..2e7679508f 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb @@ -324,16 +324,8 @@ class Console::CommandDispatcher::Stdapi::Fs meterp_temp.binmode temp_path = meterp_temp.path - begin - # Download the remote file to the temporary file - client.fs.file.download_file(temp_path, args[0]) - rescue RequestError => re - # If the file doesn't exist, then it's okay. Otherwise, throw the - # error. - if re.result != 2 - raise $! - end - end + # Try to download the file, but don't worry if it doesn't exist + client.fs.file.download_file(temp_path, args[0]) rescue nil # Spawn the editor (default to vi) editor = Rex::Compat.getenv('EDITOR') || 'vi'