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



19
# File 'plugins/db_tracker.rb', line 19

def on_before_socket_create(comm, param); end

#on_socket_created(_comm, sock, param) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'plugins/db_tracker.rb', line 21

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

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

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

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

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