Skip to content

Instantly share code, notes, and snippets.

@erran-r7
Last active December 19, 2015 03:09
Show Gist options
  • Save erran-r7/5888058 to your computer and use it in GitHub Desktop.
Save erran-r7/5888058 to your computer and use it in GitHub Desktop.
Metasploit Exploit Metadata A hacked together script from msfcli. Drop this in your metasploit root to list metadata on exploit modules.
#!/usr/bin/env ruby
require 'json'
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'msf/base'
framework = Msf::Simple::Framework.create(:module_types => ['exploit'])
@mods = []
framework.exploits.each_module { |_name, mod|
@mods << mod.new
}
@ary = []
@mods.each do |modul|
@ary << { name: modul.name, references: modul.references, architecture: modul.arch, target_names: modul.targets.map { |target| target.name } }
end
$stdout.puts @ary.to_json
@erran-r7
Copy link
Author

Usage

cd # /path/to/metasploit-framework

wget https://gist.github.com/ecarey-r7/5888058/raw/7415a5a0f7ca68430eb26cfdd6a802255227d092/exploit_metadata
chmod +x ./exploit_metadata

./exploit_metadata > ~/metasploit_metadata
irb -r json

json = File.read(File.expand_path('~/metasploit_metadata'))
ary = JSON.parse(json)

ary.count
# => 1103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment