malware-detection-ir-independent-phases-analysis-prototype

incident-responsedefensivemalware-analysisdetection-engineeringincident-responseforensicswindowsartifact-analysis

Task

One synthetic campaign variant is staged across three linked phases:

  • /app/phase1/case: static malware detonation artifacts
  • /app/phase2/corpus: malicious and benign telemetry bundles for rule authoring
  • /app/phase3/evidence: incident-response and forensic evidence

Write all four outputs:

  1. /app/output/phase1_malware_report.json
  2. /app/output/phase2_detection_rule.yaml
  3. /app/output/phase2_rule_validation.json
  4. /app/output/phase3_incident_report.json

Also maintain /app/output/plan.md as a concise process artifact describing the evidence reviewed, hypotheses considered, and validation performed.

All three phases come from the same selected variant. However, each phase is scored against its own artifacts. Do not blindly carry an earlier conclusion forward if the current phase evidence points somewhere else.

Phase 1: Malware Analysis

Read /app/phase1/case and write /app/output/phase1_malware_report.json as a JSON object with these exact top-level fields:

  • sample_id: string
  • malware_category: one of ransomware, rat, infostealer, loader, dropper
  • risk_level: one of LOW, MEDIUM, HIGH, CRITICAL
  • malicious_capabilities: array of objects
  • primary_destination: object
  • notable_iocs: object
  • triage_decisions: array of objects
  • capability_evidence_matrix: array of objects
  • summary: string

Each capability entry must contain:

  • name: one of system_fingerprinting, process_injection, browser_credential_access, persistence_scheduled_task, archive_staging, command_and_control_https, dns_beaconing, ransomware_encryption, lsass_memory_dump, service_installation
  • attck_ids: array of MITRE ATT&CK technique IDs
  • evidence_event_ids: array of exact event IDs from the case files

primary_destination must contain:

  • protocol
  • host

notable_iocs must contain:

  • domains: array of domain strings
  • dropped_files: array of file paths
  • scheduled_task: string

triage_decisions must contain explicit analyst decisions for suspicious evidence that was reviewed but should not become a capability or IOC. Include string-only clues that lack supporting behavior, benign background activity, and lookalike/decoy events. Each entry must contain:

  • evidence_id: exact event ID from the Phase 1 case files
  • classification: one of malicious, benign, decoy, unsupported_string_only
  • reason: concise reason explaining why the evidence is included or excluded

capability_evidence_matrix must contain one entry for every reported capability. Each entry must contain:

  • capability: exact capability name from malicious_capabilities
  • primary_event_ids: array of exact event IDs that directly prove the capability
  • corroborating_event_ids: array of exact event IDs from a different artifact family that strengthen the conclusion
  • excluded_related_event_ids: array of exact event IDs that look related but should not be used as primary support
  • confidence: one of medium, high
  • rationale: concise reason tying the primary and corroborating evidence to the capability and explaining any excluded related events

For this task, dropped_files means attacker-created files written during the malicious chain, such as downloaded loaders, executable payloads, persistence binaries, and staged archives. Do not include the original delivery document, read-only browser data stores, benign background files, helper identifiers, logs, or decoys unless the current phase evidence shows they were created as attacker payloads or staging artifacts.

Phase 2: Detection Engineering

Read /app/phase2/corpus and /app/phase2/rule_schema.md. Write a Sigma-like YAML rule to /app/output/phase2_detection_rule.yaml, then write an analyst validation report to /app/output/phase2_rule_validation.json.

The verifier supports a small subset:

  • direct equality: field: value
  • substring match: field|contains: value
  • all substrings present: field|contains|all: [a, b]
  • suffix match: field|endswith: value

The detection block must define one or more named selections plus a condition. The condition may use only selection names with and, or, and parentheses. A telemetry bundle counts as detected when the bundle-level condition evaluates to true.

Your rule should match the malicious bundles for the selected variant and avoid matching the benign bundles. The rule must correlate at least two independent behaviors with and logic. A single-indicator rule such as only a C2 domain, only a DLL name, only a service name, or only a scheduled-task name is too broad for this task even if it happens to match the visible corpus.

Base the rule only on the telemetry available in phase 2. Do not assume your phase 1 answer was correct.

The rule should be behavioral and portable across equivalent telemetry. Do not depend on one-off identifiers such as event IDs or a single workstation name. Prefer chain-level logic such as downloader plus payload execution, execution plus C2, execution plus persistence, or service creation plus follow-on check-in. Near-miss benign controls may reuse one suspicious token, so the final condition must require a meaningful combination rather than a lone string match. A robust operational rule should handle equivalent malicious telemetry and benign near-misses that do not appear verbatim in the visible corpus. Avoid rules that only memorize one exact event value or that broaden to an entire vendor or domain family without the supporting behavior. Use stable behavior families from the telemetry, document the false-positive boundaries, and keep diagnostic, health-check, update, and control activity out of scope even when it reuses a suspicious token. When using substring operators, prefer stable tokens that tolerate small infrastructure naming variations, but only when paired with independent behavioral evidence.

phase2_rule_validation.json must contain exactly these top-level fields:

  • sample_id: string
  • rule_intent: string
  • corpus_results: array of objects
  • generalization_notes: object
  • rule_evaluation_trace: array of objects
  • summary: string

