datastore cleanup according to sinn3r

unstable
jvazquez-r7 2012-07-12 09:29:14 +02:00
parent 65d15df9f9
commit 6c8ee443c8
2 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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