Skip to content
Browse files

Made some minor adjustments to 'os' key rating in core/module.rb. See…

… issue #72
  • Loading branch information...
1 parent 106e2db commit 15932efcb3489b33ef040c3e19ec6c157a13c0f9 Christian Frichot committed Feb 18, 2012
View
33 core/module.rb
@@ -208,10 +208,13 @@ def self.support(mod, opts)
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 @@ def self.support(mod, opts)
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 @@ def self.support(mod, opts)
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
View
7 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"]
View
3 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"]
View
3 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. <br/><br/>The details will include:<br/> <ul><li> - Operating system details</li><li> - Java VM details</li><li> - NIC names and IP</li><li> - Number of processors</li><li> - Amount of memory</li><li> - Screen display modes</li></ul>"
authors: ["bcoles", "antisnatchor"]
target:
+ not_working:
+ ALL:
+ os: ["iPhone"]
working: ["O", "FF", "S", "IE"]
user_notify: ["C"]
View
3 modules/host/hook_default_browser/config.yaml
@@ -22,5 +22,8 @@ beef:
description: "This module will use a PDF to attempt to hook the default browser (assuming it isn't currently hooked). <br><br>Normally, this will be IE but it will also work when Chrome is set to the default. When executed, the hooked browser will load a PDF and use that to start the default browser. If successful another browser will appear in the browser tree."
authors: ["saafan"]
target:
+ not_working:
+ ALL:
+ os: ["iPhone"]
working: ["All"]
user_notify: ["FF", "C"]
View
2 modules/host/insecure_url_skype/config.yaml
@@ -16,7 +16,7 @@
beef:
module:
insecure_url_skype:
- enable: true
+ enable: false
category: "Host"
name: "Make Skype Call (Skype)"
description: "This module will force the browser to attempt a skype call. It will exploit the insecure handling of URL schemes<br><br>The protocol handler used will be: skype."
View
7 modules/host/iphone_tel/config.yaml
@@ -22,4 +22,9 @@ beef:
description: "This module will force the browser to attempt a telephone call in iOS. It will exploit the insecure handling of URL schemes in iOS.<br><br>The protocol handler used will be: tel"
authors: ["xntrik", "Nitesh Dhanjani"]
target:
- user_notify: ['S']
+ user_notify:
+ S:
+ os: ["iPhone"]
+ not_working:
+ ALL:
+ os: ["All"]

0 comments on commit 15932ef

Please sign in to comment.
Something went wrong with that request. Please try again.