From e60aeca2db3d2c0d28d1c8a015c02848c8fa0dca Mon Sep 17 00:00:00 2001 From: William Vu Date: Thu, 25 Jan 2018 16:41:30 -0600 Subject: [PATCH] Pass in session to CWD check Oops, used to this being accessible universally. Not the case here. --- lib/msf/core/exploit/file_dropper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/exploit/file_dropper.rb b/lib/msf/core/exploit/file_dropper.rb index 24c1fae47c..61d7528514 100644 --- a/lib/msf/core/exploit/file_dropper.rb +++ b/lib/msf/core/exploit/file_dropper.rb @@ -201,7 +201,7 @@ module Exploit::FileDropper # @param [String] dir The directory to delete # @return [Boolean] True if the delete command has been executed in the remote machine, otherwise false. def file_dropper_delete_dir(session, dir) - if file_dropper_check_cwd?(dir) + if file_dropper_check_cwd?(session, dir) print_warning("Attempting to delete working directory #{dir}") end @@ -258,7 +258,7 @@ module Exploit::FileDropper # # @param [String] path The path to check # @return [Boolean] true if the path is the same, otherwise false - def file_dropper_check_cwd?(path) + def file_dropper_check_cwd?(session, path) if session.type == 'meterpreter' return true if path == session.fs.dir.pwd else