ctfsolver.managers.manager_file¶
manager_file.py
This module defines the ManagerFile class, which serves as a unified interface for file and folder management operations within the CTF solver application. It inherits functionality from ManagerFilePcap, ManagerFileRegex, and ManagerFolder, enabling support for pcap file handling, regex-based file searches, and folder management.
- Classes:
ManagerFile: Combines methods from multiple manager classes to provide comprehensive file and folder operations, including searching for base64-encoded strings within files.
- Usage:
Instantiate ManagerFile to access file and folder management utilities, such as searching for patterns or handling specific file types.
Note
Some methods are deprecated and may be replaced by more specific implementations.
Classes¶
ManagerFile class for handling file operations in CTF solving context. |
Module Contents¶
- class ManagerFile(*args, **kwargs)[source]¶
Bases:
ctfsolver.managers.manager_files_pcap.ManagerFilePcap,ctfsolver.managers.manager_files_re.ManagerFileRegex,ctfsolver.managers.manager_folder.ManagerFolder,ctfsolver.managers.manager_functions.ManagerFunctionManagerFile class for handling file operations in CTF solving context. This class inherits from ManagerFilePcap, ManagerFileRegex, ManagerFolder, and ManagerFunction, providing methods for initializing file-related ancestors and searching for base64 strings within files. .. attribute:: None
- initializing_file_ancestors(*args, **kwargs)[source]¶
Initializes ManagerFolder and ManagerFilePcap ancestors.
- search_for_base64_file(file, *args, **kwargs)[source]¶
- Searches for base64 strings in the specified file.
file (str): Path to the file to search. display (bool, optional): If True, prints the output. Defaults to False. save (bool, optional): If True, returns the output as a list. Defaults to False. strict (bool, optional): If True, applies strict matching. Defaults to False. list: List of matched base64 strings if save is True; otherwise, None.
- initializing_file_ancestors(*args, **kwargs)[source]¶
Initializes the file ancestor managers for the current instance. This method explicitly calls the initializers of ManagerFolder and ManagerFilePcap with the provided arguments, ensuring that the current object is properly set up with folder and file pcap management capabilities. :param *args: Variable length argument list passed to the ancestor initializers. :param **kwargs: Arbitrary keyword arguments passed to the ancestor initializers.
- Returns:
None