:py:mod:`dissect.target.filesystems.cb` ======================================= .. py:module:: dissect.target.filesystems.cb Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.target.filesystems.cb.OS dissect.target.filesystems.cb.CbFilesystem dissect.target.filesystems.cb.CbDirEntry dissect.target.filesystems.cb.CbFilesystemEntry Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.target.filesystems.cb.HAS_CARBON_BLACK dissect.target.filesystems.cb.CB_TIMEFORMAT .. py:data:: HAS_CARBON_BLACK :value: True .. py:data:: CB_TIMEFORMAT :value: '%Y-%m-%dT%H:%M:%S%fZ' .. py:class:: OS Bases: :py:obj:`enum.IntEnum` Enum where members are also (and must be) ints .. py:attribute:: WINDOWS :value: 1 .. py:attribute:: LINUX :value: 2 .. py:attribute:: MAC :value: 4 .. py:class:: CbFilesystem(session: cbc_sdk.live_response_api.LiveResponseSession, prefix: str, *args, **kwargs) Bases: :py:obj:`dissect.target.filesystem.Filesystem` Base class for filesystems. .. py:attribute:: __type__ :value: 'cb' A short string identifying the type of filesystem. .. py:attribute:: session .. py:attribute:: prefix .. py:method:: detect(fh: BinaryIO) -> bool :staticmethod: Detect whether the ``fh`` file-handle is supported by this ``Filesystem`` implementation. The position of ``fh`` will be restored before returning. :param fh: A file-like object, usually a disk or partition. :returns: ``True`` if ``fh`` is supported, ``False`` otherwise. .. py:method:: get(path: str) -> CbFilesystemEntry Returns a CbFilesystemEntry object corresponding to the given path. .. py:class:: CbDirEntry(fs: Filesystem, path: str, name: str, entry: Any) Bases: :py:obj:`dissect.target.filesystem.DirEntry` Directory entry base class. Closely models ``os.DirEntry``. Filesystem implementations are encouraged to subclass this class to provide efficient implementations of the various methods. :param fs: The filesystem the entry belongs to. :param path: The path of the parent directory. :param name: The name of the entry. :param entry: The raw entry backing this directory entry. .. py:attribute:: fs :type: CbFilesystem The filesystem the entry belongs to. .. py:attribute:: entry :type: tuple[dict[str, Any], str] The raw entry backing this directory entry. .. py:method:: get() -> CbFilesystemEntry Retrieve the :class:`FilesystemEntry` this directory entry points to. Subclasses should override this method to provide an efficient implementation. .. py:method:: stat(*, follow_symlinks: bool = True) -> dissect.target.helpers.fsutil.stat_result .. py:class:: CbFilesystemEntry(fs: dissect.target.filesystem.Filesystem, path: str, entry: Any, cbpath: str) Bases: :py:obj:`dissect.target.filesystem.FilesystemEntry` Base class for filesystem entries. .. py:attribute:: cbpath .. py:method:: get(path: str) -> CbFilesystemEntry Get a filesystem entry relative from the current one. .. py:method:: open() -> BinaryIO Returns file handle (file-like object). .. py:method:: scandir() -> collections.abc.Iterator[CbDirEntry] List the directory contents of this directory. Returns a generator of filesystem entries. .. py:method:: is_dir(follow_symlinks: bool = True) -> bool Return whether this entry is a directory. .. py:method:: is_file(follow_symlinks: bool = True) -> bool Return whether this entry is a file. .. py:method:: is_symlink() -> bool Return whether this entry is a link. .. py:method:: stat(follow_symlinks: bool = True) -> dissect.target.helpers.fsutil.stat_result Return the stat information of this entry. .. py:method:: lstat() -> dissect.target.helpers.fsutil.stat_result Return the stat information of the given path, without resolving links.