From 78c9e9a203a0fca173367fd7022d61d43b951cbb Mon Sep 17 00:00:00 2001 From: Meatballs Date: Thu, 25 Apr 2013 18:11:45 +0100 Subject: [PATCH 1/2] Added opt delay to file_dropper --- lib/msf/core/exploit/file_dropper.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/msf/core/exploit/file_dropper.rb b/lib/msf/core/exploit/file_dropper.rb index 12ef03efb2..b6c8819052 100644 --- a/lib/msf/core/exploit/file_dropper.rb +++ b/lib/msf/core/exploit/file_dropper.rb @@ -3,6 +3,15 @@ module Msf module Exploit::FileDropper + def initialize(info = {}) + super + + register_advanced_options( + [ + OptInt.new( 'FileDropperDelay', [ false, 'Time, in s, to wait before attempting file cleanup' ]) + ], self.class) + end + # # When a new session is created, attempt to delete any files that the # exploit created. @@ -88,6 +97,12 @@ module Exploit::FileDropper end if respond_to?(:file_rm) + delay = datastore['FileDropperDelay'] + if delay + print_status("Waiting #{delay}s before file cleanup...") + select(nil,nil,nil,delay) + end + @dropped_files.delete_if do |file| begin file_rm(file) From 71e055a5c254a3aa50db89e7eacf3924cc67f636 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Thu, 25 Apr 2013 20:44:57 -0500 Subject: [PATCH 2/2] Let's word this a little differently --- lib/msf/core/exploit/file_dropper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msf/core/exploit/file_dropper.rb b/lib/msf/core/exploit/file_dropper.rb index b6c8819052..8923762ec5 100644 --- a/lib/msf/core/exploit/file_dropper.rb +++ b/lib/msf/core/exploit/file_dropper.rb @@ -8,7 +8,7 @@ module Exploit::FileDropper register_advanced_options( [ - OptInt.new( 'FileDropperDelay', [ false, 'Time, in s, to wait before attempting file cleanup' ]) + OptInt.new( 'FileDropperDelay', [ false, 'Delay in seconds before attempting file cleanup' ]) ], self.class) end