From 59bdc3dd5ea621cd066efdbbf659bb491d341597 Mon Sep 17 00:00:00 2001 From: cecinestpasunepipe <110607403+cecinestpasunepipe@users.noreply.github.com> Date: Fri, 20 Oct 2023 12:44:42 +0200 Subject: [PATCH] Add support for targetd agent to acquire (DIS-2522). --- acquire/acquire.py | 15 +++++++++++++++ acquire/utils.py | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/acquire/acquire.py b/acquire/acquire.py index 2afba85e..2360494e 100644 --- a/acquire/acquire.py +++ b/acquire/acquire.py @@ -2166,6 +2166,21 @@ def main() -> None: except ValueError as err: parser.exit(err) + if args.targetd: + from targetd.tools.targetd import get_platform_server_link, start_client + + # Configure your targetd agent here + config = { + "function": "agent", + "topics": ["/host/a", "/host/*"], + "link": "pipe-server://tmp/b", + "address": "10.0.2.3", + "port": 1884, + "cacert": Path("targetd.crt"), + } + start_client(args, presets=config) + parser.exit("Done") + if args.log_to_dir: # When args.upload files are specified, only these files are uploaded # and no other action is done. Thus a log file specifically named diff --git a/acquire/utils.py b/acquire/utils.py index 203d96ae..f7384191 100644 --- a/acquire/utils.py +++ b/acquire/utils.py @@ -73,6 +73,11 @@ def create_argument_parser(profiles: dict, modules: dict) -> argparse.ArgumentPa action="store_true", help="compress output (if supported by the output type)", ) + parser.add_argument( + "--targetd", + action="store_true", + help="Setup and install targetd agent", + ) parser.add_argument( "--encrypt", action="store_true",