From 74ea202ad71a5beaad8473010b3b296f1b064790 Mon Sep 17 00:00:00 2001 From: doomedraven Date: Thu, 14 Nov 2024 07:55:24 +0100 Subject: [PATCH] rewrite selfextract --- lib/cuckoo/common/web_utils.py | 3 +++ tests/test_file_extra_info.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/cuckoo/common/web_utils.py b/lib/cuckoo/common/web_utils.py index e61ff68c6d3..410995a069c 100644 --- a/lib/cuckoo/common/web_utils.py +++ b/lib/cuckoo/common/web_utils.py @@ -1094,6 +1094,9 @@ def perform_search(term, value, search_limit=False, user_id=False, privs=False, elif term == "configs": # check if family name is string only maybe? query_val = {f"{search_term_map[term]}.{value}": {"$exist": True}, "$options": "i"} + # ToDo proper implementation here + # elif term == "extracted_tool": + # query_val = {"$exist": True} elif term == "ttp": if validate_ttp(value): query_val = value.upper() diff --git a/tests/test_file_extra_info.py b/tests/test_file_extra_info.py index a60d2cde5ca..21682513eb5 100644 --- a/tests/test_file_extra_info.py +++ b/tests/test_file_extra_info.py @@ -39,8 +39,8 @@ def test_generic_file_extractors(self): duplicated, tests=True, ) - assert data_dictionary["extracted_files_tool"] == "MsiExtract" - assert len(data_dictionary["extracted_files"]) == 2 + assert "MsiExtract" in data_dictionary["selfextract"].keys() + assert len(data_dictionary["selfextract"]["MsiExtract"]["extracted_files"]) == 2 @pytest.mark.skipif( not (self_extraction_dir / "5b354397f6393ed777639b7d40dec3f37215dcb5078c63993e8a9703e819e2bc.inno").exists(), @@ -60,8 +60,8 @@ def test_generic_file_extractors_no_tests(self): results, duplicated, ) - assert data_dictionary["extracted_files_tool"] == "InnoExtract" - assert len(data_dictionary["extracted_files"]) == 1 + assert "InnoExtract" in data_dictionary["selfextract"].keys() + assert len(data_dictionary["selfextract"]["InnoExtract"]["extracted_files"]) == 1 @pytest.mark.skip(reason="Not implemented yet") def test_batch_extract(self):