From e53de896e780af5b7305989a6c4aae5b6745030a Mon Sep 17 00:00:00 2001 From: h00die Date: Sun, 22 Apr 2018 08:32:52 -0400 Subject: [PATCH] add arch check --- modules/exploits/linux/local/ufo_privilege_escalation.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/exploits/linux/local/ufo_privilege_escalation.rb b/modules/exploits/linux/local/ufo_privilege_escalation.rb index aa496aa0d9..85f03f3a0f 100644 --- a/modules/exploits/linux/local/ufo_privilege_escalation.rb +++ b/modules/exploits/linux/local/ufo_privilege_escalation.rb @@ -137,6 +137,13 @@ class MetasploitModule < Msf::Exploit::Local end vprint_good 'smap not present' + arch = kernel_hardware + unless arch.include? 'x86_64' + vprint_error "System architecture #{arch} is not supported" + return CheckCode::Safe + end + vprint_good "System architecture #{arch} is supported" + distro = cmd_exec('grep DISTRIB_CODENAME /etc/lsb-release').split('=')[1].to_s.downcase unless kernels.include? "\"#{distro}\", \"#{kernel_release}\"" vprint_error "Kernel #{kernel_release} on #{distro} not supported"