Skip to content

Commit 2ab7368

Browse files
committed
use framework.threads to launch cleanup thread
1 parent 22fc649 commit 2ab7368

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/post/multi/manage/shell_to_meterpreter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def cleanup_handler(listener_job_id, aborted)
200200
# Return if the job has already finished
201201
return nil if framework.jobs[listener_job_id].nil?
202202

203-
Thread.new do
203+
framework.threads.spawn('ShellToMeterpreterUpgradeCleanup', false) {
204204
if !aborted
205205
timer = 0
206206
while !framework.jobs[listener_job_id].nil? && timer < 10
@@ -211,7 +211,7 @@ def cleanup_handler(listener_job_id, aborted)
211211
end
212212
print_status('Stopping multi/handler')
213213
framework.jobs.stop_job(listener_job_id)
214-
end
214+
}
215215
end
216216

217217
#

0 commit comments

Comments
 (0)