Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions lib/cuckoo/common/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def calc_scoring(results: dict, matched: list):
4. Benign: The file is likely trusted and digitally signed.
- Score: 0-3/10 (Benign)
5. Undetected/Failed: The file does not trigger any signatures.
- Score: 0/10 (Undetected/Failed)
- Static analysis: Undetected, or Suspicious if raw YARA rules matched
the target file without being tied to a known family.
- Dynamic analysis: Undetected if a process tree exists, otherwise
Failed (the sample never ran).
- Score: 0/10 (Undetected/Failed), or 4.0/10 for the Suspicious static case above.

Parameters:
results (dict): The analysis results containing details about the file and its behavior.
Expand Down Expand Up @@ -156,7 +160,20 @@ def calc_scoring(results: dict, matched: list):
# 5. Undetected/Failed
else:
finalMalscore = 0
if results.get("behavior", {}).get("processtree", []):
if category == "static":
# Static analysis never executes the sample, so there is never a
# process tree by design. Fall back to raw YARA matches on the
# target file (not tied to a known family) to decide between
# Undetected and Suspicious instead of assuming failure.
target_file = results.get("target") or {}
file_info = target_file.get("file") or {}
yara_hits = file_info.get("yara") or file_info.get("cape_yara") or []
if yara_hits:
status = "Suspicious"
finalMalscore = 4.0
else:
status = "Undetected"
elif results.get("behavior", {}).get("processtree", []):
status = "Undetected"
else:
status = "Failed"
Expand Down
Loading