From d8303b2e987a1b2fdedadc89bddbde6334d23945 Mon Sep 17 00:00:00 2001 From: Giveen Date: Sun, 14 Dec 2025 13:38:45 -0700 Subject: [PATCH] add string extraction tool - Added StringExtractionTool using the 'strings' command to extract printable strings from binary files - Updated the commented tool list to remove StringExtractionTool from the deprecated section - All new tools leverage the existing generic_linux_command security infrastructure - The string_extraction tool provides specialized filesystem reconnaissance capabilities for analyzing binary files --- src/cai/tools/reconnaissance/filesystem.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/cai/tools/reconnaissance/filesystem.py b/src/cai/tools/reconnaissance/filesystem.py index da40fd6b..e8476ea3 100644 --- a/src/cai/tools/reconnaissance/filesystem.py +++ b/src/cai/tools/reconnaissance/filesystem.py @@ -88,11 +88,25 @@ def file_permissions(file_path: str, args: str = "", ctf=None) -> str: command = f'ls -la {args} "{file_path}"' return run_command(command, ctf=ctf) +@function_tool +def string_extraction(file_path: str, args: str = "", ctf=None) -> str: + """ + Extract printable strings from a file. + + Args: + file_path: Path to the file to extract strings from + args: Additional arguments to pass to the strings command + + Returns: + str: The output of running the strings command + """ + command = f'strings {args} "{file_path}"' + return run_command(command, ctf=ctf) + # FileSearchTool # ListDirTool # TextSearchTool # FileAnalysisTool -# StringExtractionTool # ReadFileTool # FilePermissionsTool # FileCompressionTool