Sha256: 2ac565aa64e1946c4b657917366ba2e4db96094838c4c39f81b99379bd3274f6
Contents?: true
Size: 1.3 KB
Versions: 8
Compression:
Stored size: 1.3 KB
Contents
module PatronusFati::MessageProcessor::Bssid include PatronusFati::MessageProcessor def self.process(obj) # We don't care about objects that would have expired already... return if obj[:lasttime] < (Time.now.to_i - PatronusFati::AP_EXPIRATION) # Ignore probe requests as their BSSID information is useless (the ESSID # isn't present and it's coming from a client). return unless %w(infrastructure adhoc).include?(obj.type.to_s) ap_info = ap_data(obj.attributes) access_point = PatronusFati::DataModels::AccessPoint.first_or_create({bssid: obj.bssid}, ap_info) access_point.update(ap_info) access_point.record_signal(obj.signal_dbm) access_point.update_frequencies(obj.freqmhz) nil end protected def self.ap_data(attrs) { bssid: attrs[:bssid], type: attrs[:type], channel: attrs[:channel], crypt_packets: attrs[:cryptpackets], data_packets: attrs[:datapackets], data_size: attrs[:datasize], fragments: attrs[:fragments], retries: attrs[:retries], max_seen_rate: attrs[:maxseenrate], duplicate_iv_pkts: attrs[:dupeivpackets], range_ip: attrs[:rangeip], netmask: attrs[:netmaskip], gateway_ip: attrs[:gatewayip], last_seen_at: Time.now.to_i }.reject { |_, v| v.nil? } end end
Version data entries
8 entries across 8 versions & 1 rubygems