dissect.target 3.15.dev19__py3-none-any.whl → 3.15.dev21__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- dissect/target/loaders/tar.py +13 -0
- dissect/target/plugins/filesystem/ntfs/mft.py +10 -0
- dissect/target/plugins/filesystem/ntfs/mft_timeline.py +10 -0
- dissect/target/plugins/filesystem/ntfs/usnjrnl.py +10 -0
- dissect/target/plugins/filesystem/ntfs/utils.py +28 -5
- {dissect.target-3.15.dev19.dist-info → dissect.target-3.15.dev21.dist-info}/METADATA +1 -1
- {dissect.target-3.15.dev19.dist-info → dissect.target-3.15.dev21.dist-info}/RECORD +12 -12
- {dissect.target-3.15.dev19.dist-info → dissect.target-3.15.dev21.dist-info}/COPYRIGHT +0 -0
- {dissect.target-3.15.dev19.dist-info → dissect.target-3.15.dev21.dist-info}/LICENSE +0 -0
- {dissect.target-3.15.dev19.dist-info → dissect.target-3.15.dev21.dist-info}/WHEEL +0 -0
- {dissect.target-3.15.dev19.dist-info → dissect.target-3.15.dev21.dist-info}/entry_points.txt +0 -0
- {dissect.target-3.15.dev19.dist-info → dissect.target-3.15.dev21.dist-info}/top_level.txt +0 -0
dissect/target/loaders/tar.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import logging
|
2
|
+
import re
|
2
3
|
import tarfile
|
3
4
|
from pathlib import Path
|
4
5
|
from typing import Union
|
@@ -14,6 +15,9 @@ from dissect.target.loader import Loader
|
|
14
15
|
log = logging.getLogger(__name__)
|
15
16
|
|
16
17
|
|
18
|
+
ANON_FS_RE = re.compile(r"^fs[0-9]+$")
|
19
|
+
|
20
|
+
|
17
21
|
class TarLoader(Loader):
|
18
22
|
"""Load tar files."""
|
19
23
|
|
@@ -63,6 +67,15 @@ class TarLoader(Loader):
|
|
63
67
|
if volume_name.lower() == "c:":
|
64
68
|
volume_name = "sysvol"
|
65
69
|
|
70
|
+
if volume_name == "$fs$":
|
71
|
+
if len(parts) == 1:
|
72
|
+
# The fs/$fs$ entry is ignored, only the directories below it are processed.
|
73
|
+
continue
|
74
|
+
fs_name = parts[1]
|
75
|
+
if ANON_FS_RE.match(fs_name):
|
76
|
+
parts.pop(0)
|
77
|
+
volume_name = f"{volume_name}/{fs_name}"
|
78
|
+
|
66
79
|
if volume_name not in volumes:
|
67
80
|
vol = filesystem.VirtualFilesystem(case_sensitive=False)
|
68
81
|
vol.tar = self.tar
|
@@ -123,6 +123,12 @@ class MftPlugin(Plugin):
|
|
123
123
|
|
124
124
|
The Master File Table (MFT) contains primarily metadata about every file and folder on a NFTS filesystem.
|
125
125
|
|
126
|
+
If the filesystem is part of a virtual NTFS filesystem (a ``VirtualFilesystem`` with the MFT properties
|
127
|
+
added to it through a "fake" ``NtfsFilesystem``), the paths returned in the MFT records are based on the
|
128
|
+
mount point of the ``VirtualFilesystem``. This ensures that the proper original drive letter is used when
|
129
|
+
available.
|
130
|
+
When no drive letter can be determined, the path will show as e.g. ``\\$fs$\\fs0``.
|
131
|
+
|
126
132
|
References:
|
127
133
|
- https://docs.microsoft.com/en-us/windows/win32/fileio/master-file-table
|
128
134
|
"""
|
@@ -136,6 +142,10 @@ class MftPlugin(Plugin):
|
|
136
142
|
if fs.__type__ != "ntfs":
|
137
143
|
continue
|
138
144
|
|
145
|
+
# If this filesystem is a "fake" NTFS filesystem, used to enhance a
|
146
|
+
# VirtualFilesystem, The driveletter (more accurate mount point)
|
147
|
+
# returned will be that of the VirtualFilesystem. This makes sure
|
148
|
+
# the paths returned in the records are actually reachable.
|
139
149
|
drive_letter = get_drive_letter(self.target, fs)
|
140
150
|
volume_uuid = get_volume_identifier(fs)
|
141
151
|
|
@@ -105,6 +105,12 @@ class MftTimelinePlugin(Plugin):
|
|
105
105
|
|
106
106
|
The Master File Table (MFT) contains metadata about every file and folder on a NFTS filesystem.
|
107
107
|
|
108
|
+
If the filesystem is part of a virtual NTFS filesystem (a ``VirtualFilesystem`` with the MFT properties
|
109
|
+
added to it through a "fake" ``NtfsFilesystem``), the paths returned in the MFT records are based on the
|
110
|
+
mount point of the ``VirtualFilesystem``. This ensures that the proper original drive letter is used when
|
111
|
+
available.
|
112
|
+
When no drive letter can be determined, the path will show as e.g. ``\\$fs$\\fs0``.
|
113
|
+
|
108
114
|
References:
|
109
115
|
- https://docs.microsoft.com/en-us/windows/win32/fileio/master-file-table
|
110
116
|
"""
|
@@ -112,6 +118,10 @@ class MftTimelinePlugin(Plugin):
|
|
112
118
|
if fs.__type__ != "ntfs":
|
113
119
|
continue
|
114
120
|
|
121
|
+
# If this filesystem is a "fake" NTFS filesystem, used to enhance a
|
122
|
+
# VirtualFilesystem, The driveletter (more accurate mount point)
|
123
|
+
# returned will be that of the VirtualFilesystem. This makes sure
|
124
|
+
# the paths returned in the records are actually reachable.
|
115
125
|
drive_letter = get_drive_letter(self.target, fs)
|
116
126
|
extras = Extras(
|
117
127
|
serial=fs.ntfs.serial,
|
@@ -34,6 +34,12 @@ class UsnjrnlPlugin(Plugin):
|
|
34
34
|
The Update Sequence Number Journal (UsnJrnl) is a feature of an NTFS file system and contains information about
|
35
35
|
filesystem activities. Each volume has its own UsnJrnl.
|
36
36
|
|
37
|
+
If the filesystem is part of a virtual NTFS filesystem (a ``VirtualFilesystem`` with the UsnJrnl
|
38
|
+
properties added to it through a "fake" ``NtfsFilesystem``), the paths returned in the UsnJrnl records
|
39
|
+
are based on the mount point of the ``VirtualFilesystem``. This ensures that the proper original drive
|
40
|
+
letter is used when available.
|
41
|
+
When no drive letter can be determined, the path will show as e.g. ``\\$fs$\\fs0``.
|
42
|
+
|
37
43
|
References:
|
38
44
|
- https://en.wikipedia.org/wiki/USN_Journal
|
39
45
|
- https://velociraptor.velocidex.com/the-windows-usn-journal-f0c55c9010e
|
@@ -47,6 +53,10 @@ class UsnjrnlPlugin(Plugin):
|
|
47
53
|
if not usnjrnl:
|
48
54
|
continue
|
49
55
|
|
56
|
+
# If this filesystem is a "fake" NTFS filesystem, used to enhance a
|
57
|
+
# VirtualFilesystem, The driveletter (more accurate mount point)
|
58
|
+
# returned will be that of the VirtualFilesystem. This makes sure
|
59
|
+
# the paths returned in the records are actually reachable.
|
50
60
|
drive_letter = get_drive_letter(self.target, fs)
|
51
61
|
for record in usnjrnl.records():
|
52
62
|
try:
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import re
|
1
2
|
from enum import Enum, auto
|
2
3
|
from typing import Optional, Tuple
|
3
4
|
from uuid import UUID
|
@@ -8,6 +9,8 @@ from dissect.ntfs.mft import MftRecord
|
|
8
9
|
from dissect.target import Target
|
9
10
|
from dissect.target.filesystems.ntfs import NtfsFilesystem
|
10
11
|
|
12
|
+
DRIVE_LETTER_RE = re.compile(r"[a-zA-Z]:")
|
13
|
+
|
11
14
|
|
12
15
|
class InformationType(Enum):
|
13
16
|
STANDARD_INFORMATION = auto()
|
@@ -20,13 +23,33 @@ def get_drive_letter(target: Target, filesystem: NtfsFilesystem):
|
|
20
23
|
|
21
24
|
When the drive letter is not available for that filesystem it returns empty.
|
22
25
|
"""
|
26
|
+
# A filesystem can be known under multiple drives (mount points). If it is
|
27
|
+
# a windows system volume, there are the default sysvol and c: drives.
|
28
|
+
# If the target has a virtual ntfs filesystem, e.g. as constructed by the
|
29
|
+
# tar and dir loaders, there is also the /$fs$/fs<n> drive, under which the
|
30
|
+
# "fake" ntfs filesystem is mounted.
|
31
|
+
# The precedence for drives is first the drive letter drives (e.g. c:),
|
32
|
+
# second the "normally" named drives (e.g. sysvol) and finally the anonymous
|
33
|
+
# drives (e.g. /$fs/fs0).
|
23
34
|
mount_items = (item for item in target.fs.mounts.items() if hasattr(item[1], "ntfs"))
|
24
|
-
|
35
|
+
drives = [key for key, fs in mount_items if fs.ntfs is filesystem.ntfs]
|
36
|
+
|
37
|
+
single_letter_drives = []
|
38
|
+
other_drives = []
|
39
|
+
anon_drives = []
|
40
|
+
|
41
|
+
for drive in drives:
|
42
|
+
if DRIVE_LETTER_RE.match(drive):
|
43
|
+
single_letter_drives.append(drive)
|
44
|
+
elif "$fs$" in drive:
|
45
|
+
anon_drives.append(drive)
|
46
|
+
else:
|
47
|
+
other_drives.append(drive)
|
48
|
+
|
49
|
+
drives = sorted(single_letter_drives) + sorted(other_drives) + sorted(anon_drives)
|
25
50
|
|
26
|
-
if
|
27
|
-
|
28
|
-
# This is to choose the latter which will be 'c:'
|
29
|
-
return f"{driveletters[-1]}\\"
|
51
|
+
if drives:
|
52
|
+
return f"{drives[0]}\\"
|
30
53
|
else:
|
31
54
|
return ""
|
32
55
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: dissect.target
|
3
|
-
Version: 3.15.
|
3
|
+
Version: 3.15.dev21
|
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
|
@@ -90,7 +90,7 @@ dissect/target/loaders/remote.py,sha256=4cGCQfBwuhh5vo0zgVCK8V3I0w9SSWX3AjbW9eeb
|
|
90
90
|
dissect/target/loaders/res.py,sha256=8b178x05t9K31wOeP8yGD1IdR3RpiMGz7wcvtHmmHjk,8819
|
91
91
|
dissect/target/loaders/smb.py,sha256=qP8m4Jq7hvAvUCF9jB4yr2Zut7p_R02_vxziNN3R1to,13070
|
92
92
|
dissect/target/loaders/tanium.py,sha256=P9euiQzvVaQQtMQlEmNe0V25w1BkQFRZBuS-0-ksHpY,1585
|
93
|
-
dissect/target/loaders/tar.py,sha256=
|
93
|
+
dissect/target/loaders/tar.py,sha256=mfUZCZexjUeZVJFiPvW_OUutObjPGzJY9QOAXnFG70E,3562
|
94
94
|
dissect/target/loaders/target.py,sha256=Bp3kcfW-ntkgDZ9IpYPMoR-4FDBPqcLD_W88Z9IU--o,692
|
95
95
|
dissect/target/loaders/targetd.py,sha256=sfbn2_j3il2G-rPywAoNT5YPtD5KmKkmBv1zrPDRs6I,8250
|
96
96
|
dissect/target/loaders/utm.py,sha256=e5x5ZI3HeL0STh4S-CaQb68Rnug4SVZR9zlmHaGFj0M,978
|
@@ -153,10 +153,10 @@ dissect/target/plugins/filesystem/resolver.py,sha256=HfyASUFV4F9uD-yFXilFpPTORAs
|
|
153
153
|
dissect/target/plugins/filesystem/walkfs.py,sha256=aCEBmT3uoQdMdSGUshMOsKpcjrzAFg3HzeYW24PJZwk,2296
|
154
154
|
dissect/target/plugins/filesystem/yara.py,sha256=q_pbrQArNaWP4ILRzK7VQhukIw16LhUvntoviHmZ38Q,2241
|
155
155
|
dissect/target/plugins/filesystem/ntfs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
156
|
-
dissect/target/plugins/filesystem/ntfs/mft.py,sha256=
|
157
|
-
dissect/target/plugins/filesystem/ntfs/mft_timeline.py,sha256=
|
158
|
-
dissect/target/plugins/filesystem/ntfs/usnjrnl.py,sha256=
|
159
|
-
dissect/target/plugins/filesystem/ntfs/utils.py,sha256=
|
156
|
+
dissect/target/plugins/filesystem/ntfs/mft.py,sha256=Za-fsTcKlAlhm9ugJlMdwsJVf2Osrh4PrEGSFuv-Eeo,9564
|
157
|
+
dissect/target/plugins/filesystem/ntfs/mft_timeline.py,sha256=vvNFAZbr7s3X2OTYf4ES_L6-XsouTXcTymfxnHfZ1Rw,6791
|
158
|
+
dissect/target/plugins/filesystem/ntfs/usnjrnl.py,sha256=uiT1ipmcAo__6VIUi8R_vvIu22vdnjMACKwLSAbzYjs,3704
|
159
|
+
dissect/target/plugins/filesystem/ntfs/utils.py,sha256=xG7Lgw9NX4tDDrZVRm0vycFVJTOM7j-HrjqzDh0f4uA,3136
|
160
160
|
dissect/target/plugins/filesystem/unix/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
161
161
|
dissect/target/plugins/filesystem/unix/capability.py,sha256=oTJVEr8Yszejd-FxU0D8J49ATxNrJOcUnBFIc96k8kg,5920
|
162
162
|
dissect/target/plugins/filesystem/unix/suid.py,sha256=Q0Y5CyPm34REruyZYP5siFAka4i7QEOOxZ9K2L-SxPY,1290
|
@@ -315,10 +315,10 @@ dissect/target/volumes/luks.py,sha256=v_mHW05KM5iG8JDe47i2V4Q9O0r4rnAMA9m_qc9cYw
|
|
315
315
|
dissect/target/volumes/lvm.py,sha256=wwQVR9I3G9YzmY6UxFsH2Y4MXGBcKL9aayWGCDTiWMU,2269
|
316
316
|
dissect/target/volumes/md.py,sha256=j1K1iKmspl0C_OJFc7-Q1BMWN2OCC5EVANIgVlJ_fIE,1673
|
317
317
|
dissect/target/volumes/vmfs.py,sha256=-LoUbn9WNwTtLi_4K34uV_-wDw2W5hgaqxZNj4UmqAQ,1730
|
318
|
-
dissect.target-3.15.
|
319
|
-
dissect.target-3.15.
|
320
|
-
dissect.target-3.15.
|
321
|
-
dissect.target-3.15.
|
322
|
-
dissect.target-3.15.
|
323
|
-
dissect.target-3.15.
|
324
|
-
dissect.target-3.15.
|
318
|
+
dissect.target-3.15.dev21.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
|
319
|
+
dissect.target-3.15.dev21.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
320
|
+
dissect.target-3.15.dev21.dist-info/METADATA,sha256=4zEuRFKt1qhipeN98KP4OJXi0bz5r8RLmqBrRUbQbuI,11113
|
321
|
+
dissect.target-3.15.dev21.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
322
|
+
dissect.target-3.15.dev21.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
|
323
|
+
dissect.target-3.15.dev21.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
|
324
|
+
dissect.target-3.15.dev21.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
{dissect.target-3.15.dev19.dist-info → dissect.target-3.15.dev21.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|