Devices

class kismet_rest.Devices(host_uri='http://127.0.0.1:2501', sessioncache_path='~/.pykismet_session', **kwargs)[source]

Devices abstraction.

all(callback=None, callback_args=None, **kwargs)[source]

Yield all devices, one at a time.

If callback is set, nothing will be returned.

Parameters:
  • callback – Callback function.
  • callback_args – Arguments for callback.
Keyword Arguments:
 

ts (int) – Starting last-seen timestamp in seconds since Epoch.

Yields:

dict – Device json, or None if callback is set.

by_key(device_key, field=None, fields=None)[source]

Return a dictionary representing one device, identified by key.

Fetch a complete device record by the Kismet key (unique key per Kismet session) or fetch a specific sub-field by path.

Returns:Dictionary object describing one device.
Return type:dict
by_mac(callback=None, callback_args=None, **kwargs)[source]

Yield devices matching provided MAC addresses or masked MAC groups.

Parameters:
  • callback – Callback function.
  • callback_args – Arguments for callback.
Keyword Arguments:
 
  • devices (list) – List of device MACs or MAC masks.
  • fields (list) – List of fields to return.
Yields:

dict – Device json, or None if callback is set.

dot11_access_points(callback=None, callback_args=None, **kwargs)[source]

Return a list of dot11 access points.

List devices which are considered to be 802.11 access points, using the /devices/views/phydot11_accesspoints/ view

Returned devices can be summarized/simplified by the fields list.

If a timestamp is given, only devices modified more recently than the timestamp (and matching any other conditions) will be returned.

If a regex is given, only devices matching the regex (and any other conditions) will be returned.

If a callback is given, it will be called for each device in the result. If no callback is provided, the results will be yielded as dictionary objects.

Parameters:
  • callback (obj) – Callback for processing individual results.
  • cbargs (list) – List of arguments for callback.
Keyword Arguments:
 
  • last_time (int) – Unix epoch timestamp
  • regex (str) – Regular expression for filtering results.
  • fields (list) – Fields for filtering.
Yields:

dict

Dictionary-type objects which describe access points.

Keys describing access points: dot11.device, kismet.device.base.basic_crypt_set, kismet.device.base.basic_type_set, kismet.device.base.channel, kismet.device.base.commonname, kismet.device.base.crypt, kismet.device.base.datasize, kismet.device.base.datasize.rrd, kismet.device.base.first_time, kismet.device.base.freq_khz_map, kismet.device.base.frequency, kismet.device.base.key, kismet.device.base.last_time, kismet.device.base.macaddr, kismet.device.base.manuf, kismet.device.base.mod_time, kismet.device.base.name, kismet.device.base.num_alerts, kismet.device.base.packet.bin.250, kismet.device.base.packet.bin.500, kismet.device.base.packets.crypt, kismet.device.base.packets.data, kismet.device.base.packets.error, kismet.device.base.packets.filtered, kismet.device.base.packets.llc, kismet.device.base.packets.rrd, kismet.device.base.packets.rx, kismet.device.base.packets.total, kismet.device.base.packets.tx, kismet.device.base.phyname, kismet.device.base.seenby, kismet.device.base.server_uuid, kismet.device.base.signal, kismet.device.base.tags, kismet.device.base.type.

dot11_clients_of(ap_id, callback=None, callback_args=None, **kwargs)[source]

List clients of an 802.11 AP.

List devices which are clients of a given 802.11 access point, using the /phy/phy80211/clients-of endpoint.

Returned devices can be summarized/simplified by the fields list.

If a callback is given, it will be called for each device in the result. If no callback is provided, the results will be yielded.

Parameters:
  • ap_id (str) – ID of AP to return clients for.
  • callback – Callback function.
  • callback_args – Arguments for callback.
Yields:

dict – Dictionary describing a client of the identified AP.