From c34b796f13ef77b9cdfd55aebbcbe1a15f8e2dfb Mon Sep 17 00:00:00 2001 From: Auxilus Date: Mon, 9 Apr 2018 20:14:01 +0530 Subject: [PATCH] Remove temp file from dist after cmd execution https://github.com/rapid7/metasploit-framework/issues/9830 --- modules/post/windows/manage/run_as.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/post/windows/manage/run_as.rb b/modules/post/windows/manage/run_as.rb index 55793f962c..2536e6a929 100644 --- a/modules/post/windows/manage/run_as.rb +++ b/modules/post/windows/manage/run_as.rb @@ -121,5 +121,7 @@ class MetasploitModule < Msf::Post vprint_status("Thread Id: #{pi[:thread_id]}") print_status("Command output:\r\n#{tmpout}") unless tmpout.nil? end + print_status("Cleaning up...") + rm_f(outpath) end end