Skip to content

meltedinhex/analyst-ai-pack / skills/hunting-fileless-and-in-memory-threats

hunting-fileless-and-in-memory-threats

Flagged

Hunts for fileless and in-memory threats by correlating PowerShell script-block logs, encoded-command usage, in-memory loading patterns, and registry-resident payloads from Windows telemetry. Activates for requests to hunt fileless malware, detect in-memory execution, or find registry-resident and reflective-loading activity.

Hunting Fileless and In-Memory Threats

When to Use

  • You have PowerShell script-block logs (4104), process telemetry, and registry-write events and want to detect fileless execution that leaves little on disk.
  • You are hunting reflective loading, in-memory .NET execution, and registry-resident payloads.

Do not use this to alert on all PowerShell use — hunt the in-memory loading and encoded-payload patterns specifically.

Prerequisites

  • 4104 script-block logs and/or process and registry telemetry (CSV/JSON).

Workflow

Step 1: Hunt in-memory loading patterns

python scripts/analyst.py hunt events.csv

Flags [Reflection.Assembly]::Load, VirtualAlloc/WriteProcessMemory via PowerShell, Invoke-Expression of decoded blobs, DownloadString+IEX, and large base64 in script blocks.

Step 2: Detect registry-resident payloads

Surface writes of large encoded blobs to HKCU\Software\... Run-adjacent or custom keys (fileless storage).

Step 3: Confirm

Correlate script-block content with the parent process and subsequent network/child activity.

Step 4: Operationalize

Write detections for reflective loading and base64-heavy script blocks.

Validation

  • Flags are based on in-memory loading/encoded-payload patterns, not PowerShell presence.
  • Registry-resident payload detection keys on large encoded values.
  • Findings map to ATT&CK T1620/T1059.001/T1112.

Pitfalls

  • Legitimate admin scripts using Invoke-Expression — corroborate with content/parent.
  • Obfuscated script blocks splitting indicators across logs.
  • Constrained Language Mode evasions changing the observable API surface.

References

rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall