Skip to content

meltedinhex/analyst-ai-pack / skills/analyzing-api-call-traces

analyzing-api-call-traces

Verified

Analyzes API call traces from a sandbox or API monitor (JSON) to group calls by category, reconstruct high-level behaviors (process injection, file drops, network, crypto), and flag suspicious call sequences. Activates for requests to analyze an API trace, interpret sandbox API logs, or identify behavior from Win32/Native API calls.

FileKindSize
LICENSEother340 B
SKILL.mdskill md2.6 KB
references/api-reference.mdmarkdown1.3 KB
scripts/analyst.pyscript3.8 KB

references/api-reference.md

View on GitHub
# API Reference: Analyzing API Call Traces

## Overview

`scripts/analyst.py` classifies a JSON API trace into behavioral categories and detects ordered
API sequences indicative of process injection, hollowing, dynamic API resolution, and crypto
routines. It parses JSON only and executes nothing.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | json, argparse |

## Accepted input shapes

- A list of strings (API names) or call objects with `api`/`name`/`function` keys.
- A dict containing `calls`, `apis`, or a CAPE-style `apistats` mapping.

## Core functions

### `classify(path)`
Returns total call count, per-category counts, detected behaviors (with ATT&CK IDs), and unknown
APIs.

## Sequence signatures

`VirtualAllocEx → WriteProcessMemory → CreateRemoteThread` (T1055.002), hollowing (T1055.012),
`LoadLibrary → GetProcAddress` (T1027.007), `CryptAcquireContext → CryptDecrypt` (T1027). Matching
respects order via a sliding cursor.

## Usage

```bash
python scripts/analyst.py classify trace.json
```

## Sources

- MITRE ATT&CK T1106 Native API; T1055 Process Injection — https://attack.mitre.org/
- Windows API Index — https://learn.microsoft.com/windows/win32/apiindex/windows-api-list
- CAPE/Cuckoo report `behavior.apistats` structure (public sandbox schema)
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall