Skip to content

Instantly share code, notes, and snippets.

@limhoff-r7
Created July 17, 2014 14:22
Show Gist options
  • Save limhoff-r7/e3fa8925c09da426838d to your computer and use it in GitHub Desktop.
Save limhoff-r7/e3fa8925c09da426838d to your computer and use it in GitHub Desktop.
Getting help text for search operators
en:
metasploit:
model:
# help for an operator on a specific class/module (Metasploit::Model::Architecture) with a given name (abbreviation)
ancestors:
metasploit/model/architecture:
search:
operator:
names:
abbreviation:
help: "Abbreviation for architecture, such as x86, etc."
# help for a specific operator class/module (Metasploit::Model::Search::Operator::Deprecated::Authority)
search:
operator:
ancestors:
metasploit/model/search/operator/deprecated/authority:
help: "Modules with reference from the %{name} authority. Maps to `authorities.abbreviation:%{name} references.designation:<value>`."
operator = Mdm::Module::Instance.search_operator_by_name[name]
operator.help
# Any class can be used, but the help in config/en.yml is specifically for Mdm::Module::Instance.
operators = Mdm::Module::Instance.search_operator_by_name.values
operators.each do |operator|
puts " #{operator.name}"
puts " #{operator.help}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment