module_payloads.rb 795 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env ruby
  2. ##
  3. # This module requires Metasploit: https://metasploit.com/download
  4. # Current source: https://github.com/rapid7/metasploit-framework
  5. ##
  6. #
  7. # This script lists each exploit module by its compatible payloads
  8. #
  9. msfbase = __FILE__
  10. while File.symlink?(msfbase)
  11. msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
  12. end
  13. $:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', '..', 'lib')))
  14. require 'msfenv'
  15. $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
  16. require 'rex'
  17. # Initialize the simplified framework instance.
  18. $framework = Msf::Simple::Framework.create('DisableDatabase' => true)
  19. $framework.exploits.each_module { |name, mod|
  20. x = mod.new
  21. x.compatible_payloads.map{|n, m|
  22. puts "#{x.refname.ljust 40} - #{n}"
  23. }
  24. }