-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Queue_task_timeout' of https://github.com/cccs-mog/CAPEv2…
… into Queue_task_timeout
- Loading branch information
Showing
70 changed files
with
2,673 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
rule SlowLoader | ||
{ | ||
meta: | ||
author = "kevoreilly" | ||
description = "SlowLoader detonation aide for slow cpus (thread race)" | ||
cape_options = "break-on-return=CreateProcessA,action0=sleep:1000,count=0" | ||
packed = "f6eeb73ffb3e6d6cc48f74344cb590614db7e3116ba00a52aefd7dff468a60a5" | ||
strings: | ||
$code = {0F B6 44 07 08 0F B6 54 1F 08 03 C2 25 FF 00 00 80 79 07 48 0D 00 FF FF FF 40 89 45 ?? 6A 00} | ||
condition: | ||
any of them | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
rule Themida | ||
{ | ||
meta: | ||
author = "kevoreilly" | ||
description = "Themida detonation shim" | ||
cape_options = "unhook-apis=NtSetInformationThread,force-sleepskip=0" | ||
packed = "6337ff4cf413f56cc6c9a8e67f24b8d7f94f620eae06ac9f0b113b5ba82ea176" | ||
strings: | ||
$code = {FC 31 C9 49 89 CA 31 C0 31 DB AC 30 C8 88 E9 88 D5 88 F2 B6 08 66 D1 EB 66 D1 D8 73 09} | ||
condition: | ||
uint16(0) == 0x5A4D and all of them | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Copyright (C) 2024 [email protected] | ||
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org | ||
# See the file 'docs/LICENSE' for copying permission. | ||
import logging | ||
import os | ||
import subprocess | ||
import tempfile | ||
import time | ||
from threading import Thread | ||
|
||
from lib.common.abstracts import Auxiliary | ||
from lib.common.results import upload_to_host | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class Browsermonitor(Auxiliary, Thread): | ||
"""Monitors Browser Extension request logs.""" | ||
|
||
def __init__(self, options=None, config=None): | ||
if options is None: | ||
options = {} | ||
Auxiliary.__init__(self, options, config) | ||
Thread.__init__(self) | ||
self.do_run = False | ||
self.enabled = config.browsermonitor | ||
self.startupinfo = subprocess.STARTUPINFO() | ||
self.startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW | ||
self.browser_logfile = "" | ||
self.last_modification = 0.0 | ||
self._is_first_save = True | ||
|
||
def _find_browser_extension(self): | ||
temp_dir = tempfile.gettempdir() | ||
while not self.browser_logfile and self.do_run: | ||
temp_dir_list = os.listdir(temp_dir) | ||
for directory in temp_dir_list: | ||
tmp_directory_path = os.path.join(temp_dir, directory) | ||
if not os.path.isdir(tmp_directory_path): | ||
continue | ||
if not directory.startswith("tmp"): | ||
continue | ||
tmp_dir_files = os.listdir(tmp_directory_path) | ||
for file in tmp_dir_files: | ||
if file.startswith("bext_") and file.endswith(".json"): | ||
self.browser_logfile = os.path.join(temp_dir, directory, file) | ||
log.debug(f"Found extension logs: {self.browser_logfile}") | ||
break | ||
time.sleep(1) | ||
|
||
def _collect_browser_logs(self): | ||
if not self._is_first_save and self.last_modification != os.path.getmtime(self.browser_logfile): | ||
return | ||
self.last_modification = os.path.getmtime(self.browser_logfile) | ||
upload_to_host(self.browser_logfile, "browser/requests.log") | ||
self._is_first_save = False | ||
|
||
def run(self): | ||
self.do_run = True | ||
if self.enabled: | ||
self._find_browser_extension() | ||
self.last_modification = os.path.getmtime(self.browser_logfile) | ||
while self.do_run: | ||
self._collect_browser_logs() | ||
time.sleep(1) | ||
return True | ||
return False | ||
|
||
def stop(self): | ||
if self.enabled: | ||
self.do_run = False | ||
if self.browser_logfile: | ||
self._collect_browser_logs() | ||
return True |
Oops, something went wrong.