text
stringlengths
0
9.3M
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import logging import subprocess import time from lib.cuckoo.common.abstracts import Machinery from lib.cuckoo.common.config import Config from lib.cu...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file was originally produced by Mike Tu. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import glob import logging import os.path import shutil import subprocess import time from lib.cuckoo....
import logging import os import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning from lib.cuckoo.common.abstracts import Machinery from lib.cuckoo.common.exceptions import CuckooMachineError requests.packages.urllib3.disable_warnings(InsecureRequestWarning) log = logging.getLogger(__...
# Copyright (C) 2010-2015 Cuckoo Foundation, Context Information Security. (kevin.oreilly@contextis.co.uk) # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import logging import subprocess import time from lib.cuckoo.common.abstracts import Mac...
# Copyright (C) 2015 eSentire, Inc (jacob.gajek@esentire.com). # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import logging import random import re import sys import time from datetime import datetime, timedelta import requests from lib.cuc...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. """ XenServer machinery. """ import logging import threading from lib.cuckoo.common.abstracts import Machinery from lib.cuckoo.common.exceptions impo...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission.
import datetime import json import logging import os from lib.cuckoo.common.abstracts import Processing log = logging.getLogger(__name__) class Amsi(Processing): key = "amsi" def run(self): jsonl_file = os.path.join(self.aux_path, "amsi", "amsi.jsonl") if not os.path.exists(jsonl_file) or o...
# Copyright (C) 2010-2015 Cuckoo Foundation, Optiv, Inc. (brad.spengler@optiv.com) # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import codecs import logging import time from contextlib import suppress from datetime import datetime from pathl...
# Copyright (C) 2015 Kevin O'Reilly kevin.oreilly@contextis.co.uk # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Th...
# Copyright (C) 2010-2015 Cuckoo Foundation, Optiv, Inc. (brad.spengler@optiv.com) # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import datetime import json import logging import os import struct from contextlib import suppress from lib.cuck...
import logging import time from urllib.parse import urljoin import requests from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.exceptions import CuckooOperationalError log = logging.getLogger(__name__) class BoxJS(Processing): def _request_text(self, url, **kwargs): """Wrapper ar...
# Copyright (C) 2015 Kevin O'Reilly kevin.oreilly@contextis.co.uk # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Th...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import codecs from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.exceptions import CuckooProcessingError from lib.cuckoo.common...
# Copyright (C) 2016 Brad Spengler # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import glob import os import zipfile from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.exceptions import CuckooProcessingError from lib....
# Copyright (C) 2017 Marirs. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import collections import logging import os import re HAVE_IMAGEHASH = False try: import imagehash HAVE_IMAGEHASH = True except ImportError: print("Misse...
# Copyright (C) 2010-2014 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import binascii import logging import os from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.path_utils import path_exists try:...
# Copyright (C) 2017 enzok # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope ...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. # Based on work of Xabier Ugarte-Pedrero # https://github.com/Cisco-Talos/pyrebox/blob/python3migration/pyrebox/volatility_glue.py # Vol3 docs - http...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. # Imports for the batch sort. # http://stackoverflow.com/questions/10665925/how-to-sort-huge-files-with-python # http://code.activestate.com/recipes/57...
import logging from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.objects import File from lib.cuckoo.common.pcap_utils import PcapToNg, file_exists_not_empty, is_pcapng from pathlib import Path log = logging.getLogger(__name__) class PcapNg(Processing): """Generate a pcapng file during p...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. # Imports for the batch sort. # http://stackoverflow.com/questions/10665925/how-to-sort-huge-files-with-python # http://code.activestate.com/recipes/57...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import logging import os from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.cape_utils import cape_name_from_yara from lib.cuck...
# Copyright (C) 2016-2017 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os import xml.etree.ElementTree from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.path_utils import path_exists class...
import json import logging import os import requests from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.config import Config from lib.cuckoo.common.exceptions import CuckooProcessingError from lib.cuckoo.common.objects import File processing_conf = Config("processing") log = logging.getLogger...
import glob import logging import os from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.path_utils import path_read_file log = logging.getLogger() class script_log_processing(Processing): """ Output reads output of script from logs Adds to report.json to be viewed on the web "...
import ast import json import logging import os import re from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.path_utils import path_exists log = logging.getLogger(__name__) __author__ = "@winson0123" __version__ = "1.0.0" fd_syscalls = [ "read", "write", "close", "newfstat", ...
# Copyright (C) 2010-2012 Cuckoo Sandbox Developers. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import datetime import json import logging import os import shutil import subprocess import time from contextlib import suppress from data.saf...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.config import Config from lib.cuckoo.common.integrations.parse_url import HAV...
# Copyright (C) 2016 Brad Spengler # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os from lib.cuckoo.common.abstracts import Processing from lib.cuckoo.common.constants import CUCKOO_ROOT from lib.cuckoo.common.path_utils import path_e...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission.
# Copyright (C) 2015-2017 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import datetime import logging import os import re from functools import reduce import dateutil.parser from lib.cuckoo.common.abstracts import Behavi...
# Copyright (C) 2019 DoomedRaven # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import logging import os from lib.cuckoo.common.abstracts import Report from lib.cuckoo.common.config import Config from lib.cuckoo.common.path_utils import path_...
# Copyright (C) 2024 fdiaz@virustotal.com # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import json import logging import os from lib.cuckoo.common.abstracts import Report log = logging.getLogger(__name__) class BrowserExt(Report): ""...
import json import logging import requests from lib.cuckoo.common.abstracts import Report from lib.cuckoo.core.database import TASK_REPORTED, Database log = logging.getLogger(__name__) main_db = Database() class CALLBACKHOME(Report): "Notify us about analysis is done" order = 10000 # used in the reportin...
# Copyright (C) 2016 Brad Spengler # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os import zipfile from lib.cuckoo.common.abstracts import Report from lib.cuckoo.common.exceptions import CuckooReportError from lib.cuckoo.common.path_u...
# Copyright (C) 2017 Marirs. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import gc import json import logging from contextlib import suppress from datetime import datetime from lib.cuckoo.common.abstracts import Report from lib.cuckoo.comm...
import os import logging import tempfile import zipfile from lib.cuckoo.common.constants import CUCKOO_ROOT from lib.cuckoo.common.abstracts import Report from lib.cuckoo.common.exceptions import CuckooReportError # Set up a logger for this module log = logging.getLogger(__name__) try: # Import the Google Cloud S...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os from lib.cuckoo.common.utils import create_zip from lib.cuckoo.common.abstracts import Report from lib.cuckoo.common.exceptions import Cucko...
# Copyright (C) 2021 Intezer # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os import chardet from lib.cuckoo.common.abstracts import Report from lib.cuckoo.common.exceptions import CuckooReportError from lib.cuckoo.common.path_utils ...
# Copyright (c) 2013, The MITRE Corporation # Copyright (c) 2010-2015, Cuckoo Developers # All rights reserved. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file "docs/LICENSE" for copying permission. import hashlib import os import re from collections import defaultdict from lib.cu...
# Copyright (C) 2017 The MITRE Corporation. # Copyright (C) 2018 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. # MAEC 5.0 Cuckoo Report Module # https://maecproject.github.io/releases/5.0/MAEC_Vocabularies_Specification.pdf ...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import logging from lib.cuckoo.common.abstracts import Report from lib.cuckoo.common.integrations.mitre import mitre_generate_attck log = logging.get...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import gc import logging from lib.cuckoo.common.abstracts import Report from lib.cuckoo.common.exceptions import CuckooDependencyError, CuckooReportEr...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import copy import logging import os import re from contextlib import suppress from lib.cuckoo.common.config import Config from lib.cuckoo.common.obje...
import logging import shutil from lib.cuckoo.common.abstracts import Report from lib.cuckoo.common.path_utils import path_delete, path_exists from lib.cuckoo.common.utils import get_memdump_path log = logging.getLogger(__name__) class TMPFSCLEAN(Report): "Remove/save memdump" order = 9998 def run(self...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission.
# CAPE - Config And Payload Extraction # Copyright(C) 2015 - 2018 Context Information Security. (kevin.oreilly@contextis.com) # # This program is free software : you can redistribute it and / or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
# Copyright (C) 2019 Kevin Ross # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
# Copyright (C) 2020 doomedraven # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in th...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission.
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission.
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission.
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission.
import os import pathlib import tempfile import pytest import lib.cuckoo.common.config import lib.cuckoo.core.analysis_manager import lib.cuckoo.core.database from lib.cuckoo.common.config import ConfigMeta from lib.cuckoo.core.database import Database, init_database, reset_database_FOR_TESTING_ONLY @pytest.fixture...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os import sys from datetime import datetime from email import encoders from email.mime.base import MIMEBase from email.mime.multipart import MIM...
#!/usr/bin/env python # Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import argparse import json import logging import os import urllib3 from tcr_misc import get_sample urllib3.disable_warnings()...
#!/usr/bin/env python # Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. """ Checks the integrity of one or more virtual machine(s). In order to ensure that there are no remaining tasks in the queue th...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.abstracts import Processing, Signature from lib.cuckoo.common.constants import CUCKOO_VERSION class ProcessingMock(Processing...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.abstracts import Report class ReportMock(Report): def run(self, data): return class ReportAlterMock(Report): ...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission.
#!/usr/bin/env python # Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import hashlib import logging import os import uuid import requests import urllib3 from requests.adapters import HTTPAdapter fro...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os import tempfile from unittest.mock import MagicMock, patch import pytest import lib.cuckoo.common.abstracts as abstracts from lib.cuckoo.co...
import datetime import logging import os import pathlib from typing import Generator import pytest from pytest_mock import MockerFixture from sqlalchemy import select from lib.cuckoo.common.abstracts import Machinery from lib.cuckoo.common.config import ConfigMeta from lib.cuckoo.core.analysis_manager import Analysi...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.config import Config from modules.processing.behavior import ParseProcessLog cfg = Config("processing") class TestParseProces...
import unittest from unittest.mock import MagicMock, patch from lib.cuckoo.common.cape_utils import cape_name_from_yara, static_config_parsers class TestCapeUtils(unittest.TestCase): @patch("lib.cuckoo.common.cape_utils.File.yara_hit_provides_detection") @patch("lib.cuckoo.common.cape_utils.File.get_cape_nam...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common import cleaners_utils def test_free_space_monitor(mocker): # Will not enter main loop cleaners_utils.free_space_monito...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.colors import black, blue, bold, color, cyan, green, magenta, red, white, yellow # noqa: F401 def test_return_text(): """...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os import pathlib from lib.cuckoo.common.compressor import CuckooBsonCompressor from lib.cuckoo.common.path_utils import path_delete class Te...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import configparser import textwrap import pytest from lib.cuckoo.common.config import AnalysisConfig, Config, ConfigMeta from lib.cuckoo.common.exce...
# Copyright (C) 2016-2018 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import base64 import dataclasses import datetime import hashlib import os import pathlib import shutil from tempfile import NamedTemporaryFile import ...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import pathlib import tempfile import pytest from tcr_misc import get_sample from lib.cuckoo.common import demux @pytest.fixture def grab_sample():...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.dist_db import Machine, Node, StringList, Task def test_node(): node = Node() need_set = set(["id", "name", "url", "e...
import io import unittest from unittest.mock import MagicMock, patch import pytest import pyzipper import requests from lib.downloaders import Downloaders from lib.downloaders.malwarebazaar import download as mb_downloader from lib.downloaders.virustotal import download as vt_downloader class TestDownloaders(unitte...
# Copyright (C) 2012-2013 Claudio Guarnieri. # Copyright (C) 2014-2018 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import io import os import shutil import tempfile import pytest from lib.cuckoo.common.exceptions import...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import pathlib import tempfile import pytest from lib.cuckoo.common.integrations import file_extra_info @pytest.fixture(autouse=True) def set_tools_...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import pathlib import pytest from tcr_misc import get_sample from lib.cuckoo.common.icon import PEGroupIconDir @pytest.fixture def sample(): de...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common import logo def test_logo(capsys): logo.logo() captured = capsys.readouterr() assert "CAPE: Config and Payload Ext...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.integrations.mitre import mitre_generate_attck, mitre_load from utils.community import install def test_mitre_attck(): mit...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import datetime import pathlib import pytest from lib.cuckoo.common.netlog import BsonParser # Might require newer pymongo, works with 3.11.4 @pyt...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import copy import logging import pathlib import tempfile import pytest import yara from lib.cuckoo.common.dictionary import Dictionary # ,ProcDump ...
import unittest from pathlib import Path from unittest.mock import MagicMock, patch import pytest from lib.cuckoo.common.integrations.parse_office import Office data_dir = Path(__file__).parent / "data" / "office" rtf_path = data_dir / "rtf_exploit.doc" class TestParseOffice(unittest.TestCase): @patch("lib.cuck...
from pathlib import Path import pytest from lib.cuckoo.common.integrations.peepdf import peepdf_parse data_dir = Path(__file__).parent / "data" / "malware" pdf_path = data_dir / "ad6cedb0d1244c1d740bf5f681850a275c4592281cdebb491ce533edd9d6a77d" expected_result = { "Info": { "Creator": "Scribus 1.3.3.12"...
from tempfile import NamedTemporaryFile from unittest.mock import ANY, MagicMock, patch import pytest from lib.cuckoo.common.objects import File from modules.processing.CAPE import CAPE from modules.processing.deduplication import reindex_screenshots @pytest.fixture def cape_processor(): retval = CAPE() ret...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os import pathlib import struct import tempfile from unittest import mock import pytest from lib.cuckoo.common.quarantine import bytearray_xor...
import json import os import pytest from lib.cuckoo.common.abstracts import Signature from lib.cuckoo.common.constants import CUCKOO_ROOT from lib.cuckoo.common.path_utils import path_exists from lib.cuckoo.core.plugins import RunSignatures, register_plugin class FakeSignatureCallAlways(Signature): name = "Fake...
import unittest from unittest.mock import patch from lib.cuckoo.common.integrations.strings import extract_strings class TestExtractStrings(unittest.TestCase): @patch("lib.cuckoo.common.integrations.strings.processing_cfg") @patch("lib.cuckoo.common.integrations.strings.Path") def test_extract_strings_fr...
import os import sys if sys.version_info[:2] < (3, 8): sys.exit("You are running an incompatible version of Python, please use >= 3.8") CUCKOO_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..") sys.path.append(CUCKOO_ROOT) from lib.cuckoo.common.suricata_detection import get_suricata_family ...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import unittest.mock as mock from utils.tls import TLS12KeyLog, tlslog_to_sslkeylogfile TLSDUMP_LOGS = [ "client_random: 66d85f5e14959be90acdf468...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os from tcr_misc import random_string from unittest import mock import pytest from lib.cuckoo.common.exceptions import CuckooOperationalError f...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os import random from lib.cuckoo.common import utils_pretty_print_funcs as pp_fn from lib.cuckoo.common.path_utils import path_delete random.s...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import tempfile import unittest import httpretty import pytest from lib.cuckoo.common.path_utils import path_delete, path_write_file from lib.cuckoo.c...
# import pytest import pathlib import pytest from lib.cuckoo.common.objects import File try: import yara HAVE_YARA = True except ImportError: HAVE_YARA = False try: import yara_x HAVE_YARA_X = True except ImportError: HAVE_YARA_X = False def test_yara_x(): if not HAVE_YARA_X: ...
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. # fmt: off def api_name_ntcreatesection_arg_name_desiredaccess_data(): return [ ("852374", "STANDARD_RIGHTS_REQUIRED|SECTION_MAP_READ|SECTI...
import pathlib from unittest.mock import patch import pytest from django.test import SimpleTestCase from lib.cuckoo.common.config import ConfigMeta from lib.cuckoo.core.database import ( TASK_BANNED, TASK_COMPLETED, TASK_DISTRIBUTED, TASK_DISTRIBUTED_COMPLETED, TASK_FAILED_ANALYSIS, TASK_FAILE...
import ast import os import re import textwrap import pytest from django.test import SimpleTestCase from submission.views import ( correlate_platform_packages, get_form_data, get_lib_common_constants, get_package_info, parse_ast, web_conf, ) @pytest.mark.usefixtures("db") class TestSubmission...
import logging import os import sys logging.basicConfig(level=logging.DEBUG) testfile_dir = os.path.dirname(__file__) testfile_dir = os.path.join(testfile_dir, "..", "..", "analyzer", "windows") sys.path.append(testfile_dir) import modules.packages.zip as zip extract_dir = os.path.expandvars("%USERPROFILE%\\Desktop...
# Copyright (C) 2021 CSIT # This file is part of CAPE Sandbox - http://www.capesandbox.com # See the file 'docs/LICENSE' for copying permission. import os import sys import pytest testfile_dir = os.path.dirname(__file__) module_dir = os.path.join(testfile_dir, "", "../..", "analyzer", "windows") sys.path.append(modu...
# Copyright (C) 2021 CSIT # This file is part of CAPE Sandbox - http://www.capesandbox.com # See the file 'docs/LICENSE' for copying permission. import os import shutil import sys from contextlib import contextmanager, suppress from typing import Dict import pytest testfile_dir = os.path.dirname(__file__) module_dir...
import os import shutil import sys CUCKOO_ROOT = os.path.join(os.path.abspath(os.path.dirname(".")), "..") sys.path.append(CUCKOO_ROOT) from lib.cuckoo.common.config import Config from lib.cuckoo.common.constants import CUCKOO_ROOT from lib.cuckoo.common.path_utils import path_exists repconf = Config("reporting") ...