From 46ce1918725504bdb9fbce317a2ede9ac8042e8e Mon Sep 17 00:00:00 2001 From: kevross33 Date: Fri, 4 Oct 2024 17:42:31 +0100 Subject: [PATCH] Update packer_enigma.py Update to correct format --- modules/signatures/all/packer_enigma.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/signatures/all/packer_enigma.py b/modules/signatures/all/packer_enigma.py index f5a7c298..4b4d44cb 100644 --- a/modules/signatures/all/packer_enigma.py +++ b/modules/signatures/all/packer_enigma.py @@ -15,7 +15,6 @@ from lib.cuckoo.common.abstracts import Signature - class EnigmaPacked(Signature): name = "packer_enigma" description = "Executable file is packed/obfuscated with Enigma" @@ -29,9 +28,15 @@ class EnigmaPacked(Signature): mbcs = ["OB0001", "OB0002", "OB0006", "F0001"] def run(self): - for section in self.results.get("static", {}).get("pe", {}).get("sections", []): - if section["name"].lower().startswith(".enigma"): - self.data.append({"section": section}) - return True + ret = False + + target = self.results.get("target", {}) + if target.get("category") in ("file", "static") and target.get("file"): + pe = self.results["target"]["file"].get("pe", []) + if pe: + for section in pe["sections"]: + if section["name"].lower().startswith(".enigma"): + self.data.append({"section": section}) + ret = True - return False + return ret