From a5f13865b4f43805fdef69895c30b0b136ac70f5 Mon Sep 17 00:00:00 2001 From: Matthew Iverson Date: Thu, 28 Nov 2024 00:54:28 -0500 Subject: [PATCH] Delete TTPs/Analysis/analysis_filehash.py --- TTPs/Analysis/analysis_filehash.py | 58 ------------------------------ 1 file changed, 58 deletions(-) delete mode 100644 TTPs/Analysis/analysis_filehash.py diff --git a/TTPs/Analysis/analysis_filehash.py b/TTPs/Analysis/analysis_filehash.py deleted file mode 100644 index 44db15f..0000000 --- a/TTPs/Analysis/analysis_filehash.py +++ /dev/null @@ -1,58 +0,0 @@ -import os -import subprocess -import webbrowser -from Modules.submenu import build_submenu - -def analysis_filehash_submenu(): - """ - Submenu for file hash analysis tools and methods. - """ - actions = { - "1": {"description": "Get File Hash (MD5)", "function": get_file_hash_md5}, - "2": {"description": "Check File Hash on VirusTotal", "function": check_virustotal}, - "3": {"description": "Other Hash Algorithms (SHA1/SHA256)", "function": get_file_hash_other}, - } - build_submenu("File Hash Analysis", actions) - -# Functions for file hash analysis - -def get_file_hash_md5(): - """ - Run a PowerShell command to get the MD5 hash of a file. - """ - file_path = input("Enter the full file path: ").strip() - try: - if os.name == 'nt': # Check if running on Windows - command = f'powershell.exe Get-FileHash -Algorithm MD5 "{file_path}"' - subprocess.run(command, shell=True) - else: - print("This command is only available on Windows with PowerShell.") - except Exception as e: - print(f"Error running PowerShell command: {e}") - -def check_virustotal(): - """ - Open VirusTotal to check the file hash. - """ - file_hash = input("Enter the file hash (MD5, SHA1, or SHA256): ").strip() - url = f"https://www.virustotal.com/gui/search/{file_hash}" - webbrowser.open(url) - print(f"Opening VirusTotal for hash: {file_hash}") - -def get_file_hash_other(): - """ - Run a PowerShell command to get SHA1 or SHA256 hash of a file. - """ - file_path = input("Enter the full file path: ").strip() - algorithm = input("Enter the hash algorithm (SHA1 or SHA256): ").strip().upper() - if algorithm not in ["SHA1", "SHA256"]: - print("Invalid algorithm. Please choose SHA1 or SHA256.") - return - try: - if os.name == 'nt': # Check if running on Windows - command = f'powershell.exe Get-FileHash -Algorithm {algorithm} "{file_path}"' - subprocess.run(command, shell=True) - else: - print("This command is only available on Windows with PowerShell.") - except Exception as e: - print(f"Error running PowerShell command: {e}")