Mirror of metasploit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

browser_autopwn.rb 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # -*- coding: binary -*-
  2. #
  3. # This file is part of the Metasploit Framework and may be subject to
  4. # redistribution and commercial restrictions. Please see the Metasploit
  5. # Framework web site for more information on licensing and terms of use.
  6. # http://metasploit.com/framework/
  7. require 'msf/core/auxiliary'
  8. module Msf
  9. module Exploit::Remote::BrowserAutopwn
  10. include Msf::Auxiliary::Report
  11. # this is the magic
  12. def self.included(base)
  13. base.extend(AutopwnClassMethods)
  14. end
  15. module AutopwnClassMethods
  16. def self.extended(base)
  17. if base.const_defined? "Rank"
  18. @@autopwn_rank = base.const_get("Rank")
  19. else
  20. @@autopwn_rank = RankingName.invert['manual']
  21. end
  22. end
  23. def autopwn_opts
  24. @autopwn_opts.dup
  25. end
  26. def autopwn_info(opts={})
  27. # prefix_html and postfix_html are only used for noscript exploits
  28. # vuln_test is only used for javascript exploits
  29. @autopwn_opts = {}
  30. @autopwn_opts[:ua_name] = opts[:ua_name] || nil
  31. @autopwn_opts[:ua_minver] = opts[:ua_minver] || opts[:ua_minversion] || nil
  32. @autopwn_opts[:ua_maxver] = opts[:ua_maxver] || opts[:ua_maxversion] || nil
  33. @autopwn_opts[:ua_ver] = opts[:ua_ver] || opts[:ua_version] || nil
  34. @autopwn_opts[:classid] = opts[:classid] || opts[:clsid] || nil
  35. @autopwn_opts[:method] = opts[:method] || opts[:method] || nil
  36. @autopwn_opts[:javascript] = (opts[:javascript].nil?) ? true : opts[:javascript]
  37. @autopwn_opts[:os_name] = opts[:os_name] || nil
  38. @autopwn_opts[:os_ver] = opts[:os_ver] || opts[:os_version] || nil
  39. @autopwn_opts[:postfix_html] = opts[:postfix_html] || nil
  40. @autopwn_opts[:prefix_html] = opts[:prefix_html] || nil
  41. @autopwn_opts[:vuln_test] = opts[:vuln_test] || opts[:vulntest] || ""
  42. @autopwn_opts[:rank] = opts[:rank] || @@autopwn_rank
  43. end
  44. end
  45. end
  46. end