Sha256: b3fcd8e16dfb619dd766a44760e243d1d59fa686a8d0dfd58edf4f51a5b9b7f9

Contents?: true

Size: 1.04 KB

Versions: 65

Compression:

Stored size: 1.04 KB

Contents

module PatronusFati::MessageProcessor::Capability
  include PatronusFati::MessageProcessor

  def self.process(obj)
    # The capability detection for the capability command is broken. It
    # returns the name of the command followed by the capabilities but the
    # result of a request ignores that it also sends back the name of the
    # command. We don't want to mess up our parsing so we work around it by
    # ignoring these messages.
    return if obj.name == 'CAPABILITY'
    return unless PatronusFati::MessageModels.const_defined?(obj.name.downcase.capitalize)

    target_cap = PatronusFati::MessageModels.const_get(obj.name.downcase.capitalize)
    target_cap.supported_keys = obj.capabilities.split(',').map(&:to_sym)

    keys_to_enable = target_cap.enabled_keys.map(&:to_s).join(',')

    # Limit the amount of data kismet gives us to only the interesting stuff
    return unless %w(ERROR PROTOCOLS ALERT BSSID SSID CLIENT CRITFAIL).include?(obj.name)

    # Return the response to the server
    "ENABLE #{obj.name} #{keys_to_enable}"
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
patronus_fati-0.9.5 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.9.4 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.9.3 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.9.2 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.9.1 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.9.0 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.18 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.17 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.16 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.15 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.14 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.13 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.12 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.11 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.10 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.9 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.8 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.7 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.6 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.8.5 lib/patronus_fati/message_processor/capability.rb