dissect.target 3.11.2.dev25__py3-none-any.whl → 3.11.2.dev26__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,8 +13,18 @@ from dissect.target.filesystems.dir import DirectoryFilesystem
13
13
  from dissect.target.helpers.utils import parse_path_uri
14
14
  from dissect.target.loader import Loader
15
15
 
16
+ SOLARIS_DEV_DIR = Path("/dev/dsk")
16
17
  SOLARIS_DRIVE_REGEX = re.compile(r".+d\d+$")
17
- LINUX_DRIVE_REGEX = re.compile(r"([sh]d[a-z]$)|(fd\d+$)|(nvme\d+n\d+$)")
18
+
19
+ LINUX_DEV_DIR = Path("/dev")
20
+ LINUX_DRIVE_REGEX = re.compile(r"(([sh]|xv)d[a-z]$)|(fd\d+$)|(nvme\d+n\d+$)")
21
+ VOLATILE_LINUX_PATHS = [
22
+ Path("/proc"),
23
+ Path("/sys"),
24
+ ]
25
+
26
+ ESXI_DEV_DIR = Path("/vmfs/devices/disks")
27
+
18
28
  WINDOWS_ERROR_INSUFFICIENT_BUFFER = 0x7A
19
29
  WINDOWS_DRIVE_FIXED = 3
20
30
 
@@ -59,21 +69,35 @@ class LocalLoader(Loader):
59
69
 
60
70
 
61
71
  def map_linux_drives(target: Target):
62
- """Map Linux raw disks.
72
+ """Map Linux raw disks and /proc and /sys.
63
73
 
64
74
  Iterate through /dev and match raw device names (not partitions).
75
+
76
+ /proc and /sys are mounted if they exists, allowing access to volatile files.
65
77
  """
66
- for drive in Path("/dev").iterdir():
78
+ for drive in LINUX_DEV_DIR.iterdir():
67
79
  if LINUX_DRIVE_REGEX.match(drive.name):
68
80
  _add_disk_as_raw_container_to_target(drive, target)
69
81
 
82
+ # Volatile filesystems are not present when running on a local target's raw
83
+ # disks, so they are explicitly mounted here.
84
+ #
85
+ # Note that when running on a local target using a directory fs (through
86
+ # force-directory-fs or fallback-to-directory-fs), these filesystems are
87
+ # already present as they are usually mounted on the local system.
88
+ for volatile_path in VOLATILE_LINUX_PATHS:
89
+ if volatile_path.exists():
90
+ volatile_fs = DirectoryFilesystem(volatile_path)
91
+ target.filesystems.add(volatile_fs)
92
+ target.fs.mount(str(volatile_path), volatile_fs)
93
+
70
94
 
71
95
  def map_solaris_drives(target):
72
96
  """Map Solaris raw disks.
73
97
 
74
98
  Iterate through /dev/dsk and match raw device names (not slices or partitions).
75
99
  """
76
- for drive in Path("/dev/dsk").iterdir():
100
+ for drive in SOLARIS_DEV_DIR.iterdir():
77
101
  if not SOLARIS_DRIVE_REGEX.match(drive.name):
78
102
  continue
79
103
  _add_disk_as_raw_container_to_target(drive, target)
@@ -84,7 +108,7 @@ def map_esxi_drives(target):
84
108
 
85
109
  Get all devices from /vmfs/devices/disks/* (not partitions).
86
110
  """
87
- for drive in Path("/vmfs/devices/disks").glob("vml.*"):
111
+ for drive in ESXI_DEV_DIR.glob("vml.*"):
88
112
  if ":" in drive.name:
89
113
  continue
90
114
  _add_disk_as_raw_container_to_target(drive, target)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.11.2.dev25
3
+ Version: 3.11.2.dev26
4
4
  Summary: This module ties all other Dissect modules together, it provides a programming API and command line tools which allow easy access to various data sources inside disk images or file collections (a.k.a. targets)
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License: Affero General Public License v3
@@ -63,7 +63,7 @@ dissect/target/loaders/dir.py,sha256=nEJepNGI4EEP7MX3X15xysH9agKDmlKjfyd1DDulieU
63
63
  dissect/target/loaders/hyperv.py,sha256=_IOUJEO0BXaCBZ6sjIX0DZTkG9UNW5Vs9VcNHYv073w,5928
64
64
  dissect/target/loaders/itunes.py,sha256=69aMTQiiGYpmD_EYSmf9mO1re8C3jAZIEStmwlMxdAk,13146
65
65
  dissect/target/loaders/kape.py,sha256=t5TfrGLqPeIpUUpXzIl6aHsqXMEGDqJ5YwDCs07DiBA,1237
66
- dissect/target/loaders/local.py,sha256=tZLpcvbKd70N9KU1eb1P1BCXtwaM7RJ9YP8PKct7xyU,15573
66
+ dissect/target/loaders/local.py,sha256=Ul-LCd_fY7SyWOVR6nH-NqbkuNpxoZVmffwrkvQElU8,16453
67
67
  dissect/target/loaders/log.py,sha256=_Mo44icM_4qQ05pjgcowrSnLeUHkwAGVYlYrHiIXLJw,1234
68
68
  dissect/target/loaders/multiraw.py,sha256=4a3ZST0NwjnfPDxHkcEfAcX2ddUlT_C-rcrMHNg1wp4,1046
69
69
  dissect/target/loaders/ovf.py,sha256=ro1F9Gr3ta5dgov483twzine9_Sw6hwZoILz2srHJI0,1069
@@ -281,10 +281,10 @@ dissect/target/volumes/bde.py,sha256=gYGg5yF9MNARwNzEkrEfZmKkxyZW4rhLkpdnPJCbhGk
281
281
  dissect/target/volumes/disk.py,sha256=95grSsPt1BLVpKwTclwQYzPFGKTkFFqapIk0RoGWf38,968
282
282
  dissect/target/volumes/lvm.py,sha256=_kIB1mdRs1OFhRgoT4VEP5Fv8imQnI7oQ_ie4x710tQ,1814
283
283
  dissect/target/volumes/vmfs.py,sha256=mlAJ8278tYaoRjk1u6tFFlCaDQUrVu5ZZE4ikiFvxi8,1707
284
- dissect.target-3.11.2.dev25.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
285
- dissect.target-3.11.2.dev25.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
286
- dissect.target-3.11.2.dev25.dist-info/METADATA,sha256=mVhdzds-TFJ6al8s3guhjq2nLFakYvHciKCgdD6ZN58,10978
287
- dissect.target-3.11.2.dev25.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
288
- dissect.target-3.11.2.dev25.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
289
- dissect.target-3.11.2.dev25.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
290
- dissect.target-3.11.2.dev25.dist-info/RECORD,,
284
+ dissect.target-3.11.2.dev26.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
285
+ dissect.target-3.11.2.dev26.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
286
+ dissect.target-3.11.2.dev26.dist-info/METADATA,sha256=kXsUBDd9biwYZYnSt-67u-m2rO5n6BB3Cx3e6kXr0qw,10978
287
+ dissect.target-3.11.2.dev26.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
288
+ dissect.target-3.11.2.dev26.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
289
+ dissect.target-3.11.2.dev26.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
290
+ dissect.target-3.11.2.dev26.dist-info/RECORD,,