check file exists before reading

bug/bundler_fix
h00die 2017-09-29 22:34:38 -04:00
parent e8eeb784e4
commit 8a49a639a0
1 changed files with 1 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class MetasploitModule < Msf::Post
])
# parse each line from /etc/fstab
fail_with(Failure::NotFound, '/etc/fstab not found on system') unless file_exist?('/etc/fstab')
read_file("/etc/fstab").each_line do |fstab_line|
fstab_line.strip!
# where we'll store the current parsed credentials, if any