Skip to content

Instantly share code, notes, and snippets.

View erran-r7's full-sized avatar
:shipit:

Erran Carey erran-r7

:shipit:
View GitHub Profile
@erran-r7
erran-r7 / exploit_metadata
Last active December 19, 2015 03:09
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 = []
# NOTE: Grepping through ~/.vagrant.d/gems/specifications/ for installed versions isn't the way to do this
# TODO: Add Bundler/Berkshelf-like version management
# TODO: Try to use the Ruby equivalent (located in Vagrant's PluginCommand class) w/out OptParser
def plugin(name, version = nil, opts = {})
puts "Inside of the plugin method: name: #{name}, version: #{version}, opts: #{opts}"
@vagrant_home ||= opts[:home_path] || ENV['VAGRANT_HOME'] || "#{ENV['HOME']}/.vagrant.d"
plugins = JSON.parse(File.read("#@vagrant_home/plugins.json"))
if !plugins['installed'].include?(name) || (version && !version_matches(name, version))
cmd = "vagrant plugin install"