Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions acquire/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -1639,24 +1639,26 @@ def _run(cls, target: Target, cli_args: argparse.Namespace, collector: Collector
"bootbank": "BOOTBANK1",
"altbootbank": "BOOTBANK2",
}
boot_fs = {}
boot_fs = [] # List of tuples of bootbank paths and volume names

for boot_dir, boot_vol in boot_dirs.items():
dir_path = target.fs.path(boot_dir)
if dir_path.is_symlink() and dir_path.exists():
dst = dir_path.readlink()
fs = dst.get().top.fs
boot_fs[fs] = boot_vol

for fs, mountpoint, uuid, _ in iter_esxi_filesystems(target):
if fs in boot_fs:
name = boot_fs[fs]
log.info("Acquiring %s (%s)", mountpoint, name)
mountpoint_len = len(mountpoint)
base = f"fs/{uuid}:{name}"
for path in target.fs.path(mountpoint).rglob("*"):
outpath = path.as_posix()[mountpoint_len:]
collector.collect_path(path, outpath=outpath, base=base)
boot_fs.append((dst, boot_vol))

for _, mountpoint, uuid, _ in iter_esxi_filesystems(target):
for bootbank_path, boot_vol in boot_fs:
# samefile fails on python 3.9 (https://github.com/fox-it/dissect.target/issues/1289)
# but support for 3.9 gets dropped soon
if bootbank_path.samefile(target.fs.path(mountpoint)):
log.info("Acquiring %s (%s)", mountpoint, boot_vol)
mountpoint_len = len(mountpoint)
base = f"fs/{uuid}:{boot_vol}"
for path in target.fs.path(mountpoint).rglob("*"):
outpath = path.as_posix()[mountpoint_len:]
collector.collect_path(path, outpath=outpath, base=base)
break


@register_module("--esxi")
Expand Down
Loading