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-1.3.8 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.3.7 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.3.6 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.3.5 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.3.4 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.3.3 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.3.2 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.3.1 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.3.0 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.2.2 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.2.1 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.2.0 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.1.2 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.1.1 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.1.0 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.0.2 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.0.1 lib/patronus_fati/message_processor/capability.rb
patronus_fati-1.0.0 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.9.32 lib/patronus_fati/message_processor/capability.rb
patronus_fati-0.9.31 lib/patronus_fati/message_processor/capability.rb