Class: Msf::Plugin::FuzzyUse

Inherits:
Msf::Plugin show all
Defined in:
plugins/fzuse.rb

Defined Under Namespace

Classes: ConsoleCommandDispatcher

Instance Attribute Summary

Attributes inherited from Msf::Plugin

#opts

Attributes included from Framework::Offspring

#framework

Instance Method Summary collapse

Methods inherited from Msf::Plugin

#add_console_dispatcher, create, #flush, #input, #output, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #remove_console_dispatcher

Constructor Details

#initialize(framework, opts) ⇒ FuzzyUse

Returns a new instance of FuzzyUse.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'plugins/fzuse.rb', line 114

def initialize(framework, opts)
  super

  unless defined?(UNIXSocket)
    # This isn't a requirement that can be fixed by installing something
    print_error("The FuzzyUse plugin has loaded but the Ruby environment does not support UNIX sockets.")
    return
  end

  missing_requirements = []
  missing_requirements << 'fzf' unless Msf::Util::Helper.which('fzf')

  unless missing_requirements.empty?
    print_error("The FuzzyUse plugin has loaded but the following requirements are missing: #{missing_requirements.join(', ')}")
    print_error("Please install the missing requirements, then reload the plugin by running: `unload fzuse` and `load fzuse`.")
    return
  end

  add_console_dispatcher(ConsoleCommandDispatcher)

  print_status('FuzzyUse plugin loaded.')
end

Instance Method Details

#cleanupObject



137
138
139
# File 'plugins/fzuse.rb', line 137

def cleanup
  remove_console_dispatcher('FuzzyUse')
end

#descObject



145
146
147
# File 'plugins/fzuse.rb', line 145

def desc
  'A plugin offering a fuzzy use command'
end

#nameObject



141
142
143
# File 'plugins/fzuse.rb', line 141

def name
  'fuzzy_use'
end