fortrace.utility package
Subpackages
- fortrace.utility.applications package
- Subpackages
- Submodules
- fortrace.utility.applications.application module
ApplicationEventApplicationTypeFileDialogueGenericApplicationGenericApplication.close()GenericApplication.coordinatesGenericApplication.extract_text()GenericApplication.focus_element()GenericApplication.focusedGenericApplication.nameGenericApplication.open_popup()GenericApplication.perform_complex_action()GenericApplication.send_key_combination()GenericApplication.send_text()GenericApplication.sizeGenericApplication.take_screenshot()GenericApplication.uuid
GenericPopupParentNotifierPopupType
- fortrace.utility.applications.application_factory module
- Module contents
- fortrace.utility.console_applications package
- Subpackages
- Submodules
- fortrace.utility.console_applications.console_application module
- fortrace.utility.console_applications.console_application_factory module
- fortrace.utility.console_applications.metasploit_console module
- Module contents
- fortrace.utility.desktop_environments package
- Subpackages
- Submodules
- fortrace.utility.desktop_environments.desktop_environment module
DesktopEnvironmentDesktopEnvironment.active_applicationDesktopEnvironment.close_application()DesktopEnvironment.focus_application()DesktopEnvironment.get_application()DesktopEnvironment.is_application_open()DesktopEnvironment.lock_screen()DesktopEnvironment.login()DesktopEnvironment.maximize_application()DesktopEnvironment.open_application()DesktopEnvironment.qemu_monitor_sessionDesktopEnvironment.session_unlockedDesktopEnvironment.show_desktop()DesktopEnvironment.system_power_down()
- fortrace.utility.desktop_environments.desktop_environment_factory module
- Module contents
- fortrace.utility.image_processing package
- fortrace.utility.server_interaction package
Submodules
fortrace.utility.create_volatility_profile module
fortrace.utility.distribution_constants module
- class fortrace.utility.distribution_constants.DesktopEnvironmentType(*values)[source]
Bases:
EnumDesktop environment types.
- Budgie = 1
- Cinnamon = 2
- Cutefish = 3
- Deepin_Desktop_Environment = 4
- Enlightenment = 5
- GNOME = 6
- KDE_Plasma = 7
- LXDE = 8
- LXQt = 9
- MATE = 10
- Sugar = 11
- UKUI = 12
- Windows_10 = 14
- Windows_11 = 15
- Xfce = 13
- class fortrace.utility.distribution_constants.Distribution(*values)[source]
Bases:
EnumLinux distributions.
- ARCH = 3
- DEBIAN = 2
- OpenSUSE = 4
- UBUNTU = 1
- class fortrace.utility.distribution_constants.OSType(*values)[source]
Bases:
EnumOperating System types.
- LINUX = 2
- MACOS = 1
- WINDOWS = 3
fortrace.utility.exceptions module
ForTrace specific exceptions.
- exception fortrace.utility.exceptions.ConfigurationError(*args)[source]
Bases:
ForTraceExceptionConfiguration-specific exception
- exception fortrace.utility.exceptions.DesktopEnvironmentException(*args)[source]
Bases:
ForTraceExceptionTo be thrown from desktop environment, if something unpredicted has happened.
- exception fortrace.utility.exceptions.DomainException(*args)[source]
Bases:
ForTraceExceptionTo be thrown when something cannot be done with a domain
- exception fortrace.utility.exceptions.ForTraceException(*args)[source]
Bases:
ExceptionGeneric ForTrace specific exception, to help differentiate from other exceptions. All other custom exceptions have to inherit this class.
- exception fortrace.utility.exceptions.GeneratorException(*args)[source]
Bases:
ForTraceExceptionTo be thrown from the Generator
- exception fortrace.utility.exceptions.MultiStageAttackException(*args)[source]
Bases:
ForTraceExceptionMulti-stage attack exception, thrown when something is not working during an attack
- exception fortrace.utility.exceptions.ServerInteractionException(*args)[source]
Bases:
ForTraceExceptionServer interaction exception, thrown when interaction with server encounters an issue
- exception fortrace.utility.exceptions.SetupException(*args)[source]
Bases:
ForTraceExceptionTo be thrown if something unexpected happens during a setup process
fortrace.utility.file_generator module
fortrace.utility.logger_helper module
- class fortrace.utility.logger_helper.CustomFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]
Bases:
FormatterCustomFormatter, providing colorful output to the console.
- FORMATS = {10: '\x1b[38;20m[%(threadName)16s] :: %(asctime)s - %(levelname)-8s - %(message)s\x1b[0m', 20: '\x1b[38;20m[%(threadName)16s] :: %(asctime)s - %(levelname)-8s - %(message)s\x1b[0m', 30: '\x1b[33;20m[%(threadName)16s] :: %(asctime)s - %(levelname)-8s - %(message)s\x1b[0m', 40: '\x1b[31;20m[%(threadName)16s] :: %(asctime)s - %(levelname)-8s - %(message)s\x1b[0m', 50: '\x1b[31;1m[%(threadName)16s] :: %(asctime)s - %(levelname)-8s - %(message)s\x1b[0m'}
- bold_red = '\x1b[31;1m'
- format(record)[source]
Format the specified record as text.
The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
- grey = '\x1b[38;20m'
- log_msg_format = '[%(threadName)16s] :: %(asctime)s - %(levelname)-8s - %(message)s'
- red = '\x1b[31;20m'
- reset = '\x1b[0m'
- yellow = '\x1b[33;20m'
- fortrace.utility.logger_helper.setup_logger(name: str) Logger[source]
Create a logger with the specified name.
Please refer to https://docs.python.org/3/howto/logging-cookbook.html for more information. Especially relevant is https://docs.python.org/3/howto/logging-cookbook.html#patterns-to-avoid
- Parameters:
name – name of the logger to be created. Should be __name__ in most cases
- Returns:
a new logger instance
fortrace.utility.server_setup module
- class fortrace.utility.server_setup.LinuxServerSetup(server: VirshDomain, config: dict)[source]
Bases:
ServerSetupHandle Linux server setup.
- class fortrace.utility.server_setup.ServerSetup(server: VirshDomain, config: dict)[source]
Bases:
ABCInterface to handle setup of servers participating on the scenario.
- class fortrace.utility.server_setup.WindowsServerSetup(server: VirshDomain, config: dict)[source]
Bases:
ServerSetupClass to handle Windows Server setup.
fortrace.utility.string_filtering module
- fortrace.utility.string_filtering.ansi_escape(string: str) str[source]
Strips all ANSI escape characters of the provided string.
- Parameters:
string – string to be stripped of ansi characters
- Returns:
stripped string
- fortrace.utility.string_filtering.unicode_control_escape(string: str) str[source]
Escape all control characters of a unicode string.
References
https://stackoverflow.com/questions/4324790/removing-control-characters-from-a-string-in-python
- Parameters:
string – string to be stripped of unicode control characters
- Returns:
stripped string
fortrace.utility.usb_drive module
fortrace.utility.web_scraper module
- fortrace.utility.web_scraper.scrape_web_page(url: str | Url, element: Literal['a', 'img']) list[Url][source]
Scrape a web page for all urls behind certain elements.
- Parameters:
url – the web page to be scraped
element – which kind of element links should be scraped from the page
- Returns:
list of all urls from the web page (relative ones will be made absolute)
Module contents
A package full of utilities (i.e. ipaddr, macAddr, exceptions..)