From 8626b1b275497bae7a3f2ec898d6d1c4dd65d2c1 Mon Sep 17 00:00:00 2001 From: Atila Romero Date: Tue, 6 Oct 2015 11:01:30 -0300 Subject: [PATCH] Fix "ALL" comparison for browser and os The correct is to check if the *rule.browser* has the tag "ALL", not if the browser was identified as "ALL", which of course never happen. Before this fix, using "ALL" in a ARE rule makes it be never called. --- core/main/autorun_engine/engine.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/main/autorun_engine/engine.rb b/core/main/autorun_engine/engine.rb index e36ec26b3..1dd2ac8d7 100644 --- a/core/main/autorun_engine/engine.rb +++ b/core/main/autorun_engine/engine.rb @@ -403,8 +403,8 @@ module BeEF # os_ver without checks as it can be very different or even empty, for instance on linux/bsd) # check if the browser and OS types do match - next unless browser == 'ALL' || browser == rule.browser - next unless os == 'ALL' || os == rule.os + next unless rule.browser == 'ALL' || browser == rule.browser + next unless rule.os == 'ALL' || os == rule.os # check if the browser version match browser_version_match = compare_versions(browser_version.to_s, b_ver_cond, b_ver.to_s)