Class: Msf::Plugin::DB_Tracer::DBTracerEventHandler

Inherits:
Object
  • Object
show all
Includes:
Rex::Socket::Comm::Events
Defined in:
plugins/db_tracker.rb

Overview

This class implements a socket communication tracker

Instance Method Summary collapse

Instance Method Details

#on_before_socket_create(comm, param) ⇒ Object


25
26
# File 'plugins/db_tracker.rb', line 25

def on_before_socket_create(comm, param)
end

#on_socket_created(comm, sock, param) ⇒ Object


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'plugins/db_tracker.rb', line 28

def on_socket_created(comm, sock, param)
  # Ignore local listening sockets
  return if not sock.peerhost

  if (sock.peerhost != '0.0.0.0' and sock.peerport)

    # Ignore sockets that didn't set up their context
    # to hold the framework in 'Msf'
    return if not param.context['Msf']

    host = param.context['Msf'].db.find_or_create_host(:host => sock.peerhost, :state => Msf::HostState::Alive)
    return if not host

    param.context['Msf'].db.report_service(:host => host, :proto => param.proto, :port => sock.peerport)
  end
end