Skip to content

Commit 52c4961

Browse files
Improvements
1 parent 7b6589e commit 52c4961

2 files changed

Lines changed: 46 additions & 11 deletions

File tree

docs/source/advanced/children.rst

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,54 @@
11
Children
22
========
33

4-
Dissect supports the concept of targets within targets, referred to as child or nested targets. This can be useful when dealing with hypervisors, where we can individually address each virtual machine as a separate target. Child targets behave just like regular targets, so all functionality and plugins we can expect on a regular target is available on a child target.
4+
Dissect also supports the concept of targets within targets, referred to as child targets. For example, when a
5+
target contains a ``.vmdk`` file within itself, we can tell ``dissect.target`` to load that target from within the
6+
context of the first target. This can be useful when dealing with hypervisors.
57

6-
Child targets can be anything that Dissect already supports, but we also provide some automatic detection of child targets for certain systems. Automatic child target detection is currently supported for:
8+
Say, for example, we opened a Hyper-V target locally from ``\\.\PhysicalDrive0``, we can parse the metadata
9+
in ``ProgramData/Microsoft/Windows/Hyper-V/data.vmcx`` that tells us where all of the virtual machines are stored.
10+
Then we can then use these paths and tell ``dissect.target`` to load another target from there. Reading all of these
11+
files will still happen from ``\\.\PhysicalDrive0``, passing through the various abstraction layers of ``dissect.target``.
12+
This allows Dissect to read the disks from running virtual machines, regardless of locks the operating has on these files.
13+
14+
Child targets can be anything that Dissect already supports, but we also provide some automatic detection of
15+
child targets for certain systems. Automatic child target detection is currently supported for:
716

817
* VMware ESXi (also known as vSphere)
918
* VMWare Workstation
1019
* Microsoft Hyper-V
1120
* Windows Subsystem for Linux (WSL2)
1221
* Virtuozzo
1322

23+
Using child targets
24+
-------------------
25+
26+
To apply ``target-query`` to child targets simply add the ``--children`` flag like this:
27+
28+
.. code-block:: console
29+
30+
$ target-query /path/to/target -f hostname --children
31+
32+
Replace the example path ``/path/to/target`` with the path to the host image.
33+
To just query a specific child, simply use the ``--child`` option and provide the path to
34+
the file within the host target that contains the child target:
35+
36+
.. code-block:: console
37+
38+
$ target-query /path/to/target -f hostname --child /virtualmachines/host123.vmcx
39+
40+
41+
When using ``target-shell`` you can access the child target by using the ``enter`` command:
42+
43+
.. code-block:: console
44+
45+
$ enter host123.vmcx
46+
47+
48+
Child target API
49+
----------------
50+
51+
1452
To obtain a list of nested targets use ``list_children``:
1553

1654
.. code-block:: python

docs/source/advanced/targets.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,12 @@ that may have had its superblock or ``$BOOT`` destroyed:
131131
Targets in targets
132132
------------------
133133

134-
Dissect also supports the concept of targets within targets, referred to as child targets. For example, when a
135-
target contains a ``.vmdk`` file within itself, we can tell ``dissect.target`` to load that target from within the
136-
context of the first target. This can be useful when dealing with hypervisors.
137-
138-
Say, for example, we opened a Hyper-V target locally from ``\\.\PhysicalDrive0``, we can parse the metadata
139-
in ``ProgramData/Microsoft/Windows/Hyper-V/data.vmcx`` that tells us where all of the virtual machines are stored.
140-
Then we can then use these paths and tell ``dissect.target`` to load another target from there. Reading all of these
141-
files will still happen from ``\\.\PhysicalDrive0``, passing through the various abstraction layers of ``dissect.target``.
142-
This allows Dissect to read the disks from running virtual machines, regardless of locks the operating has on these files.
134+
Dissect also supports the concept of targets within targets, referred to as child targets.
135+
Child targets are especially useful for dealing with hypervisors. With the child target feature
136+
you can query virtual machines that are running on a host. Because of the way Dissect handles the
137+
underlying data streams you can query these virtual machines regardless of the locks the host
138+
operating system has on these files. It is even possible to explore the contents of the child targets
139+
using ``target-shell`` just like regular targets!
143140

144141
.. hint::
145142

0 commit comments

Comments
 (0)