Module: Rex::Post::SessionCompatibleModules

Included in:
LDAP::Ui::Console, Rex::Post::SMB::Ui::Console, Rex::Post::Sql::Ui::Console
Defined in:
lib/rex/post/session_compatible_modules.rb

Overview

This module provides a list of modules that are compatible with the current session

Instance Method Summary collapse

Instance Method Details

#format_session_compatible_modulesString

Returns:

  • (String)


20
21
22
23
24
25
26
27
# File 'lib/rex/post/session_compatible_modules.rb', line 20

def format_session_compatible_modules
  <<~EOF
    This session also works with the following modules:

      #{session_compatible_modules.flat_map(&:fullname).join("\n  ")}

  EOF
end

#session_compatible_modulesArray<String>

Returns:

  • (Array<String>)


13
14
15
16
17
# File 'lib/rex/post/session_compatible_modules.rb', line 13

def session_compatible_modules
  # Use the built in search command functionality to get a list of search results
  search_params = { 'session_type' => [[self.session.type], []] }
  Msf::Modules::Metadata::Cache.instance.find(search_params)
end