forked from kevoreilly/CAPEv2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pull] master from kevoreilly:master (#44)
* Update callback.py * Update callback.py * Package summary/description in UI (kevoreilly#2313) - Following on from kevoreilly#2220 now we display the package summary and description in the UI - In views.py: - Added code to parse the python analysis package modules, pulling out summary and description - Updated `get_form_data()` to return list of dicts, not list of strings - When sorting the package names, no longer be case sensitive - Updated the `submission/index.html` template to expect a dict per package - Added some tests - Tweak to `web/settings.py` so it can find the templates, even during test execution * Update cape2.sh * Add SslKeyLogFile aux module and PcapNg processing module (kevoreilly#2312) * Add SslKeyLogFile aux module and PcapNg processing module SslKeyLogFile sets the SSLKEYLOGFILE environment var on the guest and collects the resulting log file. This is especially useful when detonating inside of browsers. PcapNg takes SSL/TLS keys from tlsdump.log and SslKeyLogFile and injects them into the detonation PCAP using the `editcap` binary. The file is made available to download via the UI. * Update views.py * style: Automatic code formatting * Monitor update: Add capability to dynamically unhook previously hooked functions (unhook-apis option takes colon-separated list e.g. unhook-apis=NtSetInformationThread:NtDelayExecution) * Themida detonation shim * Update index.html * Update submit.rst * Only process PCAPs with httpreplay when tlsdump.log exists (kevoreilly#2315) These changes prevent PCAPs from being processed by httpreplay (Pcap2 processing module) when there are not TLS keys available. This is because httpreplay processing is very time intensive due to its pure-python implementation. Httpreplay's core use is to decrypt TLS traffic so it can be processed by Suricata. If there are no TLS keys available, there is no requirement to use it for processing. For context, when CAPE attempted to process a ~250MB PCAP with httpreplay, it took ~960 seconds. Without httpreplay, it took ~16 seconds. * style: Automatic code formatting * Stealc detection: loosen yara pattern slightly --------- Co-authored-by: doomedraven <[email protected]> Co-authored-by: Robin Koumis (SecureWorks) <[email protected]> Co-authored-by: Josh Feather <[email protected]> Co-authored-by: GitHub Actions <[email protected]> Co-authored-by: Kevin O'Reilly <[email protected]>
- Loading branch information
1 parent
a8aef6b
commit 98d0b3b
Showing
9 changed files
with
65 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
rule Themida | ||
{ | ||
meta: | ||
author = "kevoreilly" | ||
description = "Themida detonation shim" | ||
cape_options = "unhook-apis=NtSetInformationThread,force-sleepskip=0" | ||
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
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,30 @@ | ||
import time | ||
from dataclasses import dataclass, field | ||
|
||
|
||
@dataclass | ||
class Counter: | ||
"""Profiler that counts real and CPU time.""" | ||
|
||
real: float = field(default_factory=time.perf_counter) | ||
cpu: float = field(default_factory=time.process_time) | ||
|
||
def __sub__(self, other): | ||
real = self.real - other.real | ||
cpu = self.cpu - other.cpu | ||
return Counter(real, cpu) | ||
|
||
def __add__(self, other): | ||
real = self.real + other.real | ||
cpu = self.cpu + other.cpu | ||
return Counter(real, cpu) | ||
|
||
def __str__(self) -> str: | ||
return f"{self.real:.2f}s (cpu {self.cpu:.2f}s)".format(self.real, self.cpu) | ||
|
||
def __enter__(self): | ||
return self | ||
|
||
def __exit__(self, exc_type, exc_value, exc_tb): | ||
elapsed = Counter() - self | ||
self.__dict__.update(**elapsed.__dict__) |
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