Land #11050, Add protection checks to Msf::Post::Linux::Kernel lib
parent
dc7954c829
commit
67155d33cf
|
@ -123,6 +123,18 @@ module Kernel
|
||||||
raise 'Could not determine ASLR status'
|
raise 'Could not determine ASLR status'
|
||||||
end
|
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
|
# Returns true if unprivileged bpf is disabled
|
||||||
#
|
#
|
||||||
|
@ -169,6 +181,24 @@ module Kernel
|
||||||
raise 'Could not determine system mmap_min_addr'
|
raise 'Could not determine system mmap_min_addr'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# Returns true if grsecurity is installed
|
||||||
|
#
|
||||||
|
def grsec_installed?
|
||||||
|
cmd_exec('test -c /dev/grsec && echo true').to_s.strip.include? 'true'
|
||||||
|
rescue
|
||||||
|
raise 'Could not determine grsecurity status'
|
||||||
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# Returns true if PaX is installed
|
||||||
|
#
|
||||||
|
def pax_installed?
|
||||||
|
cmd_exec('test -x /sbin/paxctl && echo true').to_s.strip.include? 'true'
|
||||||
|
rescue
|
||||||
|
raise 'Could not determine PaX status'
|
||||||
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns true if SELinux is installed
|
# Returns true if SELinux is installed
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue