diff --git a/modules/exploits/windows/local/bypassuac.rb b/modules/exploits/windows/local/bypassuac.rb index b56b032c19..a91b2fefd7 100644 --- a/modules/exploits/windows/local/bypassuac.rb +++ b/modules/exploits/windows/local/bypassuac.rb @@ -56,14 +56,8 @@ class Metasploit3 < Msf::Exploit::Local # vuln = false winver = sysinfo["OS"] - affected = [ 'Windows Vista', 'Windows 7', 'Windows 2008', 'Windows 8' ] - affected.each { |v| - if winver.include? v - vuln = true - end - } - if not vuln - print_error("#{winver} does not have UAC") + if winver !~ /Windows Vista|Windows 2008|Windows [78]/ + print_error("#{winver} is not vulnerable.") return end diff --git a/modules/post/windows/escalate/bypassuac.rb b/modules/post/windows/escalate/bypassuac.rb index 921a1cfa61..8e53abeced 100644 --- a/modules/post/windows/escalate/bypassuac.rb +++ b/modules/post/windows/escalate/bypassuac.rb @@ -43,13 +43,7 @@ class Metasploit3 < Msf::Post vuln = false sysinfo = session.sys.config.sysinfo winver = sysinfo["OS"] - affected = [ 'Windows Vista', 'Windows 7', 'Windows 2008', 'Windows 8' ] - affected.each { |v| - if winver.include? v - vuln = true - end - } - if not vuln + if winver !~ /Windows Vista|Windows 2008|Windows [78]/ print_error("#{winver} is not vulnerable.") return end