meltedinhex/analyst-ai-pack / skills/hunting-fileless-and-in-memory-threats
hunting-fileless-and-in-memory-threats
FlaggedHunts 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.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 2.7 KB |
| references/api-reference.md | markdown | 1.4 KB |
| scripts/analyst.py | script | 3.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
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |