Class: Msf::Plugin::SocketLogger

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

Overview

This class hooks all sockets created by a running exploit

Defined Under Namespace

Classes: MySocketEventHandler

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) ⇒ SocketLogger

Returns a new instance of SocketLogger.



36
37
38
39
40
41
42
43
# File 'plugins/socket_logger.rb', line 36

def initialize(framework, opts)
  log_path = opts['path'] || Msf::Config.log_directory
  log_prefix = opts['prefix'] || 'socket_'

  super
  @eh = MySocketEventHandler.new(log_path, log_prefix)
  Rex::Socket::Comm::Local.register_event_handler(@eh)
end

Instance Method Details

#cleanupObject



45
46
47
# File 'plugins/socket_logger.rb', line 45

def cleanup
  Rex::Socket::Comm::Local.deregister_event_handler(@eh)
end

#descObject



53
54
55
# File 'plugins/socket_logger.rb', line 53

def desc
  'Log socket operations to a directory as individual files'
end

#nameObject



49
50
51
# File 'plugins/socket_logger.rb', line 49

def name
  'socket_logger'
end