Skip to content

Commit 23db148

Browse files
committed
Add check for nosuid
1 parent af462f7 commit 23db148

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/exploits/linux/local/runc_cwd_priv_esc.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ def exploit
169169
fail_with(Failure::BadConfig, "#{base_dir} is not writable")
170170
end
171171

172+
# Make sure we can execute our payload as root
173+
if nosuid?(base_dir)
174+
fail_with(Failure::BadConfig, "#{base_dir} is mounted nosuid")
175+
end
176+
172177
# create directory to write all our files to
173178
dir = "#{base_dir}/.#{rand_text_alphanumeric(5..10)}"
174179
mkdir(dir)

0 commit comments

Comments
 (0)