Method: Msf::Plugin::Msfd#initialize

Defined in:
plugins/msfd.rb

#initialize(framework, opts) ⇒ Msfd

Initializes the msfd plugin. The following options are supported in the hash by this plugin:

ServerHost

The local hostname to listen on for connections. The default is 127.0.0.1.

ServerPort

The local port to listen on for connections. The default is 55554.

SSL

Use SSL

RunInForeground

Instructs the plugin to now execute the daemon in a worker thread and to instead allow the caller to manage executing the daemon through the “run” method.

HostsAllowed

List of hosts (in NBO) allowed to use msfd

HostsDenied

List of hosts (in NBO) not allowed to use msfd


58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'plugins/msfd.rb', line 58

def initialize(framework, opts)
  super

  # Start listening for connections.
  self.server	= Rex::Socket::TcpServer.create(
    'LocalHost' => opts['ServerHost'] || DefaultHost,
    'LocalPort' => opts['ServerPort'] || DefaultPort,
    'SSL' => opts['SSL']
  )

  # If the run in foreground flag is not specified, then go ahead and fire
  # it off in a worker thread.
  if (opts['RunInForeground'] != true)
    Thread.new do
      run(opts)
    end
  end
end