Skip to content

Commit

Permalink
Add check for nosuid
Browse files Browse the repository at this point in the history
  • Loading branch information
jheysel-r7 committed Jan 9, 2025
1 parent af462f7 commit 23db148
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/exploits/linux/local/runc_cwd_priv_esc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ def exploit
fail_with(Failure::BadConfig, "#{base_dir} is not writable")
end

# Make sure we can execute our payload as root
if nosuid?(base_dir)
fail_with(Failure::BadConfig, "#{base_dir} is mounted nosuid")
end

# create directory to write all our files to
dir = "#{base_dir}/.#{rand_text_alphanumeric(5..10)}"
mkdir(dir)
Expand Down

0 comments on commit 23db148

Please sign in to comment.