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.
from lib.common.abstracts import Package
from lib.common.common import check_file_extension
from lib.common.constants import MSOFFICE_TRUSTED_PATH, TRU... |
# 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.common.abstracts import Package
from lib.common.common import check_file_extension
from lib.common.constants import MSOFFICE_TRUSTED_PATH, TRU... |
import os
import time
from lib.common.abstracts import Package
from lib.common.common import check_file_extension
from lib.common.constants import MSOFFICE_TRUSTED_PATH, TRUSTED_PATH_TEXT
from lib.common.exceptions import CuckooPackageError
class DOC_ANTIVM(Package):
"""Word analysis package, with anti-VM techni... |
from lib.common.abstracts import Package
class Edge(Package):
"""Edge analysis package."""
PATHS = [
("ProgramFiles", "Microsoft", "Edge", "Application", "msedge.exe"),
]
summary = "Opens the URL in Microsoft Edge."
description = """Uses msedge.exe to open the supplied url."""
def st... |
# 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.
from lib.common.abstracts import Package
class EML(Package):
"""Outlook EML analysis package."""
PATH... |
# 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 os
import shutil
from subprocess import call
from lib.common.abstracts import Package
from lib.common.com... |
# Copyright (C) 2014 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.
from lib.common.abstracts import Package
class Firefox(Package):
"""Firefox analysis package."""
PATHS = [
("ProgramFi... |
# 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 base64
import logging
import os
import time
import webbrowser
from lib.common.abstracts import Package
log = logging.getLogger(__name__)
class Fi... |
# 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.common.abstracts import Package
class Generic(Package):
"""Generic analysis package.
The sample is started using START command in a ... |
# Copyright (C) 2016 Brad Spengler
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.common.abstracts import Package
from lib.common.common import check_file_extension
class HTA(Package):
"""HTA file analysis package."""
PATHS... |
# Copyright (C) 2017 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.common.abstracts import Package
class HWP(Package):
"""Hangul (Korean) Word Processor File 5.x analysis package."""
PATHS = [("ProgramFi... |
# Copyright (C) 2021 bartblaze
#
# 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) 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.common.abstracts import Package
class IE(Package):
"""Internet Explorer analysis package."""
PATHS = [
("ProgramFiles", "In... |
# 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.
# https://lolbas-project.github.io/lolbas/Binaries/Ie4uinit/
# https://bohops.com/2018/02/26/leveraging-inf-sct-fetch-execute-techniques-for-bypass-evas... |
# 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.
# https://lolbas-project.github.io/lolbas/Binaries/Cmstp/
from lib.common.abstracts import Package
from lib.common.common import check_file_extension
... |
# Copyright (C) 2020 bartblaze
#
# 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) 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.common.abstracts import Package
from lib.common.constants import OPT_CLASS
class Jar(Package):
"""Java analysis package."""
PATHS =... |
# Copyright (C) 2015 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 os
from lib.common.abstracts import Package
from lib.common.constants import OPT_FREE
class JS(Package):
"""JavaScript anal... |
# Copyright (C) 2015 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 os
from lib.common.abstracts import Package
from lib.common.constants import OPT_FREE
class JS_ANTIVM(Package):
"""JavaScri... |
# 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.common.abstracts import Package
from lib.common.common import check_file_extension
class LNK(Package):
"""Windows LNK analysis package v... |
# 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.common.abstracts import Package
from lib.common.common import check_file_extension
class MHT(Package):
"""MHT file analysis package."""
... |
# This file is part of CAPE Sandbox - https://github.com/kevoreilly/CAPEv2
# See the file 'docs/LICENSE' for copying permission.
from lib.common.abstracts import Package
class MSBUILD(Package):
"""msbuild analysis package."""
def __init__(self, options=None, config=None):
if options is None:
... |
# 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.
from lib.common.abstracts import Package
class MSG(Package):
"""Outlook MSG analysis package."""
PATH... |
# 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.common.abstracts import Package
class Msi(Package):
"""MSI analysis package."""
PATHS = [
("SystemRoot", "system32", "msiex... |
# 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 json
import logging
import os
from contextlib import suppress
from pathlib import Path
from lib.common.abstracts import Package
from lib.common.... |
from lib.common.abstracts import Package
from lib.common.common import check_file_extension
from lib.common.constants import OPT_ARGUMENTS
class NodeJS(Package):
"""Package for executing JavaScript files using NodeJS."""
PATHS = [
("ProgramFiles", "NodeJS", "node.exe"),
("LOCALAPPDATA", "Prog... |
# 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.common.abstracts import Package
from lib.common.common import check_file_extension
class NSIS(Package):
"""NSIS analysis package with no... |
from lib.common.abstracts import Package
from lib.common.constants import OPT_ARGUMENTS
class OllyDbg(Package):
"""OllyDbg analysis package."""
summary = "Opens the sample with OllyDbg"
description = f"""Uses 'bin\\OllyDbg\\OLLYDBG.EXE <sample> [arguments]' to launch the sample.
The '{OPT_ARGUMENTS}'... |
# 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 time
from lib.api.utils import Utils
from lib.common.abstracts import Package
_OPT_OFFICE = "office"
_OPT_NO_IAT = "no-iat"
_OPT_YAR... |
# 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.common.abstracts import Package
from lib.common.exceptions import CuckooPackageError
class PDF(Package):
"""PDF analysis package."""
... |
# 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.common.abstracts import Package
from lib.common.constants import MSOFFICE_TRUSTED_PATH, TRUSTED_PATH_TEXT
class PPT(Package):
"""PowerPo... |
# 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.common.abstracts import Package
from lib.common.constants import MSOFFICE_TRUSTED_PATH, TRUSTED_PATH_TEXT
class PPT2007(Package):
"""Pow... |
# 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.common.abstracts import Package
from lib.common.common import check_file_extension
_OPT_PWSH = "pwsh"
class PS1(Package):
"""PowerShell... |
# 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 winreg import HKEY_CURRENT_USER, KEY_READ, KEY_SET_VALUE, REG_DWORD, CreateKeyEx, EnumKey, OpenKey, QueryInfoKey, SetValueEx
from lib.common.abst... |
# 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 winreg import HKEY_CURRENT_USER, KEY_READ, KEY_SET_VALUE, REG_DWORD, CreateKeyEx, EnumKey, OpenKey, QueryInfoKey, SetValueEx
from lib.common.abst... |
# 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.common.abstracts import Package
from lib.common.common import check_file_extension
from lib.common.constants import OPT_ARGUMENTS
from lib.com... |
# 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
import shutil
try:
from rarfile import BadRarFile, RarFile
HAS_RARFILE = True
except ImportError:
HAS_RARFILE = ... |
from lib.common.abstracts import Package
from lib.common.common import check_file_extension
class RDP(Package):
"""RDP analysis package."""
PATHS = [
("SystemRoot", "system32", "mstsc.exe"),
]
def start(self, path):
args = self.options.get("arguments")
path = check_file_exte... |
# 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.common.abstracts import Package
class Reg(Package):
"""Reg analysis package."""
PATHS = [
("SystemRoot", "System32", "reg.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.
from lib.common.abstracts import Package
from lib.common.common import check_file_extension
from lib.common.constants import OPT_ARGUMENTS
class Regs... |
# This file is part of CAPE Sandbox - https://github.com/kevoreilly/CAPE
# See the file 'docs/LICENSE' for copying permission.
from lib.common.abstracts import Package
class SCT(Package):
"""SCT analysis package."""
PATHS = [
("SystemRoot", "system32", "regsvr32.exe"),
]
summary = "Opens the... |
# 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 ctypes
import logging
import sys
from lib.api.process import Process
from lib.common.abstracts import Package
from lib.common.common import che... |
import ctypes
import logging
import sys
from winreg import (
HKEY_LOCAL_MACHINE,
KEY_ALL_ACCESS,
KEY_WOW64_64KEY,
REG_EXPAND_SZ,
REG_MULTI_SZ,
CreateKeyEx,
DeleteValue,
OpenKeyEx,
SetValueEx,
)
from lib.api.process import Process
from lib.common.abstracts import Package
from lib.com... |
# 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 shutil
from lib.common.abstracts import Package
from lib.common.constants import OPT_OFFSET, OPT_PROCDUMP
class Shellcode(Package):... |
# 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 shutil
from lib.common.abstracts import Package
from lib.common.constants import OPT_OFFSET, OPT_PROCDUMP
class Shellcode_x64(Packa... |
# 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.common.abstracts import Package
class SWF(Package):
"""Shockwave Flash analysis package.
Download a version of standalone flash from... |
# 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 time
import webbrowser
from lib.common.abstracts import Package
class TorBrowserExt(Package):
"""TOR analysis package (with extension)."""
... |
# 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 shutil import copyfile
from lib.common.abstracts import Package
class VBSJSE(Package):
"""VBS/JSE analysis package."""
PATHS = [
... |
# 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.common.abstracts import Package
# Originally proposed by kidrek:
# https://github.com/cuckoobox/cuckoo/pull/136
class VBS(Packag... |
# Copyright (C) 2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.common.abstracts import Package
from lib.common.common import check_file_extension
class WSF(Package):
"""Windows Scripting File analysis pa... |
# 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.common.abstracts import Package
from lib.common.common import check_file_extension
from lib.common.constants import MSOFFICE_TRUSTED_PATH, TRU... |
# 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.common.abstracts import Package
from lib.common.common import check_file_extension
from lib.common.constants import MSOFFICE_TRUSTED_PATH, TRU... |
# 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.common.abstracts import Package
class Xps(Package):
"""XPS analysis package."""
PATHS = [
("SystemRoot", "system32", "xpsrc... |
# Copyright (C) 2016 Brad Spengler
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.common.abstracts import Package
from lib.common.common import check_file_extension
class XSLT(Package):
"""XSLT file analysis package."""
PAT... |
# 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.common.abstracts import Package
from lib.common.constants import (
ARCHIVE_OPTIONS,
OPT_APPDATA,
OPT_ARG... |
# Copyright (C) 2021 CSIT
# This file is part of CAPE Sandbox - http://www.capesandbox.com
# See the file 'docs/LICENSE' for copying permission.
import logging
import os
import shutil
from typing import Tuple
from lib.common.abstracts import Package
from lib.common.constants import (
DLL_OPTIONS,
OPT_APPDATA,... |
# 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 shutil
import subprocess
import sys
from datetime import date, datetime
from enum import Enum
from pathlib import Path
from winreg import (
HKEY_CLASSES_ROOT,
HKEY_CURRENT_CONFIG,
HKEY_CURRENT_USER,
HKEY_LOCAL_MACHINE,
HKEY_PERFORMANCE_DATA... |
"""Basic import/instantiate test for analysis packages."""
import importlib
import inspect
import unittest
from lib.common.abstracts import Package
class TestAnalysisPackages(unittest.TestCase):
def class_from_analysis_package(self, module_name):
module = importlib.import_module(module_name)
mem... |
"""Tests for Analyzer and CommandPipeHandler.
Major components not yet tested:
- Analyzer.run()
- Analyzer.complete()
"""
import os
import random
import tempfile
import unittest
from unittest.mock import MagicMock, patch
import analyzer
from analyzer import Analyzer, CommandPipeHandler
class TestModule(unittest.Te... |
"""Tests for analyzer.Files class and for protected_path() functions."""
import unittest
from analyzer import Files
class TestFiles(unittest.TestCase):
def test_can_instantiate(self):
files = Files()
self.assertIsInstance(files, Files)
self.assertFalse(files.files)
self.assertFal... |
"""Tests for analyzer.ProcessList class."""
import unittest
from analyzer import ProcessList
class TestProcessList(unittest.TestCase):
def test_can_instantiate(self):
process_list = ProcessList()
self.assertIsInstance(process_list, ProcessList)
def test_add_pid(self):
"""Calling add... |
import os
import threading
import unittest
from unittest.mock import MagicMock, patch
from lib.api.process import Process
class ProcessTests(unittest.TestCase):
@patch("lib.api.process.PSAPI", MagicMock(), create=True)
def test_unknown_image_name(self):
process = Process()
assert f"{process}"... |
import importlib
import unittest
from unittest.mock import MagicMock, patch
from lib.common import abstracts
class TestPackageConfiguration(unittest.TestCase):
def test_private_package_configuration(self):
# test analysis package
package_module = self.__class__.__module__
# and its privat... |
import unittest
from modules.packages.ps1 import PS1
class TestPS1(unittest.TestCase):
def test_get_paths(self):
"""By default, the first path should be powershell.exe"""
package_name = "modules.packages.ps1"
__import__(package_name, globals(), locals(), ["dummy"])
ps1_module = PS... |
dnsbl_servers = (
"zen.spamhaus.org",
"dnsbl.sorbs.net",
"bl.spamcop.net",
"cbl.abuseat.org",
"b.barracudacentral.org",
"dnsbl-1.uceprotect.net",
"dnsbl-2.uceprotect.net",
"dnsbl-3.uceprotect.net",
"dnsbl.dronebl.org",
"noptr.spamrats.com",
"multi.surbl.org",
"psbl.surrie... |
# Here you can add your names for your detection to match it
# First is how it was matched, second is how you want to represent it
# We won't modify this. so you can keep your detections mapping schema here
family_detection_names = {
# Example:
# "azorult": "Azorult",
}
|
domain_passlist_re = [
# Certificate Trust Update domains
r"^ocsp\.usertrust\.com$",
r"\.windows\.com$",
r"\.windowsupdate\.com$",
r"^ocsp\.comodoca\.com$",
r"^crl\.microsoft\.com$",
r"^urs\.microsoft\.com$",
r"\.microsoft\.com$",
r"\.skype\.com$",
r"\.live\.com$",
r"clients[... |
# Add uppercase version too as ComputerName is USERNAME-PC
SANDBOX_USERNAMES = []
# Files blacklisted because of generating noise in reports.
FILES_DENYLIST = [
"PIPE\\srvsvc",
"Device\\KsecDD",
"MountPointManager",
"DosDevices\\pipe",
"\\Device\\RasAcd",
"system32\\WindowsPowerShell\\v1.0\\Mod... |
# 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.
# ToDo upgrade
# Deprecation warnings in 7.15.0 pre-releases
# https://github.com/elastic/elasticsearch-py/issues/1698
import datetime
import logging
... |
import collections
import functools
import itertools
import logging
import time
from typing import Any, Callable, Sequence
from bson import ObjectId
from lib.cuckoo.common.config import Config
log = logging.getLogger(__name__)
logging.getLogger("pymongo").setLevel(logging.ERROR)
repconf = Config("reporting")
mdb = ... |
import itertools
import logging
from pymongo import UpdateOne, errors
from dev_utils.mongodb import (
mongo_bulk_write,
mongo_delete_data,
mongo_delete_data_range,
mongo_delete_many,
mongo_find,
mongo_find_one,
mongo_hook,
mongo_insert_one,
mongo_update_many,
mongo_update_one,
... |
# 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.
|
# -*- coding: utf-8 -*-
#
# CAPE Sandbox documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are c... |
import os
import json
import faiss
from github import Github
from sentence_transformers import SentenceTransformer
import google.generativeai as genai
# --- Configuration ---
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
REPO_NAME = os.getenv('REPO_NAME')
try:
ISSUE_NUMBER = int(os.getenv('ISSUE_NUMBER'))
except (TypeE... |
import os
import json
import faiss
import numpy as np
from github import Auth
from github import Github
from sentence_transformers import SentenceTransformer
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_community.document_loaders import DirectoryLoader
from datetime import datetime,... |
# 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.
|
# encoding: utf-8
# 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 io
import logging
import os
import socket
import threading
import time
... |
import json
import logging
import os
import re
# from glob import glob
import shutil
import sys
from contextlib import suppress
from hashlib import sha256
from pathlib import Path
from queue import Queue
from socket import if_nameindex
from threading import Thread
import urllib3
try:
from deepdiff import DeepDif... |
import hashlib
import logging
# import tempfile
from collections.abc import Iterable, Mapping
from contextlib import suppress
from pathlib import Path
from lib.cuckoo.common.config import Config
from lib.cuckoo.common.constants import CUCKOO_ROOT
from lib.cuckoo.common.objects import File
from lib.cuckoo.common.path_... |
import atexit
import logging
import os
import shutil
import sys
import time
from contextlib import suppress
from datetime import datetime, timedelta
from multiprocessing.pool import ThreadPool
from lib.cuckoo.common.config import Config
from lib.cuckoo.common.constants import CUCKOO_ROOT
from lib.cuckoo.common.dist_db... |
# 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
def color(text: str, color_code: int) -> str:
"""Colorize text.
@param text: text.
@param color_code: color.
@re... |
# 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 contextlib
from typing import Dict
from lib.cuckoo.common.config import Config
repconf = Config("reporting")
if repconf.mongodb.enabled:
... |
import binascii
import logging
import os
import struct
from pathlib import Path
log = logging.getLogger(__name__)
try:
import bson
HAVE_BSON = True
except ImportError:
HAVE_BSON = False
else:
# The BSON module provided by pymongo works through its "BSON" class.
if hasattr(bson, "BSON"):
... |
# 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 glob
import os
from typing import Dict, Iterable
from lib.cuckoo.common.colors import bold, red
from lib.cuckoo.common.cons... |
# 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
_current_dir = os.path.abspath(os.path.dirname(__file__))
CUCKOO_ROOT = os.path.normpath(os.path.join(_current_dir, "..", "..", ".."))
CUST... |
# 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.
REG_NONE = 0
REG_SZ = 1
REG_EXPAND_SZ = 2
REG_BINARY = 3
REG_DWORD_LITTLE_ENDIAN = 4
REG_DWORD = 4
REG_DWORD_BIG_ENDIAN = 5
PAGE_NOACCESS = 0x00000001... |
# Copyright (C) 2015 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 logging
import os
import tempfile
from typing import List
from lib.cuckoo.common.config import Config
from lib.cuckoo.common.exce... |
import copy
class Dictionary(dict):
"""Cuckoo custom dict."""
def __deepcopy__(self, memo=None):
new = self.__class__()
for key, value in self.items():
new[key] = copy.deepcopy(value, memo=memo)
return new
def __getattr__(self, key):
return self.get(key)
... |
import sys
from datetime import datetime
from typing import List, Optional
# http://pythoncentral.io/introductory-tutorial-python-sqlalchemy/
from sqlalchemy import (
Column,
create_engine,
DateTime,
ForeignKey,
Integer,
String,
Table,
Text,
)
from sqlalchemy.exc import OperationalError... |
# 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 select
import socket
import threading
from typing import Callable
try:
import pycares
HAVE_CARES = True
except Exception:
HAVE_CAR... |
import logging
try:
import dnfile
HAVE_DNFILE = True
logging.getLogger("dnfile").setLevel(logging.CRITICAL)
logging.getLogger("dnfile.stream").setLevel(logging.CRITICAL)
except ImportError:
HAVE_DNFILE = False
log = logging.getLogger("dotnet_utils")
def dotnet_user_strings(file: str = False, d... |
# 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 email
import mimetypes
from email.header import decode_header, make_header
from . import utils
from .path_utils import path_get_filename
SAFE_... |
# 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.
class CuckooCriticalError(Exception):
"""Cuckoo struggle in a critical error."""
pass
class CuckooStartupError(CuckooCriticalError):
""... |
import struct
import pefile
# dotnet
def get_mdtoken(data: bytes) -> int:
"""
Extracts a metadata token from the given byte data.
The function interprets the first 4 bytes of the input data as an unsigned
integer in little-endian format and then masks it with 0xFFFFFF to obtain
the metadata toke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.