Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/tools/modules/module_description.rb
Views: 11766
#!/usr/bin/env ruby12##3# This module requires Metasploit: https://metasploit.com/download4# Current source: https://github.com/rapid7/metasploit-framework5##67#8# This script lists each module with its description9#1011msfbase = __FILE__12while File.symlink?(msfbase)13msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))14end1516$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', '..', 'lib')))17require 'msfenv'1819$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']2021require 'rex'2223sort = 024filter= 'All'25filters = ['all','exploit','payload','post','nop','encoder','auxiliary']2627opts = Rex::Parser::Arguments.new(28"-h" => [ false, "Help menu." ],29"-f" => [ true, "Filter based on Module Type [#{filters.map{|f|f.capitalize}.join(", ")}] (Default = All)."],30)3132opts.parse(ARGV) { |opt, idx, val|33case opt34when "-h"35puts "\nMetasploit Script for Displaying Module Descriptions."36puts "=========================================================="37puts opts.usage38exit39when "-f"40unless filters.include?(val.downcase)41puts "Invalid Filter Supplied: #{val}"42puts "Please use one of these: #{filters.map{|f|f.capitalize}.join(", ")}"43exit44end45puts "Module Filter: #{val}"46filter = val4748end4950}515253Indent = ' '5455# Always disable the database (we never need it just to list module56# information).57framework_opts = { 'DisableDatabase' => true }5859# If the user only wants a particular module type, no need to load the others60if filter.downcase != 'all'61framework_opts[:module_types] = [ filter.downcase ]62end6364# Initialize the simplified framework instance.65$framework = Msf::Simple::Framework.create(framework_opts)666768tbl = Rex::Text::Table.new(69'Header' => 'Module Descriptions',70'Indent' => Indent.length,71'Columns' => [ 'Module', 'Description' ]72)7374$framework.modules.each { |name, mod|75x = mod.new76tbl << [ x.fullname, x.description ]77}7879if sort == 180tbl.sort_rows(1)81end8283puts tbl.to_s848586