Packets

class kismetdb.Packets(file_location)

This object covers packets stored in the Kismet DB.

The actual packet is stored in the packet field of the dictionary returned for every row. This can be a very expensive abstraction to use if you don’t employ some sort of filtering on your query. Consider using the Packets.get_meta() method to retrieve only the metadata (not the actual packet capture), which will preserve performance. The Keyword Arguments section below applies only to methods which support them (as noted below), not to object instantiation.

Parameters:

file_location (str) – Path to Kismet log file.

Keyword Arguments:
 
  • ts_sec_lt (str, datetime.datetime) – Match packets where the timestamp is before this.
  • ts_sec_gt (str, datetime.datetime) – Match packets where the timestamp is after this.
  • phyname (str or list) – Exact match against PHY name.
  • sourcemac (str or list) – Exact match against source MAC address.
  • destmac (str or list) – Exact match against destination MAC address.
  • transmac (str or list) – Exact match against trans mac.
  • devkey (str or list) – Exact match against devkey.
  • datasource (str or list) – Exact match against datasource.
  • min_signal (str or int) – Minimum signal.
  • dlt_gt (str or int) – Minimum DLT.
get_all(**kwargs)

Get all objects represented by this class from Kismet DB.

Keyword arguments are described above, near the beginning of the class documentation.

Returns:List of each json object from all rows returned from query.
Return type:list
get_meta(**kwargs)

Get metadata columns from DB, excluding bulk data columns.

Keyword arguments are described above, near the beginning of the class documentation.

Returns:List of each json object from all rows returned from query.
Return type:list
yield_all(**kwargs)

Get all objects represented by this class from Kismet DB.

Yields one row at a time. Keyword arguments are described above, near the beginning of the class documentation.

Yields:dict – Dict representing one row from query.
yield_meta(**kwargs)

Yield metadata from DB, excluding bulk data columns.

Yields one row at a time. Keyword arguments are described above, near the beginning of the class documentation.

Returns:Dict representing one row from query.
Return type:dict