Each corpus_results entry must contain:

  • bundle: exact corpus filename, such as malicious-01.jsonl
  • expected_detection: boolean
  • reason: concise reason for why the rule should or should not alert

The validation report must cover every visible *.jsonl bundle in /app/phase2/corpus. generalization_notes must contain:

  • required_behavior_families: array of behavior-family strings that your rule intentionally correlates
  • false_positive_boundaries: array of near-miss conditions that your rule intentionally avoids

rule_evaluation_trace must contain one entry for every visible corpus bundle. Each entry must contain:

  • bundle: exact corpus filename
  • alert_decision: boolean result expected from your rule
  • matched_behavior_families: array of behavior-family strings that are present in the bundle and relevant to your rule
  • decisive_absent_or_benign_families: array of behavior-family strings that explain why a benign or near-miss bundle should not alert
  • rationale: concise explanation of the rule outcome for that bundle

Phase 3: Incident Response, Triage, and Forensics

Read /app/phase3/evidence and write /app/output/phase3_incident_report.json as a JSON object with these exact top-level fields:

  • sample_id: string
  • incident_id: string
  • affected_host: string
  • affected_user: string
  • initial_vector: short normalized label such as malicious_word_macro or malicious_excel_macro
  • first_seen_event_id: string
  • attacker_sequence: array of exact event IDs in chronological attack order
  • confirmed_iocs: object
  • excluded_events: array of objects
  • event_classification: array of objects
  • containment_actions: array of action strings
  • eradication_actions: array of action strings
  • summary: string

confirmed_iocs must contain:

  • domains: array of confirmed payload-delivery, command-and-control, or attacker follow-on infrastructure domains observed in Phase 3 network evidence. Do not include sender email domains unless Phase 3 network evidence also shows that domain hosted payload delivery, command-and-control, or follow-on attacker traffic.
  • dropped_files: array of file paths
  • scheduled_task: string
  • service_name: string or null

excluded_events must contain benign, unrelated, or background Phase 3 events that you considered and intentionally kept out of attacker_sequence, confirmed_iocs, and response actions. Each entry must contain:

  • event_id: exact event ID from /app/phase3/evidence
  • reason: concise reason explaining why this event is not part of the incident chain

event_classification must contain exactly one entry for every event in the Phase 3 JSONL evidence. Each entry must contain:

  • event_id: exact event ID from /app/phase3/evidence
  • source: one of auth, edr, email, proxy
  • classification: one of attacker, benign, unrelated, context
  • reason: concise reason explaining the classification

Use these Phase 3 classification meanings consistently:

  • attacker: event is part of the malicious delivery, execution, persistence, command-and-control, staging, or follow-on activity for the incident.
  • context: event is not malicious by itself, but establishes required incident context for the affected host/user, such as the relevant user logon before execution.
  • benign: event is non-malicious background, maintenance, telemetry, or lookalike activity that is useful to mention because it is close enough to the incident evidence that an analyst might otherwise confuse it with the malicious chain.
  • unrelated: event is outside the incident scope by host, user, service account, or infrastructure and does not belong in the attack sequence, confirmed IOCs, containment, or eradication. If an event is both clearly non-malicious and for a different host/user/account, prefer unrelated. benign is also acceptable for a different-host/user event only when your reason explicitly explains that it is a close lookalike or benign control considered and excluded from the attacker chain. In either case, these events must remain out of attacker_sequence, confirmed_iocs, containment, and eradication actions.

Use the same dropped_files definition as Phase 1, but derive it only from Phase 3 evidence. Include confirmed attacker-created loaders and payloads from the incident record; do not include the original delivery attachment or routine read-only data stores.

Use exact action strings in these formats:

  • isolate_host:<hostname>
  • block_domain:<domain>
  • delete_file:<path>
  • delete_task:<task_name>
  • delete_service:<service_name>

Containment actions should stop spread or command-and-control quickly. Eradication actions should remove the malware foothold and dropped payloads that are actually confirmed by the evidence.

For attacker_sequence, include the core malicious chain in order. If clearly supported attacker-side follow-on steps are also present, they may be included, but do not add benign background activity.

Base the incident report only on phase 3 evidence. If your malware-analysis answer in phase 1 may be wrong, do not repeat it here unless phase 3 evidence also supports it.

Environment

  • Read-only artifacts live only under /app/phase1, /app/phase2, and /app/phase3.
  • Write final answers only under /app/output.
  • You may use /testbed as scratch space for helper scripts or notes.
  • Python 3 is available in the container.

Constraints

  1. Base every answer only on the provided artifacts. Do not use the internet or external lookups.
  2. Use exact event IDs that appear in the current variant. Do not invent evidence.
  3. Only report capabilities, indicators, and attack steps actually supported by the artifacts; exclude routine benign background activity and unsupported string-only hints.
  4. Do not modify the case, corpus, evidence, or report source artifacts.
  5. When support spans more than one artifact type, cite evidence from more than one source instead of relying on a single weak clue.
  6. Keep summaries concise and analyst-facing.
  7. Re-derive each phase from its own artifact set. Later phases are scored independently, so do not let an earlier mistake poison later answers.