check file exists before reading
parent
e8eeb784e4
commit
8a49a639a0
|
@ -38,6 +38,7 @@ class MetasploitModule < Msf::Post
|
||||||
])
|
])
|
||||||
|
|
||||||
# parse each line from /etc/fstab
|
# 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|
|
read_file("/etc/fstab").each_line do |fstab_line|
|
||||||
fstab_line.strip!
|
fstab_line.strip!
|
||||||
# where we'll store the current parsed credentials, if any
|
# where we'll store the current parsed credentials, if any
|
||||||
|
|
Loading…
Reference in New Issue