diff --git a/core/module.rb b/core/module.rb
index b79db349a..b8f111f76 100644
--- a/core/module.rb
+++ b/core/module.rb
@@ -208,10 +208,13 @@ module BeEF
case v
when String
if opts['browser'] == v
+ # if k == BeEF::Core::Constants::CommandModule::VERIFIED_NOT_WORKING
+ # rating += 1
+ # end
results << {'rating' => 2, 'const' => k}
end
when Hash
- if opts['browser'] == v.keys.first
+ if opts['browser'] == v.keys.first or v.keys.first == BeEF::Core::Constants::Browsers::ALL
subv = v[v.keys.first]
rating = 1
#version check
@@ -241,14 +244,15 @@ module BeEF
rating += 1
match = true
elsif subv['os'] == BeEF::Core::Constants::Os::OS_ALL_UA_STR
- rating += 1
match = true
end
when Array
subv['os'].each{|p|
- if o == p or p == BeEF::Core::Constants::Os::OS_ALL_UA_STR
+ if o == p
rating += 1
match = true
+ elsif p == BeEF::Core::Constants::Os::OS_ALL_UA_STR
+ match = true
end
}
end
@@ -257,18 +261,35 @@ module BeEF
break
end
end
- if rating != 1
+ if rating > 0
+ # if k == BeEF::Core::Constants::CommandModule::VERIFIED_NOT_WORKING
+ # rating += 1
+ # end
results << {'rating' => rating, 'const' => k}
end
end
end
if v == BeEF::Core::Constants::Browsers::ALL
- results << {'rating' => 1, 'const' => k}
+ rating = 1
+ if k == BeEF::Core::Constants::CommandModule::VERIFIED_NOT_WORKING
+ rating = 1
+ end
+ results << {'rating' => rating, 'const' => k}
end
}
}
if results.count > 0
- return results.sort_by {|v| v['rating']}.last['const']
+ result = {}
+ results.each {|r|
+ if result == {}
+ result = {'rating' => r['rating'], 'const' => r['const']}
+ else
+ if r['rating'] > result['rating']
+ result = {'rating' => r['rating'], 'const' => r['const']}
+ end
+ end
+ }
+ return result['const']
else
return BeEF::Core::Constants::CommandModule::VERIFIED_UNKNOWN
end
diff --git a/modules/host/detect_cups/config.yaml b/modules/host/detect_cups/config.yaml
index b335c7987..9b14c62f1 100644
--- a/modules/host/detect_cups/config.yaml
+++ b/modules/host/detect_cups/config.yaml
@@ -22,4 +22,9 @@ beef:
description: "This module attempts to detect Common UNIX Printing System (CUPS) on localhost on the default port 631."
authors: ["bcoles"]
target:
- working: ["ALL"]
+ working:
+ ALL:
+ os: ["Linux"]
+ not_working:
+ ALL:
+ os: ["All"]
diff --git a/modules/host/detect_google_desktop/config.yaml b/modules/host/detect_google_desktop/config.yaml
index 9f364d2e6..4a0d23f18 100644
--- a/modules/host/detect_google_desktop/config.yaml
+++ b/modules/host/detect_google_desktop/config.yaml
@@ -22,4 +22,7 @@ beef:
description: "This module attempts to detect Google Desktop running on the default port 4664."
authors: ["bcoles"]
target:
+ not_working:
+ ALL:
+ os: ["iPhone"]
working: ["ALL"]
diff --git a/modules/host/get_system_info/config.yaml b/modules/host/get_system_info/config.yaml
index 765749e17..f30448272 100644
--- a/modules/host/get_system_info/config.yaml
+++ b/modules/host/get_system_info/config.yaml
@@ -22,5 +22,8 @@ beef:
description: "This module will retrieve basic information about the host system using an unsigned Java Applet.
The details will include: