meltedinhex/analyst-ai-pack / skills/setting-up-an-isolated-malware-analysis-lab
setting-up-an-isolated-malware-analysis-lab
VerifiedBuilds a safe, isolated environment for detonating and analyzing malware using virtualization, host-only or simulated networking, and snapshotting. Activates for requests about creating a malware lab, sandbox VM, isolated analysis environment, or safe detonation setup.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 4.8 KB |
| references/api-reference.md | markdown | 1.5 KB |
| scripts/analyst.py | script | 2.9 KB |
scripts/analyst.py
View on GitHub#!/usr/bin/env python3
"""Isolation checks for a malware-analysis victim VM.
Parses a VMware ``.vmx`` (or VirtualBox ``VBoxManage showvminfo`` text) and flags settings
that would let a sample reach the real internet or escape to the host: bridged/NAT
adapters, enabled shared folders, and clipboard/drag-and-drop sharing.
Safe to run on the host — it only reads configuration text, never a sample.
"""
from __future__ import annotations
import argparse
import re
import sys
from pathlib import Path
# vmx key -> (regex of unsafe value, human explanation)
_UNSAFE_VMX = {
"ethernet*.connectiontype": (re.compile(r"\b(nat|bridged)\b", re.I),
"adapter uses NAT/bridged; use host-only/internal"),
"isolation.tools.copy.disable": (re.compile(r"false", re.I),
"clipboard copy from host is enabled"),
"isolation.tools.paste.disable": (re.compile(r"false", re.I),
"clipboard paste to host is enabled"),
"isolation.tools.dnd.disable": (re.compile(r"false", re.I),
"drag-and-drop is enabled"),
"sharedfolder.maxnum": (re.compile(r"[1-9]"),
"shared folders are configured"),
}
def parse_vmx(text: str) -> dict[str, str]:
config: dict[str, str] = {}
for line in text.splitlines():
m = re.match(r'\s*([\w.*]+)\s*=\s*"?([^"]*)"?\s*$', line)
if m:
config[m.group(1).lower()] = m.group(2)
return config
def check_config(config: dict[str, str]) -> list[str]:
"""Return a list of isolation problems found in the parsed config."""
problems: list[str] = []
for key, value in config.items():
for pattern, (bad, why) in _UNSAFE_VMX.items():
# support wildcard keys like ethernet0.connectiontype
key_re = "^" + re.escape(pattern).replace(r"\*", r"\d+") + "$"
if re.match(key_re, key) and bad.search(value):
problems.append(f"{key} = {value!r}: {why}")
has_adapter = any(k.endswith(".connectiontype") for k in config)
if not has_adapter:
problems.append("no network adapter found; confirm host-only is intended")
return problems
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description="Check victim VM isolation settings")
parser.add_argument("--check-config", required=True, metavar="VMX",
help="path to a .vmx file")
args = parser.parse_args(argv)
text = Path(args.check_config).read_text(encoding="utf-8", errors="replace")
problems = check_config(parse_vmx(text))
if problems:
print("ISOLATION PROBLEMS:")
for p in problems:
print(f" - {p}")
return 1
print("OK: no unsafe networking or host-sharing settings detected.")
return 0
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |