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.

FileKindSize
LICENSEother340 B
SKILL.mdskill md2.7 KB
references/api-reference.mdmarkdown1.4 KB
scripts/analyst.pyscript3.1 KB

references/api-reference.md

View on GitHub
# API Reference: Hunting Fileless and In-Memory Threats

## Overview

`scripts/analyst.py` parses PowerShell script-block (4104), process, and registry telemetry (CSV or
JSON-lines) and flags in-memory loading patterns, large base64 blobs in script blocks, and
registry-resident encoded payloads. It parses telemetry only and executes nothing.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | csv, json, regex, file IO |

## Core functions

### `hunt(path)`
Returns scored in-memory script findings, registry-resident payloads, and a suspicion flag.

## Heuristics

- In-memory: `[Reflection.Assembly]::Load`, `VirtualAlloc`/`WriteProcessMemory`, `IEX`/
  `Invoke-Expression`, `DownloadString`, `FromBase64String`.
- Large base64 (≥200 chars) in script block or large encoded registry values under `Software`/`Run`.

## Expected fields

`ScriptBlockText`/`CommandLine`/`Message`; `TargetObject` + `Details` for registry writes.

## Usage

```bash
python scripts/analyst.py hunt events.csv
```

## Sources

- MITRE ATT&CK T1620 Reflective Code Loading; T1059.001 PowerShell — https://attack.mitre.org/
- PowerShell Script Block Logging (Event 4104) — https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_logging_windows
- Registry-resident payload (fileless storage) patterns from public detection research
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: 472kUpdated 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: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated 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