Class: Msf::Plugin::DB_Tracer

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

Overview

This class hooks all socket calls and updates the database with data gathered from the connection parameters

Defined Under Namespace

Classes: DBTracerEventHandler

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

Returns a new instance of DB_Tracer.


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'plugins/db_tracker.rb', line 46

def initialize(framework, opts)
  super

  if(not framework.db.active)
    raise PluginLoadError.new("The database backend has not been initialized")
  end
  framework.plugins.each { |plugin|
    if (plugin.class == Msf::Plugin::DB_Tracer)
      raise PluginLoadError.new("This plugin should not be loaded more than once")
    end
  }

  @eh = DBTracerEventHandler.new
  Rex::Socket::Comm::Local.register_event_handler(@eh)
end

Instance Method Details

#cleanupObject


62
63
64
# File 'plugins/db_tracker.rb', line 62

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

#descObject


70
71
72
# File 'plugins/db_tracker.rb', line 70

def desc
  "Monitors socket calls and updates the database backend"
end

#nameObject


66
67
68
# File 'plugins/db_tracker.rb', line 66

def name
  "db_tracker"
end