Class: Msf::Modules::External::PyBridge

Inherits:
Bridge
  • Object
show all
Defined in:
lib/msf/core/modules/external/bridge.rb

Constant Summary

Constants inherited from Bridge

Bridge::LOADERS

Instance Attribute Summary

Attributes inherited from Bridge

#buf, #cmd, #env, #exit_status, #framework, #ios, #messages, #path, #read_thread, #running, #wait_thread

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Bridge

#cleanup, #close, #exec, #harvest_process, #next_message, open, #send, #success?, #threadme, #write_message

Constructor Details

#initialize(module_path, framework: nil) ⇒ PyBridge

Returns a new instance of PyBridge.


174
175
176
177
178
# File 'lib/msf/core/modules/external/bridge.rb', line 174

def initialize(module_path, framework: nil)
  super
  pythonpath = ENV['PYTHONPATH'] || ''
  self.env = self.env.merge({ 'PYTHONPATH' => File.expand_path('../python', __FILE__) + File::PATH_SEPARATOR + pythonpath})
end

Class Method Details

.applies?(module_name) ⇒ Boolean

Returns:

  • (Boolean)

170
171
172
# File 'lib/msf/core/modules/external/bridge.rb', line 170

def self.applies?(module_name)
  module_name.match? /\.py$/
end