dissect.target¶
Subpackages¶
dissect.target.containersdissect.target.containers.asdfdissect.target.containers.asifdissect.target.containers.ewfdissect.target.containers.fortifwdissect.target.containers.hdddissect.target.containers.hdsdissect.target.containers.qcow2dissect.target.containers.rawdissect.target.containers.splitdissect.target.containers.vdidissect.target.containers.vhddissect.target.containers.vhdxdissect.target.containers.vmdk
dissect.target.filesystemsdissect.target.filesystems.ad1dissect.target.filesystems.btrfsdissect.target.filesystems.cbdissect.target.filesystems.configdissect.target.filesystems.cpiodissect.target.filesystems.cramfsdissect.target.filesystems.dirdissect.target.filesystems.exfatdissect.target.filesystems.extfsdissect.target.filesystems.fatdissect.target.filesystems.ffsdissect.target.filesystems.itunesdissect.target.filesystems.jffsdissect.target.filesystems.nfsdissect.target.filesystems.ntfsdissect.target.filesystems.overlaydissect.target.filesystems.qnxfsdissect.target.filesystems.smbdissect.target.filesystems.squashfsdissect.target.filesystems.tardissect.target.filesystems.vbkdissect.target.filesystems.vmfsdissect.target.filesystems.vmtardissect.target.filesystems.xfsdissect.target.filesystems.zip
dissect.target.helpersdissect.target.helpers.compatdissect.target.helpers.nfsdissect.target.helpers.regexdissect.target.helpers.sunrpcdissect.target.helpers.cachedissect.target.helpers.configdissect.target.helpers.configutildissect.target.helpers.cyberdissect.target.helpers.descriptor_extensionsdissect.target.helpers.docsdissect.target.helpers.fsutildissect.target.helpers.hashutildissect.target.helpers.keychaindissect.target.helpers.lazydissect.target.helpers.loaderutildissect.target.helpers.localeutildissect.target.helpers.loggingdissect.target.helpers.mountdissect.target.helpers.muidissect.target.helpers.networkdissect.target.helpers.polypathdissect.target.helpers.protobufdissect.target.helpers.recorddissect.target.helpers.record_modifierdissect.target.helpers.regutildissect.target.helpers.scrapedissect.target.helpers.shell_application_idsdissect.target.helpers.shell_folder_idsdissect.target.helpers.utils
dissect.target.loadersdissect.target.loaders.abdissect.target.loaders.acquiredissect.target.loaders.asdfdissect.target.loaders.cbdissect.target.loaders.cellebritedissect.target.loaders.containerimagedissect.target.loaders.cyberdissect.target.loaders.dirdissect.target.loaders.directdissect.target.loaders.hypervdissect.target.loaders.itunesdissect.target.loaders.kapedissect.target.loaders.libvirtdissect.target.loaders.localdissect.target.loaders.logdissect.target.loaders.mqttdissect.target.loaders.multirawdissect.target.loaders.ovadissect.target.loaders.overlaydissect.target.loaders.overlay2dissect.target.loaders.ovfdissect.target.loaders.phobosdissect.target.loaders.profiledissect.target.loaders.proxmoxdissect.target.loaders.pvmdissect.target.loaders.pvsdissect.target.loaders.rawdissect.target.loaders.remotedissect.target.loaders.resdissect.target.loaders.smbdissect.target.loaders.taniumdissect.target.loaders.tardissect.target.loaders.targetdissect.target.loaders.uacdissect.target.loaders.utmdissect.target.loaders.vbdissect.target.loaders.vbkdissect.target.loaders.vboxdissect.target.loaders.velociraptordissect.target.loaders.vmadissect.target.loaders.vmwarevmdissect.target.loaders.vmxdissect.target.loaders.xvadissect.target.loaders.zip
dissect.target.pluginsdissect.target.plugins.appsdissect.target.plugins.apps.avdissect.target.plugins.apps.browserdissect.target.plugins.apps.chatdissect.target.plugins.apps.containerdissect.target.plugins.apps.editordissect.target.plugins.apps.edrdissect.target.plugins.apps.otherdissect.target.plugins.apps.productivitydissect.target.plugins.apps.remoteaccessdissect.target.plugins.apps.shelldissect.target.plugins.apps.sshdissect.target.plugins.apps.virtualizationdissect.target.plugins.apps.vpndissect.target.plugins.apps.webhostingdissect.target.plugins.apps.webserver
dissect.target.plugins.childdissect.target.plugins.child.colimadissect.target.plugins.child.dockerdissect.target.plugins.child.esxidissect.target.plugins.child.hypervdissect.target.plugins.child.limadissect.target.plugins.child.parallelsdissect.target.plugins.child.podmandissect.target.plugins.child.proxmoxdissect.target.plugins.child.qemudissect.target.plugins.child.virtualboxdissect.target.plugins.child.virtuozzodissect.target.plugins.child.vmware_workstationdissect.target.plugins.child.wsl
dissect.target.plugins.filesystemdissect.target.plugins.generaldissect.target.plugins.osdissect.target.plugins.scrape
dissect.target.toolsdissect.target.tools.utilsdissect.target.tools.build_pluginlistdissect.target.tools.dddissect.target.tools.diffdissect.target.tools.dumpdissect.target.tools.fsdissect.target.tools.infodissect.target.tools.mountdissect.target.tools.qfinddissect.target.tools.querydissect.target.tools.regdissect.target.tools.shelldissect.target.tools.yara
dissect.target.volumes
Submodules¶
Package Contents¶
Classes¶
The class that represents the target that you are talking to. |
- class dissect.target.Target(path: str | pathlib.Path | None = None)¶
The class that represents the target that you are talking to.
Usually you do not want to instantiate this class directly, but rather use the
Target.open()orTarget.open_all()methods to open a target from a path or URI. The target will then be loaded using the appropriateLoader.Targets are the glue that connects the different
Containers,Loaders,VolumesandFilesystemstogether.Loadersare used to map theContainers,VolumesandFilesystemsof the target onto theTargetobject.The plugins of dissect.target get mapped onto the
Targettoo. They become available as attributes on aTargetobject. For example,t.hostname,t.evtx(). By executing the plugin function with a target, it will perform the function on itself.- Parameters:
path – The path of a target.
- path_scheme = None¶
- path_query¶
- props: dict[Any, Any]¶
- log¶
- disks¶
- volumes¶
- filesystems¶
- fs¶
- __repr__() str¶
- __getattr__(attr: str) dissect.target.plugin.Plugin | Any¶
Override of the default
__getattr__so plugins and functions can be called from aTargetobject.
- __dir__() list[str]¶
Override the default
__dir__to provide autocomplete for things like IPython.
- classmethod set_event_callback(*, event_type: Event | None = None, event_callback: collections.abc.Callable) None¶
Sets
event_callbackson a Target class.event_callbacksget used to handle specific events denoted byEvent. This records events related to the target, such as:a plugin gets registered to the target
a plugin is incompatible with the target
a function succeededs in its execution
a function fails in execution
- send_event(event_type: Event, **kwargs) None¶
Notify event callbacks for the given
event_type.Each event can have multiple callback methods, it calls all the callbacks that fit the corresponding event type.
Noneis a catch-all method for event callbacks that always get called.- Parameters:
event_type – The type of event
- apply() None¶
Resolve all disks, volumes and filesystems and load an operating system on the current
Target.
- property name: str¶
Return a name for this target.
The function is guaranteed to give back some name. The name will be guaranteed to not have slashes, backslashes and spaces. The name won’t be guaranteed to be unique.
- Returns:
The name of a target.
- classmethod open(path: str | pathlib.Path) typing_extensions.Self¶
Try to find a suitable loader for the given path and load a
Targetfrom it.- Parameters:
path – Path to load the
Targetfrom. If the path is aos.PathLikeobject, it will be used as-is. If the path is a string and looks like a URI, it will be parsed as such. If the path is a string and does not like like a URI, it will be treated as a local path.- Returns:
A Target with a linked
Loaderobject.
- classmethod open_raw(path: str | pathlib.Path) typing_extensions.Self¶
Open a Target with the given path using the
RawLoader.- Parameters:
path – Path to load the
Targetfrom.
- classmethod open_all(paths: str | pathlib.Path | list[str | pathlib.Path], include_children: bool = False) collections.abc.Iterator[typing_extensions.Self]¶
Yield all targets from one or more paths or directories.
If the path is a directory, iterate files one directory deep.
- Parameters:
paths – A list of paths to load
Targetsfrom. If the path is aos.PathLikeobject, it will be used as-is. If the path is a string and looks like a URI, it will be parsed as such. If the path is a string and does not look like a URI, it will be treated as a local path.include_children – Whether to recursively open child targets.
- Raises:
TargetError – Raised when not a single
Targetcan be loaded.
- classmethod open_direct(paths: list[str | pathlib.Path]) typing_extensions.Self¶
Create a minimal target with a virtual root filesystem with all
pathsmapped into it.This is useful when running plugins on individual files.
- property is_direct: bool¶
Check if the target is a direct target.
- open_child(child: int | str | pathlib.Path) Target¶
Open a child target.
Allows opening a nested child target by path, index or child pattern. Paths will simply attempt to open the path as a child target. Indexes are zero-based, so the first child is 0, the second is 1, etc. If the child is a pattern, such as
4.2, it will open the 2nd child of the 4th child target of this target.- Parameters:
child – The location of a target within the current
Target, or a child pattern.- Returns:
An opened
Targetobject of the child target.
- open_children(recursive: bool = False) collections.abc.Iterator[Target]¶
Open all the child targets on a
Target.Will open all discovered child targets if the current
Targethas them, such as VMs on a hypervisor.- Parameters:
recursive – Whether to check the child
Targetfor moreTargets.- Returns:
An iterator of
Targets.
- list_children(recursive: bool = False) collections.abc.Iterator[tuple[str, dissect.target.helpers.record.ChildTargetRecord]]¶
Lists all discovered child targets.
- reload() Target¶
Reload the current target.
Using the loader with which the target was originally loaded, reload the path of the current target. This is useful when the target is live.
- Raises:
TargetError – If the target has no path or loader.
- Returns:
A fresh
Targetobject
- add_plugin(plugin_cls: dissect.target.plugin.Plugin | type[dissect.target.plugin.Plugin], check_compatible: bool = True) dissect.target.plugin.Plugin¶
Add and register a plugin by class.
- Parameters:
plugin_cls – The plugin to add and register, this can either be a class or instance. When this is a class, it will be instantiated.
check_compatible – Check whether the plugin is compatible with the
Target.
- Returns:
The
plugin_clsinstance.- Raises:
UnsupportedPluginError – Raised when plugins were found, but they were incompatible
PluginError – Raised when any other exception occurs while trying to load the plugin.
- load_plugin(descriptor: dissect.target.plugin.PluginDescriptor | dissect.target.plugin.FunctionDescriptor) dissect.target.plugin.Plugin¶
Load a plugin by descriptor.
- Parameters:
plugin_desc – The descriptor of the plugin to load.
- Returns:
The loaded plugin instance.
- Raises:
PluginError – Raised when any exception occurs while trying to load the plugin.
- get_function(function: str | dissect.target.plugin.FunctionDescriptor) FunctionTuple¶
Attempt to get a given function.
If the function is not already registered, look for plugins that export the function and register them.
- Parameters:
function – Function name to look for.
- Returns:
A tuple of the plugin and the corresponding function.
- Raises:
UnsupportedPluginError – Raised when plugins were found, but they were incompatible
PluginError – Raised when any other exception occurs while trying to load the plugin.
- has_function(function: str) bool¶
Return whether this Target supports a given function.
- Parameters:
function – The function name to look for.
- Returns:
Trueif the function can be found,Falseotherwise.