mirror of
https://github.com/cuckoosandbox/cuckoo.git
synced 2026-10-12 02:12:40 +00:00
This commit modifies some parts of the Cuckoo Analyzer logic to ensure a more smooth usage in situations where there would in the past be errors. * Uses the error message from is32bit.exe in the CuckooError exception. Now that is32bit.exe will no longer throw "access denied" message boxes, but instead print a simple message, this will help propagate and handle the exact errors. * Make the dump TLS master secrets module aware of this change and have it properly handle access denied issues. That is, rather than throwing a hard crash, it will now provide a simple warning to the end user. In the future this should be shown prominently in the Web Interface. * A couple of unit tests are introduced to test the above as well as various stability improvements in the is32bit.exe utility when it looks at potential MZ-DOS/PE files. Conflicts: cuckoo/data-private/cwd/hashes.txt tests/utils.py tests/windows/test_process.py
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
# Copyright (C) 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 shutil
|
|
import sys
|
|
|
|
from cuckoo.misc import is_windows, is_linux, is_macosx
|
|
|
|
# Note that collect_ignore is a parameter for pytest so that it knows which
|
|
# unit tests to skip etc. In other words, perform platform-specific unit tests
|
|
# (in terms of the Cuckoo Analyzer) depending on the current host machine.
|
|
collect_ignore = []
|
|
|
|
if is_windows():
|
|
sys.path.insert(0, "cuckoo/data/analyzer/windows")
|
|
collect_ignore.append("tests/linux")
|
|
collect_ignore.append("tests/darwin")
|
|
|
|
# Copy over the monitoring binaries as if we were in a real analysis.
|
|
monitor = open("cuckoo/data/monitor/latest", "rb").read().strip()
|
|
for filename in os.listdir("cuckoo/data/monitor/%s" % monitor):
|
|
shutil.copy(
|
|
"cuckoo/data/monitor/%s/%s" % (monitor, filename),
|
|
"cuckoo/data/analyzer/windows/bin/%s" % filename
|
|
)
|
|
|
|
if is_linux():
|
|
sys.path.insert(0, "cuckoo/data/analyzer/linux")
|
|
collect_ignore.append("tests/windows")
|
|
collect_ignore.append("tests/darwin")
|
|
|
|
if is_macosx():
|
|
sys.path.insert(0, "cuckoo/data/analyzer/darwin")
|
|
collect_ignore.append("tests/windows")
|
|
collect_ignore.append("tests/linux")
|