Class: Msf::Plugin::PayloadsManager::PayloadsManagerCommandDispatcher

Inherits:
Object
  • Object
show all
Includes:
Ui::Console::CommandDispatcher
Defined in:
plugins/payloads_manager.rb

Constant Summary collapse

PAYLOADS_DIR =
File.join(Msf::Config.config_directory, 'payloads')
DATABASE_FILE =
File.join(PAYLOADS_DIR, 'payloads.json')
MSF_METERPRETER_DIR =
File.join(Msf::Config.data_directory, 'meterpreter')
MAX_FETCH_SIZE =
100 * 1024 * 1024

Instance Attribute Summary

Attributes included from Ui::Console::CommandDispatcher

#driver

Attributes included from Rex::Ui::Text::DispatcherShell::CommandDispatcher

#shell, #tab_complete_items

Instance Method Summary collapse

Methods included from Ui::Console::CommandDispatcher

#active_module, #active_module=, #active_session, #active_session=, #build_range_array, #docs_dir, #framework, #load_config, #log_error, #remove_lines

Methods included from Rex::Ui::Text::DispatcherShell::CommandDispatcher

#cmd_help, #cmd_help_help, #cmd_help_tabs, #deprecated_cmd, #deprecated_commands, #deprecated_help, #docs_dir, #help_to_s, included, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #tab_complete_directory, #tab_complete_filenames, #tab_complete_generic, #tab_complete_source_address, #unknown_command, #update_prompt

Constructor Details

#initialize(driver) ⇒ PayloadsManagerCommandDispatcher

Returns a new instance of PayloadsManagerCommandDispatcher.



37
38
39
40
41
42
# File 'plugins/payloads_manager.rb', line 37

def initialize(driver)
  super
  @driver = driver
  setup_directories
  load_database
end

Instance Method Details

#cmd_payloads_manager(*args) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'plugins/payloads_manager.rb', line 54

def cmd_payloads_manager(*args)
  subcommand = args.shift

  case subcommand
  when 'list'
    handle_list
  when 'add'
    handle_add(*args)
  when 'fetch'
    handle_fetch(*args)
  when 'select'
    handle_select(*args)
  when 'unselect'
    handle_unselect(*args)
  when 'remove'
    handle_remove(*args)
  when 'help', nil
    handle_help
  else
    print_error("Unknown subcommand: #{subcommand}")
    handle_help
  end
end

#commandsObject



48
49
50
51
52
# File 'plugins/payloads_manager.rb', line 48

def commands
  {
    'payloads_manager' => 'Manage payloads: list | add <path> [name] | fetch <url> [name] | select <id> | unselect <id> | remove <id> | help'
  }
end

#nameObject



44
45
46
# File 'plugins/payloads_manager.rb', line 44

def name
  "PayloadsManager"
end