:py:mod:`dissect.target.helpers.keychain` ========================================= .. py:module:: dissect.target.helpers.keychain Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.target.helpers.keychain.KeyType dissect.target.helpers.keychain.Key Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: dissect.target.helpers.keychain.register_key dissect.target.helpers.keychain.get_all_keys dissect.target.helpers.keychain.get_keys_for_provider dissect.target.helpers.keychain.get_keys_without_provider dissect.target.helpers.keychain.parse_key_type dissect.target.helpers.keychain.register_wildcard_value dissect.target.helpers.keychain.register_keychain_file Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.target.helpers.keychain.log dissect.target.helpers.keychain.KEYCHAIN .. py:data:: log .. py:class:: KeyType Bases: :py:obj:`enum.Enum` Generic enumeration. Derive from this class to define new enumerations. .. py:attribute:: RAW :value: 'raw' .. py:attribute:: PASSPHRASE :value: 'passphrase' .. py:attribute:: RECOVERY_KEY :value: 'recovery_key' .. py:attribute:: FILE :value: 'file' .. py:class:: Key Bases: :py:obj:`NamedTuple` .. py:attribute:: key_type :type: KeyType .. py:attribute:: value :type: Union[str, bytes] .. py:attribute:: provider :type: str .. py:attribute:: identifier :type: str .. py:attribute:: is_wildcard :type: bool :value: False .. py:data:: KEYCHAIN :type: list[Key] :value: [] .. py:function:: register_key(key_type: KeyType, value: str, identifier: str = None, provider: str = None, is_wildcard: bool = False) -> None .. py:function:: get_all_keys() -> list[Key] .. py:function:: get_keys_for_provider(provider: str) -> list[Key] .. py:function:: get_keys_without_provider() -> list[Key] .. py:function:: parse_key_type(key_type_name: str) -> KeyType .. py:function:: register_wildcard_value(value: str) -> None .. py:function:: register_keychain_file(keychain_path: pathlib.Path) -> None Register all keys from provided keychain file. The keychain file is a CSV file in "excel" dialect with the columns: provider,key_type,identifier,value Values in columns `key_type` and `value` are required, `provider` and `identifier` are optional. Example of the CSV-serialised data: bitlocker,recovery_key,,312268-409816-583517-486695-627121-599511-664389-145640 bitlocker,passphrase,,Password1234 ,passphrase,,AnotherTestPassword bitlocker,passphrase,b6ad258a-2725-4a42-93c6-844478bf7a90,Password1234 bitlocker,passphrase,,"Password with comma, space and quotes ' and "" inside"