acquire 3.14.dev7__tar.gz → 3.14.dev8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {acquire-3.14.dev7/acquire.egg-info → acquire-3.14.dev8}/PKG-INFO +1 -1
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/acquire.py +30 -91
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/utils.py +15 -37
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/version.py +2 -2
- {acquire-3.14.dev7 → acquire-3.14.dev8/acquire.egg-info}/PKG-INFO +1 -1
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_acquire_command.py +6 -1
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_utils.py +1 -20
- {acquire-3.14.dev7 → acquire-3.14.dev8}/COPYRIGHT +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/LICENSE +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/MANIFEST.in +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/README.md +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/__init__.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/collector.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/crypt.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/dynamic/__init__.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/dynamic/windows/__init__.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/dynamic/windows/collect.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/dynamic/windows/exceptions.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/dynamic/windows/handles.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/dynamic/windows/named_objects.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/dynamic/windows/ntdll.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/dynamic/windows/types.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/esxi.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/gui/__init__.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/gui/base.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/gui/win32.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/hashes.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/log.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/outputs/__init__.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/outputs/base.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/outputs/dir.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/outputs/tar.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/outputs/zip.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/tools/__init__.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/tools/decrypter.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/uploaders/__init__.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/uploaders/minio.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/uploaders/plugin.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/uploaders/plugin_registry.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire/volatilestream.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire.egg-info/SOURCES.txt +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire.egg-info/dependency_links.txt +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire.egg-info/entry_points.txt +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire.egg-info/requires.txt +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/acquire.egg-info/top_level.txt +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/pyproject.toml +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/setup.cfg +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/__init__.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/conftest.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/docs/Makefile +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/docs/conf.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/docs/index.rst +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_acquire_modules.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_collector.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_decryptor_funcs.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_esxi_memory.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_file_sorting.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_minio_uploader.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_misc_users.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_outputs_dir.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_outputs_tar.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tests/test_plugin.py +0 -0
- {acquire-3.14.dev7 → acquire-3.14.dev8}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: acquire
|
|
3
|
-
Version: 3.14.
|
|
3
|
+
Version: 3.14.dev8
|
|
4
4
|
Summary: A tool to quickly gather forensic artifacts from disk images or a live system into a lightweight container
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -3,7 +3,6 @@ import enum
|
|
|
3
3
|
import functools
|
|
4
4
|
import io
|
|
5
5
|
import itertools
|
|
6
|
-
import json
|
|
7
6
|
import logging
|
|
8
7
|
import os
|
|
9
8
|
import platform
|
|
@@ -22,10 +21,9 @@ from dissect.target import Target, exceptions
|
|
|
22
21
|
from dissect.target.filesystem import Filesystem
|
|
23
22
|
from dissect.target.filesystems import ntfs
|
|
24
23
|
from dissect.target.helpers import fsutil
|
|
25
|
-
from dissect.target.loaders.remote import RemoteStreamConnection
|
|
26
|
-
from dissect.target.loaders.targetd import TargetdLoader
|
|
27
24
|
from dissect.target.plugins.apps.webserver import iis
|
|
28
25
|
from dissect.target.plugins.os.windows.log import evt, evtx
|
|
26
|
+
from dissect.target.tools.utils import args_to_uri
|
|
29
27
|
from dissect.util.stream import RunlistStream
|
|
30
28
|
|
|
31
29
|
from acquire.collector import Collector, get_full_formatted_report, get_report_summary
|
|
@@ -92,7 +90,6 @@ MODULE_LOOKUP = {}
|
|
|
92
90
|
|
|
93
91
|
CLI_ARGS_MODULE = "cli-args"
|
|
94
92
|
|
|
95
|
-
|
|
96
93
|
log = logging.getLogger("acquire")
|
|
97
94
|
log.propagate = 0
|
|
98
95
|
log_file_handler = None
|
|
@@ -1658,45 +1655,6 @@ def print_acquire_warning(target: Target) -> None:
|
|
|
1658
1655
|
log.warning("========================================== WARNING ==========================================")
|
|
1659
1656
|
|
|
1660
1657
|
|
|
1661
|
-
def modargs2json(args: argparse.Namespace) -> dict:
|
|
1662
|
-
json_opts = {}
|
|
1663
|
-
for module in MODULES.values():
|
|
1664
|
-
cli_arg = module.__cli_args__[-1:][0][1]
|
|
1665
|
-
if opt := cli_arg.get("dest"):
|
|
1666
|
-
json_opts[opt] = getattr(args, opt)
|
|
1667
|
-
return json_opts
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
def acquire_target(target: Target, *args, **kwargs) -> list[str]:
|
|
1671
|
-
if isinstance(target._loader, TargetdLoader):
|
|
1672
|
-
files = acquire_target_targetd(target, *args, **kwargs)
|
|
1673
|
-
else:
|
|
1674
|
-
files = acquire_target_regular(target, *args, **kwargs)
|
|
1675
|
-
return files
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
def acquire_target_targetd(target: Target, args: argparse.Namespace, output_ts: Optional[str] = None) -> list[str]:
|
|
1679
|
-
files = []
|
|
1680
|
-
# debug logs contain references to flow objects and will give errors
|
|
1681
|
-
logging.getLogger().setLevel(logging.CRITICAL)
|
|
1682
|
-
if not len(target.hostname()):
|
|
1683
|
-
log.error("Unable to initialize targetd.")
|
|
1684
|
-
return files
|
|
1685
|
-
json_opts = modargs2json(args)
|
|
1686
|
-
json_opts["profile"] = args.profile
|
|
1687
|
-
json_opts["file"] = args.file
|
|
1688
|
-
json_opts["directory"] = args.directory
|
|
1689
|
-
json_opts["glob"] = args.glob
|
|
1690
|
-
m = {"targetd-meta": "acquire", "args": json_opts}
|
|
1691
|
-
json_str = json.dumps(m)
|
|
1692
|
-
targetd = target._loader.instance.client
|
|
1693
|
-
targetd.send_message(json_str.encode("utf-8"))
|
|
1694
|
-
targetd.sync()
|
|
1695
|
-
for stream in targetd.streams:
|
|
1696
|
-
files.append(stream.out_file)
|
|
1697
|
-
return files
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
1658
|
def _add_modules_for_profile(choice: str, operating_system: str, profile: dict, msg: str) -> Optional[dict]:
|
|
1701
1659
|
modules_selected = dict()
|
|
1702
1660
|
|
|
@@ -1712,7 +1670,7 @@ def _add_modules_for_profile(choice: str, operating_system: str, profile: dict,
|
|
|
1712
1670
|
return modules_selected
|
|
1713
1671
|
|
|
1714
1672
|
|
|
1715
|
-
def
|
|
1673
|
+
def acquire_target(target: Target, args: argparse.Namespace, output_ts: Optional[str] = None) -> list[str]:
|
|
1716
1674
|
acquire_gui = GUI()
|
|
1717
1675
|
files = []
|
|
1718
1676
|
output_ts = output_ts or get_utc_now_str()
|
|
@@ -2092,7 +2050,7 @@ VOLATILE = {
|
|
|
2092
2050
|
|
|
2093
2051
|
def main() -> None:
|
|
2094
2052
|
parser = create_argument_parser(PROFILES, VOLATILE, MODULES)
|
|
2095
|
-
args = parse_acquire_args(parser, config=CONFIG)
|
|
2053
|
+
args, rest = parse_acquire_args(parser, config=CONFIG)
|
|
2096
2054
|
|
|
2097
2055
|
# start GUI if requested through CLI / config
|
|
2098
2056
|
flavour = None
|
|
@@ -2144,26 +2102,6 @@ def main() -> None:
|
|
|
2144
2102
|
log.exception(err)
|
|
2145
2103
|
parser.exit(1)
|
|
2146
2104
|
|
|
2147
|
-
if args.targetd:
|
|
2148
|
-
from targetd.tools.targetd import start_client
|
|
2149
|
-
|
|
2150
|
-
# set @auto hostname to real hostname
|
|
2151
|
-
if args.targetd_hostname == "@auto":
|
|
2152
|
-
args.targetd_hostname = f"/host/{Target.open('local').hostname}"
|
|
2153
|
-
|
|
2154
|
-
config = {
|
|
2155
|
-
"function": args.targetd_func,
|
|
2156
|
-
"topics": [args.targetd_hostname, args.targetd_groupname, args.targetd_globalname],
|
|
2157
|
-
"link": args.targetd_link,
|
|
2158
|
-
"address": args.targetd_ip,
|
|
2159
|
-
"port": args.targetd_port,
|
|
2160
|
-
"cacert_str": args.targetd_cacert,
|
|
2161
|
-
"service": args.targetd_func == "agent",
|
|
2162
|
-
"cacert": None,
|
|
2163
|
-
}
|
|
2164
|
-
start_client(args, presets=config)
|
|
2165
|
-
return
|
|
2166
|
-
|
|
2167
2105
|
if args.upload:
|
|
2168
2106
|
try:
|
|
2169
2107
|
upload_files(args.upload, args.upload_plugin, args.no_proxy)
|
|
@@ -2171,43 +2109,44 @@ def main() -> None:
|
|
|
2171
2109
|
log.exception("Failed to upload files")
|
|
2172
2110
|
return
|
|
2173
2111
|
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
target_query.update({"force-directory-fs": 1})
|
|
2112
|
+
target_paths = []
|
|
2113
|
+
for target_path in args.targets:
|
|
2114
|
+
target_path = args_to_uri([target_path], args.loader, rest)[0] if args.loader else target_path
|
|
2115
|
+
if target_path == "local":
|
|
2116
|
+
target_query = {}
|
|
2117
|
+
if args.force_fallback:
|
|
2118
|
+
target_query.update({"force-directory-fs": 1})
|
|
2182
2119
|
|
|
2183
|
-
|
|
2184
|
-
|
|
2120
|
+
if args.fallback:
|
|
2121
|
+
target_query.update({"fallback-to-directory-fs": 1})
|
|
2185
2122
|
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
log.info("Loading target %s", target_path)
|
|
2123
|
+
target_query = urllib.parse.urlencode(target_query)
|
|
2124
|
+
target_path = f"{target_path}?{target_query}"
|
|
2125
|
+
target_paths.append(target_path)
|
|
2190
2126
|
|
|
2191
2127
|
try:
|
|
2192
|
-
|
|
2193
|
-
|
|
2128
|
+
target_name = "Unknown" # just in case open_all already fails
|
|
2129
|
+
for target in Target.open_all(target_paths):
|
|
2130
|
+
target_name = "Unknown" # overwrite previous target name
|
|
2131
|
+
target_name = target.name
|
|
2132
|
+
log.info("Loading target %s", target_name)
|
|
2133
|
+
log.info(target)
|
|
2134
|
+
if target.os == "esxi" and target.name == "local":
|
|
2135
|
+
# Loader found that we are running on an esxi host
|
|
2136
|
+
# Perform operations to "enhance" memory
|
|
2137
|
+
with esxi_memory_context_manager():
|
|
2138
|
+
acquire_children_and_targets(target, args)
|
|
2139
|
+
else:
|
|
2140
|
+
acquire_children_and_targets(target, args)
|
|
2194
2141
|
except Exception:
|
|
2195
2142
|
if not is_user_admin():
|
|
2196
|
-
log.error("Failed to load target, try re-running as administrator/root
|
|
2143
|
+
log.error("Failed to load target: %s, try re-running as administrator/root", target_name)
|
|
2197
2144
|
acquire_gui.message("This application must be run as administrator.")
|
|
2198
2145
|
acquire_gui.wait_for_quit()
|
|
2199
2146
|
parser.exit(1)
|
|
2200
|
-
log.exception("Failed to load target")
|
|
2147
|
+
log.exception("Failed to load target: %s", target_name)
|
|
2201
2148
|
raise
|
|
2202
2149
|
|
|
2203
|
-
if target.os == "esxi" and target.name == "local":
|
|
2204
|
-
# Loader found that we are running on an esxi host
|
|
2205
|
-
# Perform operations to "enhance" memory
|
|
2206
|
-
with esxi_memory_context_manager():
|
|
2207
|
-
acquire_children_and_targets(target, args)
|
|
2208
|
-
else:
|
|
2209
|
-
acquire_children_and_targets(target, args)
|
|
2210
|
-
|
|
2211
2150
|
|
|
2212
2151
|
def load_child(target: Target, child_path: Path) -> None:
|
|
2213
2152
|
log.info("")
|
|
@@ -17,20 +17,6 @@ from dissect.target import Target
|
|
|
17
17
|
from acquire.outputs import OUTPUTS
|
|
18
18
|
from acquire.uploaders.plugin_registry import UploaderRegistry
|
|
19
19
|
|
|
20
|
-
# Acquire Configuration for CAgent and TargetD
|
|
21
|
-
CAGENT_TARGETD_ATTRS = {
|
|
22
|
-
"cagent_key",
|
|
23
|
-
"cagent_certificate",
|
|
24
|
-
"targetd_func",
|
|
25
|
-
"targetd_cacert",
|
|
26
|
-
"targetd_ip",
|
|
27
|
-
"targetd_port",
|
|
28
|
-
"targetd_hostname",
|
|
29
|
-
"targetd_groupname",
|
|
30
|
-
"targetd_globalname",
|
|
31
|
-
"targetd_link",
|
|
32
|
-
}
|
|
33
|
-
|
|
34
20
|
|
|
35
21
|
class StrEnum(str, Enum):
|
|
36
22
|
"""Sortable and serializible string-based enum"""
|
|
@@ -78,13 +64,7 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg
|
|
|
78
64
|
fromfile_prefix_chars="@",
|
|
79
65
|
)
|
|
80
66
|
|
|
81
|
-
parser.add_argument(
|
|
82
|
-
"target",
|
|
83
|
-
metavar="TARGET",
|
|
84
|
-
default="local",
|
|
85
|
-
nargs="?",
|
|
86
|
-
help="target to load (default: local)",
|
|
87
|
-
)
|
|
67
|
+
parser.add_argument("targets", metavar="TARGETS", default=["local"], nargs="*", help="Targets to load")
|
|
88
68
|
# Create a mutually exclusive group, such that only one of the output options can be used
|
|
89
69
|
output_group = parser.add_mutually_exclusive_group()
|
|
90
70
|
output_group.add_argument("-o", "--output", default=Path("."), type=Path, help="output directory")
|
|
@@ -102,11 +82,6 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg
|
|
|
102
82
|
action="store_true",
|
|
103
83
|
help="compress output (if supported by the output type)",
|
|
104
84
|
)
|
|
105
|
-
parser.add_argument(
|
|
106
|
-
"--targetd",
|
|
107
|
-
action="store_true",
|
|
108
|
-
help="setup and install targetd agent",
|
|
109
|
-
)
|
|
110
85
|
parser.add_argument(
|
|
111
86
|
"--encrypt",
|
|
112
87
|
action="store_true",
|
|
@@ -123,6 +98,13 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg
|
|
|
123
98
|
parser.add_argument("--public-key", type=Path, help=argparse.SUPPRESS)
|
|
124
99
|
parser.add_argument("-l", "--log", type=Path, help="log directory location")
|
|
125
100
|
parser.add_argument("--no-log", action="store_true", help=argparse.SUPPRESS)
|
|
101
|
+
parser.add_argument(
|
|
102
|
+
"-L",
|
|
103
|
+
"--loader",
|
|
104
|
+
action="store",
|
|
105
|
+
default=None,
|
|
106
|
+
help="select a specific loader (i.e. vmx, raw)",
|
|
107
|
+
)
|
|
126
108
|
parser.add_argument("-p", "--profile", choices=profiles.keys(), help="collection profile")
|
|
127
109
|
parser.add_argument("--volatile-profile", choices=volatile.keys(), help="volatile profile")
|
|
128
110
|
|
|
@@ -178,7 +160,7 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg
|
|
|
178
160
|
def parse_acquire_args(
|
|
179
161
|
parser: argparse.ArgumentParser,
|
|
180
162
|
config: dict[str, Any],
|
|
181
|
-
) -> argparse.Namespace:
|
|
163
|
+
) -> tuple[argparse.Namespace, list[str]]:
|
|
182
164
|
"""Parse and set the acquire command line arguments.
|
|
183
165
|
|
|
184
166
|
The arguments are set to values supplied in ``config[arguments]``, when not
|
|
@@ -194,10 +176,10 @@ def parse_acquire_args(
|
|
|
194
176
|
Returns:
|
|
195
177
|
A command line arguments namespace
|
|
196
178
|
"""
|
|
197
|
-
command_line_args = parser.
|
|
179
|
+
command_line_args, rest = parser.parse_known_args()
|
|
198
180
|
_merge_args_and_config(parser, command_line_args, config)
|
|
199
181
|
|
|
200
|
-
return command_line_args
|
|
182
|
+
return command_line_args, rest
|
|
201
183
|
|
|
202
184
|
|
|
203
185
|
def _merge_args_and_config(
|
|
@@ -264,10 +246,10 @@ def check_and_set_log_args(args: argparse.Namespace):
|
|
|
264
246
|
# Logging to a single file is allowed, even if the file does not yet
|
|
265
247
|
# exist, as it will be automatically created. However then the parent
|
|
266
248
|
# directory must exist.
|
|
267
|
-
if args.children:
|
|
268
|
-
# If children are acquired, logging can only happen to separate
|
|
249
|
+
if args.children or len(args.targets) > 1:
|
|
250
|
+
# If children or multiple targets are acquired, logging can only happen to separate
|
|
269
251
|
# files, so log_path needs to be a directory.
|
|
270
|
-
raise ValueError("Log path must be a directory when using --children")
|
|
252
|
+
raise ValueError("Log path must be a directory when using multiple targets or --children")
|
|
271
253
|
else:
|
|
272
254
|
raise ValueError(f"Log path doesn't exist: {log_path}")
|
|
273
255
|
|
|
@@ -312,7 +294,7 @@ def check_and_set_acquire_args(
|
|
|
312
294
|
|
|
313
295
|
if not args.upload:
|
|
314
296
|
# check output related configuration
|
|
315
|
-
if args.children and args.output_file:
|
|
297
|
+
if (args.children or len(args.targets) > 1) and args.output_file:
|
|
316
298
|
raise ValueError("--children can not be used with --output_file. Use --output instead")
|
|
317
299
|
elif args.output_file and (not args.output_file.parent.is_dir() or args.output_file.is_dir()):
|
|
318
300
|
raise ValueError("--output_file must be a path to a file in an existing directory")
|
|
@@ -328,10 +310,6 @@ def check_and_set_acquire_args(
|
|
|
328
310
|
raise ValueError("No public key available (embedded or argument)")
|
|
329
311
|
setattr(args, "public_key", public_key)
|
|
330
312
|
|
|
331
|
-
# set cagent/targetd related configuration
|
|
332
|
-
for attr in CAGENT_TARGETD_ATTRS:
|
|
333
|
-
setattr(args, attr, args.config.get(attr))
|
|
334
|
-
|
|
335
313
|
if not args.children and args.skip_parent:
|
|
336
314
|
raise ValueError("--skip-parent can only be set with --children")
|
|
337
315
|
|
|
@@ -12,5 +12,5 @@ __version__: str
|
|
|
12
12
|
__version_tuple__: VERSION_TUPLE
|
|
13
13
|
version_tuple: VERSION_TUPLE
|
|
14
14
|
|
|
15
|
-
__version__ = version = '3.14.
|
|
16
|
-
__version_tuple__ = version_tuple = (3, 14, '
|
|
15
|
+
__version__ = version = '3.14.dev8'
|
|
16
|
+
__version_tuple__ = version_tuple = (3, 14, 'dev8')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: acquire
|
|
3
|
-
Version: 3.14.
|
|
3
|
+
Version: 3.14.dev8
|
|
4
4
|
Summary: A tool to quickly gather forensic artifacts from disk images or a live system into a lightweight container
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -18,7 +18,7 @@ from acquire.acquire import (
|
|
|
18
18
|
def acquire_parser_args(config: List, argument_list: List) -> Namespace:
|
|
19
19
|
CONFIG["arguments"] = config
|
|
20
20
|
with patch("argparse._sys.argv", [""] + argument_list):
|
|
21
|
-
return parse_acquire_args(create_argument_parser(PROFILES, VOLATILE, MODULES), config=CONFIG)
|
|
21
|
+
return parse_acquire_args(create_argument_parser(PROFILES, VOLATILE, MODULES), config=CONFIG)[0]
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
@pytest.mark.parametrize("config, argument_list", [([], [])])
|
|
@@ -34,3 +34,8 @@ def test_one_config_default_argument(acquire_parser_args):
|
|
|
34
34
|
@pytest.mark.parametrize("config, argument_list", [(["-f", "test"], ["-f", "best"])])
|
|
35
35
|
def test_config_default_argument_override(acquire_parser_args):
|
|
36
36
|
assert acquire_parser_args.file == ["best"]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@pytest.mark.parametrize("config, argument_list", [([], ["target1", "target2"])])
|
|
40
|
+
def test_local_target_fallbactargets(acquire_parser_args):
|
|
41
|
+
assert acquire_parser_args.targets == ["target1", "target2"]
|
|
@@ -110,7 +110,7 @@ def test_check_and_set_log_args(
|
|
|
110
110
|
def test_check_and_set_log_args_fail_log_to_file_with_children() -> None:
|
|
111
111
|
mock_path = get_mock_path(is_dir=False)
|
|
112
112
|
args = get_args(log=mock_path, children=True)
|
|
113
|
-
with pytest.raises(ValueError, match="Log path must be a directory when using --children"):
|
|
113
|
+
with pytest.raises(ValueError, match="Log path must be a directory when using multiple targets or --children"):
|
|
114
114
|
check_and_set_log_args(args)
|
|
115
115
|
|
|
116
116
|
|
|
@@ -141,11 +141,6 @@ def test_check_and_set_acquire_args_upload_auto_upload(arg_name: str) -> None:
|
|
|
141
141
|
args = get_args(**{arg_name: True, "config": config})
|
|
142
142
|
check_and_set_acquire_args(args, upload_plugins)
|
|
143
143
|
|
|
144
|
-
if arg_name == "upload":
|
|
145
|
-
assert "cagent_key" not in args
|
|
146
|
-
else:
|
|
147
|
-
assert args.cagent_key == cagent_key
|
|
148
|
-
|
|
149
144
|
|
|
150
145
|
@pytest.mark.parametrize(
|
|
151
146
|
"arg_name",
|
|
@@ -307,20 +302,6 @@ def test_check_and_set_acquire_args_encrypt_without_public_key_fail(public_key:
|
|
|
307
302
|
check_and_set_acquire_args(args, MagicMock())
|
|
308
303
|
|
|
309
304
|
|
|
310
|
-
def test_check_and_set_acquire_args_cagent() -> None:
|
|
311
|
-
cagent_key = "KEY"
|
|
312
|
-
cagent_certificate = "CERT"
|
|
313
|
-
config = {
|
|
314
|
-
"cagent_key": cagent_key,
|
|
315
|
-
"cagent_certificate": cagent_certificate,
|
|
316
|
-
}
|
|
317
|
-
args = get_args(config=config)
|
|
318
|
-
check_and_set_acquire_args(args, MagicMock())
|
|
319
|
-
|
|
320
|
-
assert args.cagent_key == cagent_key
|
|
321
|
-
assert args.cagent_certificate == cagent_certificate
|
|
322
|
-
|
|
323
|
-
|
|
324
305
|
@pytest.mark.parametrize(
|
|
325
306
|
"path, sysvol, resolve, lower_case, case_sensitive, os, result",
|
|
326
307
|
[
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|