diff --git a/modules/exploits/multi/http/jboss_bshdeployer.rb b/modules/exploits/multi/http/jboss_bshdeployer.rb index 39b1879dff..460f5121ad 100644 --- a/modules/exploits/multi/http/jboss_bshdeployer.rb +++ b/modules/exploits/multi/http/jboss_bshdeployer.rb @@ -100,6 +100,8 @@ class Metasploit3 < Msf::Exploit::Remote def exploit + @previous_basic_auth_user = datastore['BasicAuthUser'] + @previous_basic_auth_pass = datastore['BasicAuthPass'] datastore['BasicAuthUser'] = datastore['USERNAME'] datastore['BasicAuthPass'] = datastore['PASSWORD'] @@ -344,4 +346,9 @@ EOT end res end + + def cleanup + datastore['BasicAuthUser'] = @previous_basic_auth_user + datastore['BasicAuthPass'] = @previous_basic_auth_pass + end end diff --git a/modules/exploits/multi/http/jboss_deploymentfilerepository.rb b/modules/exploits/multi/http/jboss_deploymentfilerepository.rb index 7faa88ce60..28fb69c5ef 100644 --- a/modules/exploits/multi/http/jboss_deploymentfilerepository.rb +++ b/modules/exploits/multi/http/jboss_deploymentfilerepository.rb @@ -69,7 +69,6 @@ class Metasploit3 < Msf::Exploit::Remote p = payload if datastore['SHELL'] == 'automatic' - @original_shell_value = datastore['SHELL'] if not (plat = detect_platform()) fail_with(Exploit::Failure::NoTarget, 'Unable to detect platform!') end @@ -228,8 +227,4 @@ class Metasploit3 < Msf::Exploit::Remote end nil end - - def cleanup - datastore['SHELL'] = @original_shell_value unless @original_shell_value.nil? - end end