Each rewritten description now states both what the skill does (concrete
capability, named tools/artifacts) and an explicit when-to-use trigger,
improving agent discovery/activation. Grounded in each skill's own body;
changes confined to the `description` field only (bodies and all other
frontmatter untouched). Produced by a gated audit->rewrite->recheck loop
(548 -> 0 flagged) with a sampled anti-invention check (0 ungrounded).
Schema: 817/817 pass. Framework-ID gate: 0 defects.
Deploy and operate the CAPEv2 malware sandbox (a Cuckoo derivative) to run samples in a monitored Windows guest VM, capturing behavioral signatures, dropped files, PCAP network traffic, and family-specific configuration extraction (e.g. Emotet, TrickBot, Cobalt Strike) via cape-parsers. Use when a suspicious file or payload needs automated dynamic analysis, anti-evasion debugger tricks, or config/payload extraction.
cybersecurity
malware-analysis
cape
sandbox
automated-analysis
malware-analysis
behavioral-analysis
payload-extraction
cuckoo
1.0
mahipal
Apache-2.0
DE.AE-02
RS.AN-03
ID.RA-01
DE.CM-01
T1027
T1055
T1140
T1497
T1070
Performing Automated Malware Analysis with CAPE
Overview
CAPE (Config And Payload Extraction) is an open-source malware sandbox derived from Cuckoo that automates behavioral analysis, payload dumping, and configuration extraction. CAPEv2 features API hooking for behavioral instrumentation, captures files created/modified/deleted during execution, records network traffic in PCAP format, and includes 70+ custom configuration extractors (cape-parsers) for families like Emotet, TrickBot, Cobalt Strike, AsyncRAT, and Rhadamanthys. The signature system includes 1000+ behavioral signatures detecting evasion techniques, persistence, credential theft, and ransomware behavior. CAPE's debugger enables dynamic anti-evasion bypasses combining debugger actions within YARA signatures. Recommended deployment: Ubuntu LTS host with Windows 10 21H2 guest VM.
When to Use
When conducting security assessments that involve performing automated malware analysis with cape
When following incident response procedures for related security events
When performing scheduled security testing or auditing activities
When validating security controls through hands-on testing
Prerequisites
Ubuntu 22.04 LTS server (8+ CPU cores, 32GB+ RAM, 500GB+ SSD)
KVM/QEMU virtualization support
Windows 10 21H2 guest image
Python 3.9+ with CAPEv2 dependencies
Network configuration for isolated analysis network
Workflow
Step 1: Submit and Analyze Samples via API
#!/usr/bin/env python3"""CAPE sandbox API client for automated malware submission and analysis."""importrequestsimportjsonimporttimeimportsysfrompathlibimportPathclassCAPEClient:def__init__(self,base_url="http://localhost:8000",api_token=None):self.base_url=base_url.rstrip("/")self.headers={}ifapi_token:self.headers["Authorization"]=f"Token {api_token}"defsubmit_file(self,filepath,options=None):"""Submit a file for analysis."""url=f"{self.base_url}/apiv2/tasks/create/file/"files={"file":open(filepath,"rb")}data=optionsor{}data.setdefault("timeout",120)data.setdefault("enforce_timeout",False)resp=requests.post(url,files=files,data=data,headers=self.headers)resp.raise_for_status()result=resp.json()task_id=result.get("data",{}).get("task_ids",[None])[0]print(f"[+] Submitted {filepath} -> Task ID: {task_id}")returntask_iddefget_status(self,task_id):"""Check task analysis status."""url=f"{self.base_url}/apiv2/tasks/status/{task_id}/"resp=requests.get(url,headers=self.headers)returnresp.json().get("data","unknown")defwait_for_completion(self,task_id,poll_interval=15,max_wait=600):"""Wait for analysis to complete."""elapsed=0whileelapsed<max_wait:status=self.get_status(task_id)ifstatus=="reported":print(f"[+] Task {task_id} completed")returnTruetime.sleep(poll_interval)elapsed+=poll_intervalprint(f" Waiting... ({elapsed}s, status: {status})")returnFalsedefget_report(self,task_id):"""Retrieve full analysis report."""url=f"{self.base_url}/apiv2/tasks/get/report/{task_id}/"resp=requests.get(url,headers=self.headers)returnresp.json()defget_config(self,task_id):"""Get extracted malware configuration."""report=self.get_report(task_id)configs=report.get("CAPE",{}).get("configs",[])returnconfigsdefget_dropped_files(self,task_id):"""List files dropped during analysis."""report=self.get_report(task_id)returnreport.get("dropped",[])defget_network_iocs(self,task_id):"""Extract network IOCs from analysis."""report=self.get_report(task_id)network=report.get("network",{})iocs={"dns":[d.get("request")fordinnetwork.get("dns",[])],"http":[h.get("uri")forhinnetwork.get("http",[])],"tcp":[f"{h.get('dst')}:{h.get('dport')}"forhinnetwork.get("tcp",[])],}returniocsdefanalyze_sample(self,filepath):"""Full automated analysis pipeline."""task_id=self.submit_file(filepath)ifnottask_id:returnNoneifself.wait_for_completion(task_id):report={"task_id":task_id,"config":self.get_config(task_id),"network_iocs":self.get_network_iocs(task_id),"dropped_files":len(self.get_dropped_files(task_id)),}returnreportreturnNoneif__name__=="__main__":iflen(sys.argv)<2:print(f"Usage: {sys.argv[0]} <malware_sample> [cape_url]")sys.exit(1)url=sys.argv[2]iflen(sys.argv)>2else"http://localhost:8000"client=CAPEClient(url)result=client.analyze_sample(sys.argv[1])ifresult:print(json.dumps(result,indent=2))
Validation Criteria
Samples submitted and analyzed within configured timeout
Behavioral signatures triggered for known malware families
Malware configurations extracted by cape-parsers
Network traffic captured and IOCs extracted
Dropped files and payloads collected for further analysis
Anti-evasion bypasses effective against sandbox-aware malware