add curl tool

This commit is contained in:
Mery-Sanz 2025-01-10 16:10:40 +00:00
parent d92d8519ef
commit 2ba488d1e4
1 changed files with 6 additions and 4 deletions

View File

@ -1,11 +1,13 @@
from cai.tools.common import run_command
"""
Here are the curl tools.
"""
def curl(args: str, target: str, ctf=None) -> str:
from cai.tools.common import run_command # pylint: disable=import-error
def curl(args: str = "", target: str = "", ctf=None) -> str:
"""
A simple curl tool to make HTTP requests to a specified target.
Args:
args: Additional arguments to pass to the curl command
target: The target URL to request
@ -14,4 +16,4 @@ def curl(args: str, target: str, ctf=None) -> str:
str: The output of running the curl command
"""
command = f'curl {args} {target}'
return run_command(command, ctf=ctf)
return run_command(command, ctf=ctf)