diff --git a/lib/msf/core/post/linux/kernel.rb b/lib/msf/core/post/linux/kernel.rb index 7dde02d5d0..4c0b82eca6 100644 --- a/lib/msf/core/post/linux/kernel.rb +++ b/lib/msf/core/post/linux/kernel.rb @@ -123,6 +123,18 @@ module Kernel raise 'Could not determine ASLR status' end + # + # Returns true if Exec-Shield is enabled + # + # @return [Boolean] + # + def exec_shield_enabled? + exec_shield = cmd_exec('cat /proc/sys/kernel/exec-shield').to_s.strip + (exec_shield.eql?('1') || exec_shield.eql?('2')) + rescue + raise 'Could not determine exec-shield status' + end + # # Returns true if unprivileged bpf is disabled #