|
1 | 1 | Children |
2 | 2 | ======== |
3 | 3 |
|
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. |
5 | 7 |
|
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: |
7 | 16 |
|
8 | 17 | * VMware ESXi (also known as vSphere) |
9 | 18 | * VMWare Workstation |
10 | 19 | * Microsoft Hyper-V |
11 | 20 | * Windows Subsystem for Linux (WSL2) |
12 | 21 | * Virtuozzo |
13 | 22 |
|
| 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 | + |
14 | 52 | To obtain a list of nested targets use ``list_children``: |
15 | 53 |
|
16 | 54 | .. code-block:: python |
|
0 commit comments