kitty.data.data_manager module¶
This module is usde to store the fuzzing session related data. It provides both means of communications between the fuzzer and the user interface, and persistent storage of the fuzzing session results.
-
class
kitty.data.data_manager.
DataManager
(dbname)[source]¶ Bases:
threading.Thread
Manages data on a dedicated thread. All calls to it should be done by submitting DataManagerTask
Example: dataman = DataManager('fuzz_session.sqlite`) dataman.start() def get_session_info(manager): return manager.get_session_info_manager().get_session_info() get_info_task = DataManagerTask(get_session_info) dataman.submit_task(get_info_task) session_info = get_info_task.get_results()
-
submit_task
(task)[source]¶ submit a task to the data manager, to be proccessed in the DataManager context
Parameters: task ( DataManagerTask
) – task to perform
-
-
class
kitty.data.data_manager.
DataManagerTask
(task, *args)[source]¶ Bases:
object
Task to be performed in the
DataManager
context-
__init__
(task, *args)[source]¶ Parameters: task (function( DataManager
) -> object) – task to be performed
-
execute
(dataman)[source]¶ run the task
Parameters: dataman ( DataManager
) – the executing data manager
-
-
class
kitty.data.data_manager.
ReportsTable
(connection, cursor)[source]¶ Bases:
kitty.data.data_manager.Table
Table for storing the reports
-
class
kitty.data.data_manager.
SessionInfo
(orig=None)[source]¶ Bases:
object
session information manager
-
copy
(orig)[source]¶ Parameters: orig – SessionInfo object to copy Returns: True if changed, false otherwise
-
fields
= ['start_time', 'start_index', 'end_index', 'current_index', 'failure_count', 'kitty_version', 'data_model_hash', 'test_list_str']¶
-
classmethod
from_dict
(info_d)[source]¶ Parameters: info_d – the info dictionary Return type: SessionInfo
Returns: object that corresponds to the info dictionary
-
i
= ('test_list_str', 'BLOB')¶
-
-
class
kitty.data.data_manager.
SessionInfoTable
(connection, cursor)[source]¶ Bases:
kitty.data.data_manager.Table
Table for storing the session info
-
__init__
(connection, cursor)[source]¶ Parameters: - connection – the database connection
- cursor – the cursor for the database
-
get_session_info
()[source]¶ Return type: SessionInfo
Returns: current session info
-
read_info
()[source]¶ Return type: SessionInfo
Returns: current session info
-
set_session_info
(info)[source]¶ Parameters: info ( SessionInfo
) – info to set
-
-
class
kitty.data.data_manager.
Table
(connection, cursor)[source]¶ Bases:
object
Base class for data manager tables
-
__init__
(connection, cursor)[source]¶ Parameters: - connection – the database connection
- cursor – the cursor for the database
-
insert
(fields, values)[source]¶ insert new db entry
Parameters: - fields – list of fields to insert
- values – list of values to insert
Returns: row id of the new row
-
row_to_dict
(row)[source]¶ translate a row of the current table to dictionary
Parameters: row – a row of the current table (selected with *) Returns: dictionary of all fields
-