Class: BetterCap::Parsers::MySQL

Inherits:
Base
  • Object
show all
Defined in:
lib/bettercap/sniffer/parsers/mysql.rb

Overview

MySQL authentication parser.

Instance Method Summary collapse

Methods inherited from Base

available, from_cmdline, from_exclusion_list, inherited, #initialize, load_by_names, load_custom, #match_port?

Constructor Details

This class inherits a constructor from BetterCap::Parsers::Base

Instance Method Details

#on_packet(pkt) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/bettercap/sniffer/parsers/mysql.rb', line 18

def on_packet( pkt )
  packet = Network::Protos::MySQL::Packet.parse( pkt.payload )
  unless packet.nil? or !packet.is_auth?
    StreamLogger.log_raw( pkt, 'MYSQL', "#{'username'.blue}='#{packet.username.yellow}' "\
                                        "#{'password'.blue}='#{packet.password.map { |x| sprintf("%02X", x )}.join.yellow}'" )
  end
end