From 9d07ee317a56d9a20ab86a58731f4967b75b843c Mon Sep 17 00:00:00 2001 From: Tommy Beadle Date: Wed, 15 Jan 2025 14:17:11 -0500 Subject: [PATCH] Import all, windows, and linux custom signatures if available. --- lib/cuckoo/core/startup.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/cuckoo/core/startup.py b/lib/cuckoo/core/startup.py index 11fa5818dfb..8c202b0d426 100644 --- a/lib/cuckoo/core/startup.py +++ b/lib/cuckoo/core/startup.py @@ -17,6 +17,25 @@ # Private import custom.signatures + +try: + import custom.signatures.all +except ImportError: + HAS_CUSTOM_SIGNATURES_ALL = False +else: + HAS_CUSTOM_SIGNATURES_ALL = True +try: + import custom.signatures.linux +except ImportError: + HAS_CUSTOM_SIGNATURES_LINUX = False +else: + HAS_CUSTOM_SIGNATURES_LINUX = True +try: + import custom.signatures.windows +except ImportError: + HAS_CUSTOM_SIGNATURES_WINDOWS = False +else: + HAS_CUSTOM_SIGNATURES_WINDOWS = True import modules.auxiliary import modules.feeds import modules.processing @@ -272,6 +291,12 @@ def init_modules(): import_package(modules.signatures.linux) # Import all private signatures import_package(custom.signatures) + if HAS_CUSTOM_SIGNATURES_ALL: + import_package(custom.signatures.all) + if HAS_CUSTOM_SIGNATURES_LINUX: + import_package(custom.signatures.linux) + if HAS_CUSTOM_SIGNATURES_WINDOWS: + import_package(custom.signatures.windows) if len(os.listdir(os.path.join(CUCKOO_ROOT, "modules", "signatures"))) < 5: log.warning("Suggestion: looks like you didn't install community, execute: poetry run python utils/community.py -h") # Import all reporting modules.