From 6040f779c51ef5baf598963e1697af0d621ce901 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Wed, 5 Dec 2018 00:35:32 +0000 Subject: [PATCH] Supress 'Permission denied' error in get_suid_files --- lib/msf/core/post/linux/system.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/msf/core/post/linux/system.rb b/lib/msf/core/post/linux/system.rb index bc22e180b3..098ac407d2 100644 --- a/lib/msf/core/post/linux/system.rb +++ b/lib/msf/core/post/linux/system.rb @@ -132,7 +132,8 @@ module System # @param findpath The path on the system to start searching # @return [Array] def get_suid_files(findpath = '/') - cmd_exec("find #{findpath} -perm -4000 -print -xdev").to_s.split("\n") + out = cmd_exec("find #{findpath} -perm -4000 -print -xdev").to_s.split("\n") + out.delete_if {|i| i.include? 'Permission denied'} rescue raise "Could not retrieve all SUID files" end