From d92d8519efad09aab0cb15d56ebf749834d5a805 Mon Sep 17 00:00:00 2001 From: Mery-Sanz Date: Fri, 10 Jan 2025 16:08:41 +0000 Subject: [PATCH] add generic linux command tool --- .../reconnaissance/generic_linux_command.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cai/tools/reconnaissance/generic_linux_command.py b/cai/tools/reconnaissance/generic_linux_command.py index e69de29b..27de5856 100644 --- a/cai/tools/reconnaissance/generic_linux_command.py +++ b/cai/tools/reconnaissance/generic_linux_command.py @@ -0,0 +1,19 @@ +""" +This is used to create a generic linux command. +""" +from cai.tools.common import run_command # pylint: disable=import-error + + +def generic_linux_command(command: str = "", args: str = "", ctf=None) -> str: + """ + A simple tool to do a linux command. + + Args: + command: The name of the command + args: Additional arguments to pass to the command + + Returns: + str: The output of running the linux command + """ + command = f'{command} {args}' + return run_command(command, ctf=ctf)