Skip to content

Commit b72d2b5

Browse files
committed
Add logging in case of exceptions during rm
1 parent a902480 commit b72d2b5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/msf/core/exploit/file_dropper.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def on_new_session(session)
5656
#
5757
# Record file as needing to be cleaned up
5858
#
59-
# @param [Array<String>] files List of paths on the target that should
59+
# @param files [Array<String>] List of paths on the target that should
6060
# be deleted during cleanup. Each filename should be either a full
6161
# path or relative to the current working directory of the session
6262
# (not necessarily the same as the cwd of the server we're
@@ -95,7 +95,9 @@ def cleanup
9595
true
9696
#rescue ::Rex::SocketError, ::EOFError, ::IOError, ::Errno::EPIPE, ::Rex::Post::Meterpreter::RequestError => e
9797
rescue ::Exception => e
98-
vprint_error("Failed to delete #{file}: #{e.to_s}")
98+
vprint_error("Failed to delete #{file}: #{e}")
99+
elog("Failed to delete #{file}: #{e.class}: #{e}")
100+
elog("Call stack:\n#{e.backtrace.join("\n")}")
99101
false
100102
end
101103
end

0 commit comments

Comments
 (0)