From 8038d4e5dd0b5d441f017a22c0f1f7107c36a2e4 Mon Sep 17 00:00:00 2001 From: DefinetlyNotAI Date: Thu, 21 Nov 2024 08:11:55 +0400 Subject: [PATCH 1/8] Fixed bug in attempt_hide() It fails due to issues with windows using those processes - Removed the feature --- CODE/Logicytics.py | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/CODE/Logicytics.py b/CODE/Logicytics.py index 12dea4a..41cecdf 100644 --- a/CODE/Logicytics.py +++ b/CODE/Logicytics.py @@ -1,6 +1,5 @@ from __future__ import annotations -import datetime import threading from typing import Any @@ -269,24 +268,6 @@ def generate_execution_list(actions: str) -> list | list[str] | list[str | Any]: return execution_list -def attempt_hide(): - """ - Attempts to delete Windows event logs from the current day. - - Parameters: - None - - Returns: - None - """ - today = datetime.date.today() - log_path = r"C:\Windows\System32\winevt\Logs" - - for file in os.listdir(log_path): - if file.endswith(".evtx") and file.startswith(today.strftime("%Y-%m-%d")): - subprocess.run(f'del "{os.path.join(log_path, file)}"', shell=False) - - def execute_scripts(): """Executes the scripts in the execution list based on the action.""" # Check weather to use threading or not, as well as execute code @@ -363,10 +344,9 @@ def handle_sub_action(): # log.warning("This feature is not implemented yet! Sorry") -# Initialization -FileManagement.mkdir() - if __name__ == "__main__": + # Initialization + FileManagement.mkdir() log = Log({"log_level": DEBUG}) # Get flags and configs action, sub_action = get_flags() @@ -374,13 +354,13 @@ def handle_sub_action(): handle_special_actions() # Check for privileges and errors check_privileges() + """ # Execute scripts log.info("Starting Logicytics...") execute_scripts() + """ # Zip generated files zip_generated_files() - # Attempt event log deletion - attempt_hide() # Finish with sub actions log.info("Completed successfully!") # Finish with sub actions From 0313a04a7c5e43bd19752ec80e7bc270f5a39e92 Mon Sep 17 00:00:00 2001 From: DefinetlyNotAI Date: Thu, 21 Nov 2024 08:21:47 +0400 Subject: [PATCH 2/8] Added log decorator to functions Now you can add a decorator to log in debug that your function is being run, fixed minor bugs as well --- CODE/Logicytics.py | 4 ++-- CODE/__lib_class.py | 6 ++---- CODE/__lib_log.py | 46 ++++++++++++++++++++++++------------------- MODS/_MOD_SKELETON.py | 5 +++++ 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/CODE/Logicytics.py b/CODE/Logicytics.py index 41cecdf..0d9a7c1 100644 --- a/CODE/Logicytics.py +++ b/CODE/Logicytics.py @@ -275,7 +275,7 @@ def execute_scripts(): def threaded_execution(execution_list_thread, index_thread): log.debug(f"Thread {index_thread} started") try: - log.execute_log_parse(Execute.script(execution_list_thread[index_thread])) + log.parse_execution(Execute.script(execution_list_thread[index_thread])) log.info(f"{execution_list_thread[index_thread]} executed") except UnicodeDecodeError as err: log.error(f"Error in thread: {err}") @@ -303,7 +303,7 @@ def threaded_execution(execution_list_thread, index_thread): try: execution_list = generate_execution_list(action) for file in range(len(execution_list)): # Loop through List - log.execute_log_parse(Execute.script(execution_list[file])) + log.parse_execution(Execute.script(execution_list[file])) log.info(f"{execution_list[file]} executed") except UnicodeDecodeError as e: log.error(f"Error in code: {e}") diff --git a/CODE/__lib_class.py b/CODE/__lib_class.py index f6bc591..24637df 100644 --- a/CODE/__lib_class.py +++ b/CODE/__lib_class.py @@ -4,16 +4,14 @@ import ctypes import hashlib import json -import os import os.path import shutil import subprocess import zipfile -from datetime import datetime from pathlib import Path from subprocess import CompletedProcess -from __lib_log import Log +from __lib_log import * class Flag: @@ -316,7 +314,7 @@ class Zip: __move_files(filename: str): Moves the zip file and its hash file to designated directories. - and_hash(self, path: str, name: str, flag: str) -> tuple | str: + and_hash(cls, path: str, name: str, flag: str) -> tuple | str: Zips files, generates a SHA256 hash, and moves the files. """ diff --git a/CODE/__lib_log.py b/CODE/__lib_log.py index 26fd6b2..07482d7 100644 --- a/CODE/__lib_log.py +++ b/CODE/__lib_log.py @@ -102,6 +102,25 @@ def __pad_message(message: str) -> str: else message[:150] + "..." ) + "|" + def __internal(self, message): + """ + Logs an internal message. + + :param message: The internal message to be logged. + """ + if self.color and message != "None" and message is not None: + colorlog.log(self.INTERNAL_LOG_LEVEL, str(message)) + + @staticmethod + def debug(message): + """ + Logs a debug message. + + :param message: The debug message to be logged. + """ + if message != "None" and message is not None: + colorlog.debug(str(message)) + def raw(self, message): """ Logs a raw message directly to the log file. @@ -172,16 +191,6 @@ def critical(self, message): f"[{self.__timestamp()}] > CRITICAL: | {self.__pad_message(str(message))}" ) - @staticmethod - def debug(message): - """ - Logs a debug message. - - :param message: The debug message to be logged. - """ - if message != "None" and message is not None: - colorlog.debug(str(message)) - def string(self, message, type: str): """ Logs a message with a specified type. Supported types are 'debug', 'info', 'warning', 'error', 'critical' @@ -212,21 +221,18 @@ def exception(self, message, exception_type: Type = Exception): ) raise exception_type(message) - def __internal(self, message): - """ - Logs an internal message. - - :param message: The internal message to be logged. - """ - if self.color and message != "None" and message is not None: - colorlog.log(self.INTERNAL_LOG_LEVEL, str(message)) - - def execute_log_parse(self, message_log): + def parse_execution(self, message_log: list[list[str]]): if message_log: for message_list in message_log: if len(message_list) == 2: self.string(message_list[0], message_list[1]) + def function(self, func: callable): + def wrapper(*args, **kwargs): + self.debug(f"Running the function {func.__name__}().") + return func(*args, **kwargs) + return wrapper + if __name__ == "__main__": Log().exception( diff --git a/MODS/_MOD_SKELETON.py b/MODS/_MOD_SKELETON.py index ef6a999..4ad0127 100644 --- a/MODS/_MOD_SKELETON.py +++ b/MODS/_MOD_SKELETON.py @@ -16,6 +16,10 @@ # Example of said code:- +# You can enable this decorator to log the function name and the time it took to run, +# It is recommended to use this, +# as it only logs the function and the time it took to run in debug mode +# @log.function def MOD_EXAMPLE() -> None: """ This function MOD is used to log different types of messages. @@ -43,3 +47,4 @@ def MOD_EXAMPLE() -> None: MOD_EXAMPLE() # Always remember to call your function at the end of the file and then leave a new line +# This is to ensure that the function is called and the file is not empty From be240f58b6a9a217e1b50c865b271b8abe717926 Mon Sep 17 00:00:00 2001 From: DefinetlyNotAI Date: Thu, 21 Nov 2024 08:30:23 +0400 Subject: [PATCH 3/8] Added extra plan Also made sure the decorator doesn't fail if function is non-callable --- CODE/__lib_log.py | 10 +++++++++- PLANS.md | 31 ++++++++++++++++--------------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/CODE/__lib_log.py b/CODE/__lib_log.py index 07482d7..3802e00 100644 --- a/CODE/__lib_log.py +++ b/CODE/__lib_log.py @@ -229,8 +229,16 @@ def parse_execution(self, message_log: list[list[str]]): def function(self, func: callable): def wrapper(*args, **kwargs): + if not callable(func): + self.exception(f"Function {func.__name__} is not callable.", + TypeError) + start_time = datetime.now() self.debug(f"Running the function {func.__name__}().") - return func(*args, **kwargs) + result = func(*args, **kwargs) + end_time = datetime.now() + elapsed_time = end_time - start_time + self.debug(f"Function {func.__name__}() executed in {elapsed_time}.") + return result return wrapper diff --git a/PLANS.md b/PLANS.md index bb4b434..f041c92 100644 --- a/PLANS.md +++ b/PLANS.md @@ -5,18 +5,19 @@ > - ❌ = Might be done, Not sure yet > - ✅ = Will be done, 100% sure -| Task | Version | Might or Will be done? | -|---------------------------------------------------------------------------------------------------------------------------------|---------|------------------------| -| Remove \_wrapper.py as its useless | v2.4.3 | ✅ | -| Implement a parser for Windows Event Logs to extract and analyze security-related events. | v2.5.0 | ✅ | -| Enable integration with popular SIEM (Security Information and Event Management) systems. | v2.5.0 | ✅ | -| Add a tool to capture and analyse network traffic, which can help in forensic investigations. | v2.6.0 | ❌ | -| Change config.json to config.ini | v3.0.0 | ✅ | -| Integrate machine learning algorithms to detect anomalies and potential security threats automatically and log them. | v3.0.0 | ❌ | -| Update to Python 3.13 (And use the new @deprecated flag from now on) | v3.0.0 | ✅ | -| Add a tool to capture and analyse memory dumps, which can help in forensic investigations. | v3.1.0 | ❌ | -| Deprecate EXTRA dir, and zip features with custom proper features from Logicytics, as well as remove EXTRA wrapper | v3.2.0 | ❌ | -| Implement a parser for Windows Prefetch files, Shellbags, Jump Lists, LNK files to extract data | v3.3a.0 | ✅ | -| Implement a parser for Windows UserAssist registry key, SRUM database to extract data. | v3.3b.0 | ✅ | -| Implement a parser for Windows Volume Shadow Copy, LSA Secrets, Syscache, Shimcache, Amcache Event Tracing logs to extract data | v3.3c.0 | ✅ | -| Implement the 2 missing flags | v3.4.0 | ✅ | +| Task | Version | Might or Will be done? | +|-------------------------------------------------------------------------------------------------------------------------------------|---------|------------------------| +| Remove \_wrapper.py as its useless | v2.4.3 | ✅ | +| Implement a parser for Windows Event Logs to extract and analyze security-related events. | v2.5.0 | ✅ | +| Enable integration with popular SIEM (Security Information and Event Management) systems. | v2.5.0 | ✅ | +| Add a tool to capture and analyse network traffic, which can help in forensic investigations. | v2.6.0 | ❌ | +| Change config.json to config.ini | v3.0.0 | ✅ | +| Add "--perfomance-check" flag, which runs after normal execution, and shows in a neat table the exact time it took to execute files | v3.0.0 | ✅ | +| Integrate machine learning algorithms to detect anomalies and potential security threats automatically and log them. | v3.0.0 | ❌ | +| Update to Python 3.13 (And use the new @deprecated flag from now on) | v3.0.0 | ✅ | +| Add a tool to capture and analyse memory dumps, which can help in forensic investigations. | v3.1.0 | ❌ | +| Deprecate EXTRA dir, and zip features with custom proper features from Logicytics, as well as remove EXTRA wrapper | v3.2.0 | ❌ | +| Implement a parser for Windows Prefetch files, Shellbags, Jump Lists, LNK files to extract data | v3.3a.0 | ✅ | +| Implement a parser for Windows UserAssist registry key, SRUM database to extract data. | v3.3b.0 | ✅ | +| Implement a parser for Windows Volume Shadow Copy, LSA Secrets, Syscache, Shimcache, Amcache Event Tracing logs to extract data | v3.3c.0 | ✅ | +| Implement the 2 missing flags | v3.4.0 | ✅ | From 5ed565d16645c649ab939144822ebc060e1438a4 Mon Sep 17 00:00:00 2001 From: DefinetlyNotAI Date: Thu, 21 Nov 2024 08:41:19 +0400 Subject: [PATCH 4/8] Made all use the new decorator --- CODE/Logicytics.py | 32 +++++++++++++------------------- CODE/_debug.py | 9 +++++++-- CODE/_dev.py | 6 ++++-- CODE/_extra.py | 1 + CODE/cmd_commands.py | 1 + CODE/dir_list.py | 2 ++ CODE/log_miner.py | 1 + CODE/media_backup.py | 1 + CODE/registry.py | 1 + CODE/sensitive_data_miner.py | 1 + CODE/ssh_miner.py | 1 + CODE/sys_internal.py | 2 ++ CODE/tasklist.py | 1 + CODE/wifi_stealer.py | 4 ++++ CODE/wmic.py | 1 + MODS/_MOD_SKELETON.py | 10 +++++++--- 16 files changed, 48 insertions(+), 26 deletions(-) diff --git a/CODE/Logicytics.py b/CODE/Logicytics.py index 0d9a7c1..7296295 100644 --- a/CODE/Logicytics.py +++ b/CODE/Logicytics.py @@ -5,27 +5,15 @@ from __lib_class import * -""" -This python script is the main entry point for the tool called Logicytics. -The script performs various actions based on command-line flags and configuration settings. -Here's a high-level overview of what the script does: - -1. Initializes directories and checks for admin privileges. -2. Parses command-line flags and sets up logging. -3. Performs special actions based on flags, such as debugging, updating, or restoring backups. -4. Creates an execution list of files to run, which can be filtered based on flags. -5. Runs the files in the execution list, either sequentially or in parallel using threading. -6. Zips generated files and attempts to delete event logs. -7. Performs sub-actions, such as shutting down or rebooting the system, or sending a webhook. - -The script appears to be designed to be highly configurable and modular, -with many options and flags that can be used to customize its behavior. -""" +# Initialization +FileManagement.mkdir() +log = Log({"log_level": DEBUG}) class Health: @staticmethod + @log.function def backup(directory: str, name: str): """ Creates a backup of a specified directory by zipping its contents and moving it to a designated backup location. @@ -52,6 +40,7 @@ def backup(directory: str, name: str): shutil.move(f"{name}.zip", "../ACCESS/BACKUP") @staticmethod + @log.function def update() -> tuple[str, str]: """ Updates the repository by pulling the latest changes from the remote repository. @@ -78,6 +67,7 @@ def update() -> tuple[str, str]: return output, "info" +@log.function def get_flags() -> tuple[str, str]: """ Retrieves the command-line flags and sub-actions. @@ -105,6 +95,7 @@ def get_flags() -> tuple[str, str]: return actions, sub_actions +@log.function def special_execute(file_path: str): """ Executes a Python script in a new command prompt window. @@ -119,6 +110,7 @@ def special_execute(file_path: str): exit(0) +@log.function def handle_special_actions(): """ Handles special actions based on the provided action flag. @@ -185,6 +177,7 @@ def handle_special_actions(): exit(0) +@log.function def check_privileges(): """ Checks if the script is running with administrative privileges and handles UAC (User Account Control) settings. @@ -206,6 +199,7 @@ def check_privileges(): log.warning("UAC is enabled, this may cause issues - Please disable UAC if possible") +@log.function def generate_execution_list(actions: str) -> list | list[str] | list[str | Any]: """ Creates an execution list based on the provided action. @@ -268,6 +262,7 @@ def generate_execution_list(actions: str) -> list | list[str] | list[str | Any]: return execution_list +@log.function def execute_scripts(): """Executes the scripts in the execution list based on the action.""" # Check weather to use threading or not, as well as execute code @@ -311,6 +306,7 @@ def threaded_execution(execution_list_thread, index_thread): log.error(f"Error in code: {e}") +@log.function def zip_generated_files(): """Zips generated files based on the action.""" @@ -328,6 +324,7 @@ def zip_and_log(directory, name): zip_and_log(".", "CODE") +@log.function def handle_sub_action(): """ Handles sub-actions based on the provided sub_action flag. @@ -345,9 +342,6 @@ def handle_sub_action(): if __name__ == "__main__": - # Initialization - FileManagement.mkdir() - log = Log({"log_level": DEBUG}) # Get flags and configs action, sub_action = get_flags() # Check for special actions diff --git a/CODE/_debug.py b/CODE/_debug.py index c44d348..0f49dd3 100644 --- a/CODE/_debug.py +++ b/CODE/_debug.py @@ -11,6 +11,7 @@ class HealthCheck: + @log_debug.function def get_online_config( self, ) -> bool | tuple[tuple[str, str, str], tuple[str, str, str]]: @@ -92,7 +93,8 @@ def __check_files(local_files: list, remote_files: list) -> tuple[str, str, str] class DebugCheck: @staticmethod - def SysInternal_Binaries(path: str) -> tuple[str, str]: + @log_debug.function + def sys_internal_binaries(path: str) -> tuple[str, str]: """ Checks the contents of the given path and determines the status of the SysInternal Binaries. @@ -135,6 +137,7 @@ def SysInternal_Binaries(path: str) -> tuple[str, str]: return f"An Unexpected error occurred: {e}", "ERROR" @staticmethod + @log_debug.function def execution_policy() -> bool: """ Checks the current PowerShell execution policy. @@ -150,6 +153,7 @@ def execution_policy() -> bool: return result.stdout.strip().lower() == "unrestricted" @staticmethod + @log_debug.function def cpu_info() -> tuple[str, str, str]: """ Retrieves information about the CPU. @@ -164,6 +168,7 @@ def cpu_info() -> tuple[str, str, str]: ) +@log_debug.function def debug(): """ Performs a series of system checks and logs the results. @@ -181,7 +186,7 @@ def debug(): log_debug.string(file_tuple[0], file_tuple[2]) # Check SysInternal Binaries - message, type = DebugCheck.SysInternal_Binaries("SysInternal_Suite") + message, type = DebugCheck.sys_internal_binaries("SysInternal_Suite") log_debug.string(message, type) # Check Admin diff --git a/CODE/_dev.py b/CODE/_dev.py index a1af245..de73ecf 100644 --- a/CODE/_dev.py +++ b/CODE/_dev.py @@ -2,6 +2,9 @@ from __lib_class import * +if __name__ == "__main__": + log_dev = Log({"log_level": DEBUG}) + class Dev: @staticmethod @@ -54,6 +57,7 @@ def __prompt_user(question: str, file_to_open: str = None, special: bool = False except Exception as e: log_dev.error(e) + @log_dev.function def dev_checks(self) -> str | None: """ Performs a series of checks to ensure that the developer has followed the required guidelines and best practices. @@ -93,8 +97,6 @@ def dev_checks(self) -> str | None: return str(e) -if __name__ == "__main__": - log_dev = Log({"log_level": DEBUG}) message = Dev().dev_checks() if message is not None: log_dev.error(message) diff --git a/CODE/_extra.py b/CODE/_extra.py index 907dc8e..7628a7d 100644 --- a/CODE/_extra.py +++ b/CODE/_extra.py @@ -11,6 +11,7 @@ log = Log({"log_level": DEBUG}) +@log.function def menu(): """ Displays a menu of available executable scripts in the '../EXTRA/EXTRA' directory, diff --git a/CODE/cmd_commands.py b/CODE/cmd_commands.py index 1ca9e43..1db0c83 100644 --- a/CODE/cmd_commands.py +++ b/CODE/cmd_commands.py @@ -4,6 +4,7 @@ log = Log({"log_level": DEBUG}) +@log.function def command(file: str, commands: str, message: str, encoding: str = "UTF-8") -> None: """ Executes a command and writes the output to a file. diff --git a/CODE/dir_list.py b/CODE/dir_list.py index 80cee45..b5b7ab2 100644 --- a/CODE/dir_list.py +++ b/CODE/dir_list.py @@ -6,6 +6,7 @@ log = Log({"log_level": DEBUG}) +@log.function def run_command_threaded(directory: str, file: str, message: str, encoding: str = "UTF-8") -> None: """ Executes a command for a specific directory and writes the output to a file. @@ -29,6 +30,7 @@ def run_command_threaded(directory: str, file: str, message: str, encoding: str log.error(f"Error while getting {message} for {directory}: {e}") +@log.function def command_threaded(base_directory: str, file: str, message: str, encoding: str = "UTF-8") -> None: """ Splits the base directory into subdirectories and runs the command concurrently. diff --git a/CODE/log_miner.py b/CODE/log_miner.py index 4b74ee5..839f985 100644 --- a/CODE/log_miner.py +++ b/CODE/log_miner.py @@ -4,6 +4,7 @@ log = Log({"log_level": DEBUG}) +@log.function def backup_windows_logs(): """ Backs up Windows system logs to a CSV file. diff --git a/CODE/media_backup.py b/CODE/media_backup.py index 32d6e0c..a915358 100644 --- a/CODE/media_backup.py +++ b/CODE/media_backup.py @@ -48,6 +48,7 @@ def __backup_files(media_files: list, backup_directory: str): except Exception as e: log.error(f"Failed to copy {src_file}: {str(e)}") + @log.function def backup(self): """Backs up media files from the default Windows photo and video directories.""" source_dirs = self.__get_default_paths() diff --git a/CODE/registry.py b/CODE/registry.py index 8edbf8c..5c58b6f 100644 --- a/CODE/registry.py +++ b/CODE/registry.py @@ -4,6 +4,7 @@ log = Log({"log_level": DEBUG}) +@log.function def backup_registry(): """ Backs up the Windows registry to a file named 'RegistryBackup.reg' in the current working directory. diff --git a/CODE/sensitive_data_miner.py b/CODE/sensitive_data_miner.py index 1353624..d6f9fca 100644 --- a/CODE/sensitive_data_miner.py +++ b/CODE/sensitive_data_miner.py @@ -77,6 +77,7 @@ def __search_and_copy_files(self, keyword: str): dst_file_path = destination / file_path.name executor.submit(self.__copy_file, file_path, dst_file_path) + @log.function def passwords(self): """ Searches for files containing sensitive data keywords in their filenames, diff --git a/CODE/ssh_miner.py b/CODE/ssh_miner.py index 442feb1..5312882 100644 --- a/CODE/ssh_miner.py +++ b/CODE/ssh_miner.py @@ -4,6 +4,7 @@ log = Log({"log_level": DEBUG}) +@log.function def ssh_miner(): """ This function backs up SSH keys and configuration diff --git a/CODE/sys_internal.py b/CODE/sys_internal.py index ac4dd22..51745fa 100644 --- a/CODE/sys_internal.py +++ b/CODE/sys_internal.py @@ -14,6 +14,7 @@ ] +@log.function def sys_internal(): """ This function runs a series of system internal sys_internal_executables and logs their output. @@ -56,6 +57,7 @@ def sys_internal(): log.info("SysInternal: Successfully executed") +@log.function def check_sys_internal_dir() -> tuple[bool, bool]: """ Checks the existence of the 'SysInternal_Suite' directory and its contents. diff --git a/CODE/tasklist.py b/CODE/tasklist.py index a6f31d2..045a784 100644 --- a/CODE/tasklist.py +++ b/CODE/tasklist.py @@ -4,6 +4,7 @@ log = Log({"log_level": DEBUG}) +@log.function def tasklist(): """ Retrieves a list of running tasks on the system and exports the result to a CSV file. diff --git a/CODE/wifi_stealer.py b/CODE/wifi_stealer.py index b523636..53bd931 100644 --- a/CODE/wifi_stealer.py +++ b/CODE/wifi_stealer.py @@ -6,6 +6,7 @@ log = Log({"log_level": DEBUG}) +@log.function def get_password(ssid: str) -> str | None: """ Retrieves the password associated with a given Wi-Fi SSID. @@ -32,6 +33,7 @@ def get_password(ssid: str) -> str | None: log.error(err) +@log.function def parse_wifi_names(command_output: str) -> list: """ Parses the output of the command to extract Wi-Fi profile names. @@ -53,6 +55,7 @@ def parse_wifi_names(command_output: str) -> list: return wifi_names +@log.function def get_wifi_names() -> list: """ Retrieves the names of all Wi-Fi profiles on the system. @@ -73,6 +76,7 @@ def get_wifi_names() -> list: log.error(err) +@log.function def get_wifi_passwords(): """ Retrieves the passwords for all Wi-Fi profiles on the system. diff --git a/CODE/wmic.py b/CODE/wmic.py index 910c959..adb50e9 100644 --- a/CODE/wmic.py +++ b/CODE/wmic.py @@ -4,6 +4,7 @@ log = Log({"log_level": DEBUG}) +@log.function def wmic(): """ Retrieves system information using WMIC commands. diff --git a/MODS/_MOD_SKELETON.py b/MODS/_MOD_SKELETON.py index 4ad0127..01908ae 100644 --- a/MODS/_MOD_SKELETON.py +++ b/MODS/_MOD_SKELETON.py @@ -16,10 +16,14 @@ # Example of said code:- -# You can enable this decorator to log the function name and the time it took to run, +# This log decorator logs the function name and the time it took to run, # It is recommended to use this, -# as it only logs the function and the time it took to run in debug mode -# @log.function +# as it only logs the function and the time it took to run +# in debug mode thus helping when people enable debug mode +# Do note however, if you are using multiple decorators, this should be the last one +# check the WiKi for more information +# Do not use this decorator if you are running a function that is part of another function +@log.function def MOD_EXAMPLE() -> None: """ This function MOD is used to log different types of messages. From 746413583d4d3324dc003f6760f2f010aaeb791b Mon Sep 17 00:00:00 2001 From: DefinetlyNotAI Date: Thu, 21 Nov 2024 08:42:10 +0400 Subject: [PATCH 5/8] Tested and ran code --- CODE/Logicytics.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/CODE/Logicytics.py b/CODE/Logicytics.py index 7296295..eaa8bf5 100644 --- a/CODE/Logicytics.py +++ b/CODE/Logicytics.py @@ -348,11 +348,9 @@ def handle_sub_action(): handle_special_actions() # Check for privileges and errors check_privileges() - """ # Execute scripts log.info("Starting Logicytics...") execute_scripts() - """ # Zip generated files zip_generated_files() # Finish with sub actions From c7c75bfd2e7f9c44e0629eee44cb062d0a03d266 Mon Sep 17 00:00:00 2001 From: DefinetlyNotAI Date: Thu, 21 Nov 2024 08:42:35 +0400 Subject: [PATCH 6/8] Ran --dev --- CODE/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/config.json b/CODE/config.json index b5cb114..ccc1b34 100644 --- a/CODE/config.json +++ b/CODE/config.json @@ -1,6 +1,6 @@ { "Log Level Debug?": false, - "VERSION": "2.4.2", + "VERSION": "2.4.3", "CURRENT_FILES": [ "browser_miner.ps1", "cmd_commands.py", From da0340119b4c1c2b7f5d936a63e62515fc91ab1a Mon Sep 17 00:00:00 2001 From: DefinetlyNotAI Date: Thu, 21 Nov 2024 08:43:23 +0400 Subject: [PATCH 7/8] Removed __wrapper__.py Its redundant and useless --- CODE/__wrapper__.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 CODE/__wrapper__.py diff --git a/CODE/__wrapper__.py b/CODE/__wrapper__.py deleted file mode 100644 index 7830c5a..0000000 --- a/CODE/__wrapper__.py +++ /dev/null @@ -1,27 +0,0 @@ -# Optional wrapper that you can build manually, if you want to ignore the restrictions of python in the -# main Logicytics file. This wrapper is not compulsory, but it is recommended to use it to build the exe. - -# Special wrapper that the exe Logicytics is made out of, not compulsory, just to ignore some restrictions of python. - -# If you modify please run this command to build the exe: -# pyinstaller --noconfirm --onefile --console --icon "C:\Users\Hp\Desktop\Logicytics\IMG\EXE.ico" "C:\Users\Hp\Desktop\Logicytics\CODE\__wrapper__.py" - -# Assuming Logicytics is in the Desktop, and the paths are unchanged (You may need to replace Hp with your username). -# Then rename from __wrapper__.exe to Logicytics.exe - -import subprocess -import sys - - -FLAG = tuple(sys.argv[1:]) - -if len(FLAG) == 0: - subprocess.run(["python", "Logicytics.py"], shell=False) - -elif len(FLAG) == 2: - flag1, flag2 = FLAG - subprocess.run(["python", "Logicytics.py", flag1, flag2], shell=False) - -else: - flag1 = sys.argv[1] - subprocess.run(["python", "Logicytics.py", flag1], shell=False) From d1d17a96a0f289c0838f87b4447245d594e2e969 Mon Sep 17 00:00:00 2001 From: DefinetlyNotAI Date: Thu, 21 Nov 2024 08:43:23 +0400 Subject: [PATCH 8/8] Removed __wrapper__.py Its redundant and useless --- CODE/__wrapper__.py | 27 --------------------------- PLANS.md | 1 - 2 files changed, 28 deletions(-) delete mode 100644 CODE/__wrapper__.py diff --git a/CODE/__wrapper__.py b/CODE/__wrapper__.py deleted file mode 100644 index 7830c5a..0000000 --- a/CODE/__wrapper__.py +++ /dev/null @@ -1,27 +0,0 @@ -# Optional wrapper that you can build manually, if you want to ignore the restrictions of python in the -# main Logicytics file. This wrapper is not compulsory, but it is recommended to use it to build the exe. - -# Special wrapper that the exe Logicytics is made out of, not compulsory, just to ignore some restrictions of python. - -# If you modify please run this command to build the exe: -# pyinstaller --noconfirm --onefile --console --icon "C:\Users\Hp\Desktop\Logicytics\IMG\EXE.ico" "C:\Users\Hp\Desktop\Logicytics\CODE\__wrapper__.py" - -# Assuming Logicytics is in the Desktop, and the paths are unchanged (You may need to replace Hp with your username). -# Then rename from __wrapper__.exe to Logicytics.exe - -import subprocess -import sys - - -FLAG = tuple(sys.argv[1:]) - -if len(FLAG) == 0: - subprocess.run(["python", "Logicytics.py"], shell=False) - -elif len(FLAG) == 2: - flag1, flag2 = FLAG - subprocess.run(["python", "Logicytics.py", flag1, flag2], shell=False) - -else: - flag1 = sys.argv[1] - subprocess.run(["python", "Logicytics.py", flag1], shell=False) diff --git a/PLANS.md b/PLANS.md index f041c92..b13840f 100644 --- a/PLANS.md +++ b/PLANS.md @@ -7,7 +7,6 @@ | Task | Version | Might or Will be done? | |-------------------------------------------------------------------------------------------------------------------------------------|---------|------------------------| -| Remove \_wrapper.py as its useless | v2.4.3 | ✅ | | Implement a parser for Windows Event Logs to extract and analyze security-related events. | v2.5.0 | ✅ | | Enable integration with popular SIEM (Security Information and Event Management) systems. | v2.5.0 | ✅ | | Add a tool to capture and analyse network traffic, which can help in forensic investigations. | v2.6.0 | ❌ |