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.


44
45
46
47
48
49
50
51
# File 'plugins/socket_logger.rb', line 44

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


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

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

#descObject


61
62
63
# File 'plugins/socket_logger.rb', line 61

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

#nameObject


57
58
59
# File 'plugins/socket_logger.rb', line 57

def name
  "socket_logger"
end