[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7364S5KF1MZH3R27TTAVAFB":3,"skill-same:01M7364S5KF1MZH3R27TTAVAFB":91},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":56,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M7364S5KF1MZH3R27TTAVAFB","performing-malware-hash-enrichment-with-virustotal",null,"Enrich malware file hashes using the VirusTotal API to retrieve detection rates, behavioral analysis, YARA matches, and contextual threat intelligence for incident triage and IOC validation.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: performing-malware-hash-enrichment-with-virustotal\ndescription: Enrich malware file hashes using the VirusTotal API to retrieve detection\n  rates, behavioral analysis, YARA matches, and contextual threat intelligence for\n  incident triage and IOC validation.\ndomain: cybersecurity\nsubdomain: threat-intelligence\ntags:\n- virustotal\n- malware-analysis\n- hash-enrichment\n- ioc\n- threat-intelligence\n- triage\n- api\n- detection\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- ID.RA-01\n- ID.RA-05\n- DE.CM-01\n- DE.AE-02\nmitre_attack:\n- T1591\n- T1592\n- T1593\n- T1589\n- T1027\nsource: https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\nsource_commit: 04450304b12645cb2b974ab96d28c0664758a88d\nnote: \"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.\"\n---\n# Performing Malware Hash Enrichment with VirusTotal\n\n## Overview\n\nVirusTotal is the world's largest crowdsourced malware corpus, scanning files with 70+ antivirus engines and providing behavioral analysis, YARA rule matches, network indicators, and community intelligence. This skill covers using the VirusTotal API v3 to enrich file hashes (MD5, SHA-1, SHA-256) with detection verdicts, sandbox reports, related indicators, and contextual intelligence for SOC triage, incident response, and threat intelligence enrichment workflows.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing malware hash enrichment with virustotal\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Python 3.9+ with `vt-py` (official VirusTotal Python client) or `requests`\n- VirusTotal API key (free tier: 4 requests\u002Fminute, 500\u002Fday; premium for higher limits)\n- Understanding of file hash types: MD5, SHA-1, SHA-256\n- Familiarity with AV detection naming conventions\n- STIX 2.1 knowledge for IOC representation\n\n## Key Concepts\n\n### VirusTotal API v3\n\nThe API provides RESTful endpoints for file reports (`\u002Ffiles\u002F{hash}`), URL scanning, domain reports, IP address intelligence, and advanced hunting with VirusTotal Intelligence (VTI). Each file report includes detection results from 70+ AV engines, behavioral analysis from sandboxes, YARA rule matches, sigma rule matches, file metadata (PE headers, imports, sections), network indicators (contacted IPs, domains, URLs), and community votes and comments.\n\n### Hash Enrichment Workflow\n\nThe typical enrichment flow is: receive hash from alert\u002FEDR -> query VT API -> parse detection ratio -> extract behavioral indicators -> correlate with existing intelligence -> make triage decision. The API returns a `last_analysis_stats` object with `malicious`, `suspicious`, `undetected`, and `harmless` counts.\n\n### Pivoting from Hashes\n\nVirusTotal enables pivoting from a single hash to related intelligence: similar files (ITW\u002Fin-the-wild samples), contacted domains and IPs (C2 infrastructure), dropped files, embedded URLs, YARA rule matches, and threat actor attribution through crowdsourced intelligence.\n\n## Workflow\n\n### Step 1: Query VirusTotal for Hash Report\n\n```python\nimport vt\nimport json\nimport hashlib\nfrom datetime import datetime\n\nclass VTEnricher:\n    def __init__(self, api_key):\n        self.client = vt.Client(api_key)\n\n    def enrich_hash(self, file_hash):\n        \"\"\"Enrich a file hash with VirusTotal intelligence.\"\"\"\n        try:\n            file_obj = self.client.get_object(f\"\u002Ffiles\u002F{file_hash}\")\n            stats = file_obj.last_analysis_stats\n            report = {\n                \"hash\": file_hash,\n                \"sha256\": file_obj.sha256,\n                \"sha1\": file_obj.sha1,\n                \"md5\": file_obj.md5,\n                \"file_type\": getattr(file_obj, \"type_description\", \"Unknown\"),\n                \"file_size\": getattr(file_obj, \"size\", 0),\n                \"first_submission\": str(getattr(file_obj, \"first_submission_date\", \"\")),\n                \"last_analysis_date\": str(getattr(file_obj, \"last_analysis_date\", \"\")),\n                \"detection_stats\": {\n                    \"malicious\": stats.get(\"malicious\", 0),\n                    \"suspicious\": stats.get(\"suspicious\", 0),\n                    \"undetected\": stats.get(\"undetected\", 0),\n                    \"harmless\": stats.get(\"harmless\", 0),\n                },\n                \"detection_ratio\": f\"{stats.get('malicious', 0)}\u002F{sum(stats.values())}\",\n                \"popular_threat_names\": getattr(file_obj, \"popular_threat_classification\", {}),\n                \"tags\": getattr(file_obj, \"tags\", []),\n                \"names\": getattr(file_obj, \"names\", []),\n            }\n            total_engines = sum(stats.values())\n            mal_count = stats.get(\"malicious\", 0)\n            report[\"threat_level\"] = (\n                \"critical\" if mal_count > total_engines * 0.7\n                else \"high\" if mal_count > total_engines * 0.4\n                else \"medium\" if mal_count > total_engines * 0.1\n                else \"low\" if mal_count > 0\n                else \"clean\"\n            )\n            print(f\"[+] {file_hash[:16]}... -> {report['detection_ratio']} \"\n                  f\"({report['threat_level'].upper()})\")\n            return report\n        except vt.error.APIError as e:\n            print(f\"[-] VT API error for {file_hash}: {e}\")\n            return None\n\n    def get_behavior_report(self, file_hash):\n        \"\"\"Get sandbox behavioral analysis for a file.\"\"\"\n        try:\n            behaviors = self.client.get_object(f\"\u002Ffiles\u002F{file_hash}\u002Fbehaviours\")\n            behavior_data = {\n                \"processes_created\": [],\n                \"files_written\": [],\n                \"registry_keys_set\": [],\n                \"dns_lookups\": [],\n                \"http_conversations\": [],\n                \"mutexes_created\": [],\n                \"commands_executed\": [],\n            }\n            for sandbox in getattr(behaviors, \"data\", []):\n                attrs = sandbox.get(\"attributes\", {})\n                behavior_data[\"processes_created\"].extend(\n                    attrs.get(\"processes_created\", []))\n                behavior_data[\"files_written\"].extend(\n                    [f.get(\"path\", \"\") for f in attrs.get(\"files_written\", [])])\n                behavior_data[\"registry_keys_set\"].extend(\n                    [r.get(\"key\", \"\") for r in attrs.get(\"registry_keys_set\", [])])\n                behavior_data[\"dns_lookups\"].extend(\n                    [d.get(\"hostname\", \"\") for d in attrs.get(\"dns_lookups\", [])])\n                behavior_data[\"commands_executed\"].extend(\n                    attrs.get(\"command_executions\", []))\n            return behavior_data\n        except Exception as e:\n            print(f\"[-] Behavior report error: {e}\")\n            return {}\n\n    def close(self):\n        self.client.close()\n\n# Usage\nenricher = VTEnricher(\"YOUR_VT_API_KEY\")\nreport = enricher.enrich_hash(\"275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f\")\nprint(json.dumps(report, indent=2, default=str))\nenricher.close()\n```\n\n### Step 2: Batch Hash Enrichment with Rate Limiting\n\n```python\nimport time\nimport csv\n\ndef batch_enrich(api_key, hash_file, output_file, rate_limit=4):\n    \"\"\"Enrich a list of hashes from a file with rate limiting.\"\"\"\n    enricher = VTEnricher(api_key)\n    results = []\n\n    with open(hash_file, \"r\") as f:\n        hashes = [line.strip() for line in f if line.strip()]\n\n    print(f\"[*] Enriching {len(hashes)} hashes (rate: {rate_limit}\u002Fmin)\")\n    for i, file_hash in enumerate(hashes):\n        report = enricher.enrich_hash(file_hash)\n        if report:\n            results.append(report)\n        if (i + 1) % rate_limit == 0:\n            print(f\"  [{i+1}\u002F{len(hashes)}] Rate limit pause (60s)...\")\n            time.sleep(60)\n\n    # Export to CSV\n    with open(output_file, \"w\", newline=\"\") as f:\n        if results:\n            writer = csv.DictWriter(f, fieldnames=results[0].keys())\n            writer.writeheader()\n            for r in results:\n                flat = {k: str(v) for k, v in r.items()}\n                writer.writerow(flat)\n\n    print(f\"[+] Enrichment complete: {len(results)}\u002F{len(hashes)} hashes\")\n    print(f\"[+] Results saved to {output_file}\")\n    enricher.close()\n    return results\n\nbatch_enrich(\"YOUR_API_KEY\", \"hashes.txt\", \"enrichment_results.csv\")\n```\n\n### Step 3: Extract Network Indicators for Pivoting\n\n```python\ndef extract_network_iocs(api_key, file_hash):\n    \"\"\"Extract network-based IOCs from VT for C2 identification.\"\"\"\n    client = vt.Client(api_key)\n    network_iocs = {\n        \"contacted_ips\": [],\n        \"contacted_domains\": [],\n        \"contacted_urls\": [],\n        \"embedded_urls\": [],\n    }\n\n    try:\n        # Get contacted IPs\n        it = client.iterator(f\"\u002Ffiles\u002F{file_hash}\u002Fcontacted_ips\")\n        for ip_obj in it:\n            network_iocs[\"contacted_ips\"].append({\n                \"ip\": ip_obj.id,\n                \"country\": getattr(ip_obj, \"country\", \"\"),\n                \"asn\": getattr(ip_obj, \"asn\", 0),\n                \"as_owner\": getattr(ip_obj, \"as_owner\", \"\"),\n            })\n\n        # Get contacted domains\n        it = client.iterator(f\"\u002Ffiles\u002F{file_hash}\u002Fcontacted_domains\")\n        for domain_obj in it:\n            network_iocs[\"contacted_domains\"].append({\n                \"domain\": domain_obj.id,\n                \"registrar\": getattr(domain_obj, \"registrar\", \"\"),\n                \"creation_date\": str(getattr(domain_obj, \"creation_date\", \"\")),\n            })\n\n        # Get contacted URLs\n        it = client.iterator(f\"\u002Ffiles\u002F{file_hash}\u002Fcontacted_urls\")\n        for url_obj in it:\n            network_iocs[\"contacted_urls\"].append({\n                \"url\": url_obj.url,\n                \"last_http_response_code\": getattr(url_obj, \"last_http_response_content_length\", 0),\n            })\n\n    except Exception as e:\n        print(f\"[-] Error extracting network IOCs: {e}\")\n    finally:\n        client.close()\n\n    print(f\"[+] Network IOCs: {len(network_iocs['contacted_ips'])} IPs, \"\n          f\"{len(network_iocs['contacted_domains'])} domains, \"\n          f\"{len(network_iocs['contacted_urls'])} URLs\")\n    return network_iocs\n```\n\n### Step 4: YARA Rule Matching and Threat Classification\n\n```python\ndef get_yara_matches(api_key, file_hash):\n    \"\"\"Retrieve YARA rule matches for threat classification.\"\"\"\n    client = vt.Client(api_key)\n    try:\n        file_obj = client.get_object(f\"\u002Ffiles\u002F{file_hash}\")\n        crowdsourced_yara = getattr(file_obj, \"crowdsourced_yara_results\", [])\n\n        matches = []\n        for rule in crowdsourced_yara:\n            matches.append({\n                \"rule_name\": rule.get(\"rule_name\", \"\"),\n                \"ruleset_name\": rule.get(\"ruleset_name\", \"\"),\n                \"author\": rule.get(\"author\", \"\"),\n                \"description\": rule.get(\"description\", \"\"),\n                \"source\": rule.get(\"source\", \"\"),\n            })\n\n        # Classify based on YARA matches\n        classifications = set()\n        for m in matches:\n            rule_lower = m[\"rule_name\"].lower()\n            if any(k in rule_lower for k in [\"apt\", \"nation\", \"state\"]):\n                classifications.add(\"apt\")\n            if any(k in rule_lower for k in [\"ransom\", \"crypto\"]):\n                classifications.add(\"ransomware\")\n            if any(k in rule_lower for k in [\"trojan\", \"rat\", \"backdoor\"]):\n                classifications.add(\"trojan\")\n            if any(k in rule_lower for k in [\"loader\", \"dropper\"]):\n                classifications.add(\"loader\")\n\n        print(f\"[+] YARA: {len(matches)} rules matched\")\n        print(f\"[+] Classifications: {classifications or {'unclassified'}}\")\n        return {\"matches\": matches, \"classifications\": list(classifications)}\n    finally:\n        client.close()\n```\n\n### Step 5: Generate Enrichment Report\n\n```python\ndef generate_enrichment_report(hash_report, behavior, network, yara_data):\n    \"\"\"Generate comprehensive enrichment report.\"\"\"\n    report = {\n        \"metadata\": {\n            \"generated\": datetime.now().isoformat(),\n            \"hash\": hash_report.get(\"sha256\", \"\"),\n        },\n        \"verdict\": {\n            \"threat_level\": hash_report.get(\"threat_level\", \"unknown\"),\n            \"detection_ratio\": hash_report.get(\"detection_ratio\", \"0\u002F0\"),\n            \"classifications\": yara_data.get(\"classifications\", []),\n            \"threat_names\": hash_report.get(\"popular_threat_names\", {}),\n        },\n        \"behavioral_indicators\": {\n            \"processes\": behavior.get(\"processes_created\", [])[:10],\n            \"dns_queries\": behavior.get(\"dns_lookups\", [])[:10],\n            \"commands\": behavior.get(\"commands_executed\", [])[:10],\n        },\n        \"network_indicators\": {\n            \"c2_candidates\": network.get(\"contacted_ips\", [])[:10],\n            \"domains\": network.get(\"contacted_domains\", [])[:10],\n        },\n        \"yara_matches\": yara_data.get(\"matches\", [])[:10],\n        \"recommendation\": (\n            \"BLOCK and investigate\" if hash_report.get(\"threat_level\") in (\"critical\", \"high\")\n            else \"Monitor and analyze\" if hash_report.get(\"threat_level\") == \"medium\"\n            else \"Low risk - continue monitoring\"\n        ),\n    }\n\n    with open(f\"enrichment_{hash_report.get('sha256', 'unknown')[:16]}.json\", \"w\") as f:\n        json.dump(report, f, indent=2, default=str)\n    return report\n```\n\n## Validation Criteria\n\n- VT API v3 queried successfully with proper authentication\n- File hash enriched with detection stats, behavioral data, and network indicators\n- Batch enrichment handles rate limiting correctly\n- Network IOCs extracted for C2 identification\n- YARA matches retrieved and used for classification\n- Enrichment report generated with actionable verdict\n\n## References\n\n- [VirusTotal API v3 Documentation](https:\u002F\u002Fdocs.virustotal.com\u002Freference\u002Foverview)\n- [vt-py Official Python Client](https:\u002F\u002Fgithub.com\u002FVirusTotal\u002Fvt-py)\n- [VirusTotal Intelligence](https:\u002F\u002Fwww.virustotal.com\u002Fgui\u002Fintelligence-overview)\n- [Torq: VT Hash Enrichment Workflow](https:\u002F\u002Fkb.torq.io\u002Fen\u002Farticles\u002F9350251-virustotal-file-hash-enrichment-with-cache-workflow-template)\n- [Dynatrace: Enrich Observables with VT](https:\u002F\u002Fwww.dynatrace.com\u002Fnews\u002Fblog\u002Fenrich-observables-with-virustotal-threat-intelligence\u002F)\n- [Penligent: VT in Incident Response](https:\u002F\u002Fwww.penligent.ai\u002Fhackinglabs\u002Fvirustotal-in-incident-response-how-to-identify-malware-fast-and-pivot-without-leaking-data\u002F)\n","# Performing Malware Hash Enrichment with VirusTotal\n\n## Overview\n\nVirusTotal is the world's largest crowdsourced malware corpus, scanning files with 70+ antivirus engines and providing behavioral analysis, YARA rule matches, network indicators, and community intelligence. This skill covers using the VirusTotal API v3 to enrich file hashes (MD5, SHA-1, SHA-256) with detection verdicts, sandbox reports, related indicators, and contextual intelligence for SOC triage, incident response, and threat intelligence enrichment workflows.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing malware hash enrichment with virustotal\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Python 3.9+ with `vt-py` (official VirusTotal Python client) or `requests`\n- VirusTotal API key (free tier: 4 requests\u002Fminute, 500\u002Fday; premium for higher limits)\n- Understanding of file hash types: MD5, SHA-1, SHA-256\n- Familiarity with AV detection naming conventions\n- STIX 2.1 knowledge for IOC representation\n\n## Key Concepts\n\n### VirusTotal API v3\n\nThe API provides RESTful endpoints for file reports (`\u002Ffiles\u002F{hash}`), URL scanning, domain reports, IP address intelligence, and advanced hunting with VirusTotal Intelligence (VTI). Each file report includes detection results from 70+ AV engines, behavioral analysis from sandboxes, YARA rule matches, sigma rule matches, file metadata (PE headers, imports, sections), network indicators (contacted IPs, domains, URLs), and community votes and comments.\n\n### Hash Enrichment Workflow\n\nThe typical enrichment flow is: receive hash from alert\u002FEDR -> query VT API -> parse detection ratio -> extract behavioral indicators -> correlate with existing intelligence -> make triage decision. The API returns a `last_analysis_stats` object with `malicious`, `suspicious`, `undetected`, and `harmless` counts.\n\n### Pivoting from Hashes\n\nVirusTotal enables pivoting from a single hash to related intelligence: similar files (ITW\u002Fin-the-wild samples), contacted domains and IPs (C2 infrastructure), dropped files, embedded URLs, YARA rule matches, and threat actor attribution through crowdsourced intelligence.\n\n## Workflow\n\n### Step 1: Query VirusTotal for Hash Report\n\n```python\nimport vt\nimport json\nimport hashlib\nfrom datetime import datetime\n\nclass VTEnricher:\n    def __init__(self, api_key):\n        self.client = vt.Client(api_key)\n\n    def enrich_hash(self, file_hash):\n        \"\"\"Enrich a file hash with VirusTotal intelligence.\"\"\"\n        try:\n            file_obj = self.client.get_object(f\"\u002Ffiles\u002F{file_hash}\")\n            stats = file_obj.last_analysis_stats\n            report = {\n                \"hash\": file_hash,\n                \"sha256\": file_obj.sha256,\n                \"sha1\": file_obj.sha1,\n                \"md5\": file_obj.md5,\n                \"file_type\": getattr(file_obj, \"type_description\", \"Unknown\"),\n                \"file_size\": getattr(file_obj, \"size\", 0),\n                \"first_submission\": str(getattr(file_obj, \"first_submission_date\", \"\")),\n                \"last_analysis_date\": str(getattr(file_obj, \"last_analysis_date\", \"\")),\n                \"detection_stats\": {\n                    \"malicious\": stats.get(\"malicious\", 0),\n                    \"suspicious\": stats.get(\"suspicious\", 0),\n                    \"undetected\": stats.get(\"undetected\", 0),\n                    \"harmless\": stats.get(\"harmless\", 0),\n                },\n                \"detection_ratio\": f\"{stats.get('malicious', 0)}\u002F{sum(stats.values())}\",\n                \"popular_threat_names\": getattr(file_obj, \"popular_threat_classification\", {}),\n                \"tags\": getattr(file_obj, \"tags\", []),\n                \"names\": getattr(file_obj, \"names\", []),\n            }\n            total_engines = sum(stats.values())\n            mal_count = stats.get(\"malicious\", 0)\n            report[\"threat_level\"] = (\n                \"critical\" if mal_count > total_engines * 0.7\n                else \"high\" if mal_count > total_engines * 0.4\n                else \"medium\" if mal_count > total_engines * 0.1\n                else \"low\" if mal_count > 0\n                else \"clean\"\n            )\n            print(f\"[+] {file_hash[:16]}... -> {report['detection_ratio']} \"\n                  f\"({report['threat_level'].upper()})\")\n            return report\n        except vt.error.APIError as e:\n            print(f\"[-] VT API error for {file_hash}: {e}\")\n            return None\n\n    def get_behavior_report(self, file_hash):\n        \"\"\"Get sandbox behavioral analysis for a file.\"\"\"\n        try:\n            behaviors = self.client.get_object(f\"\u002Ffiles\u002F{file_hash}\u002Fbehaviours\")\n            behavior_data = {\n                \"processes_created\": [],\n                \"files_written\": [],\n                \"registry_keys_set\": [],\n                \"dns_lookups\": [],\n                \"http_conversations\": [],\n                \"mutexes_created\": [],\n                \"commands_executed\": [],\n            }\n            for sandbox in getattr(behaviors, \"data\", []):\n                attrs = sandbox.get(\"attributes\", {})\n                behavior_data[\"processes_created\"].extend(\n                    attrs.get(\"processes_created\", []))\n                behavior_data[\"files_written\"].extend(\n                    [f.get(\"path\", \"\") for f in attrs.get(\"files_written\", [])])\n                behavior_data[\"registry_keys_set\"].extend(\n                    [r.get(\"key\", \"\") for r in attrs.get(\"registry_keys_set\", [])])\n                behavior_data[\"dns_lookups\"].extend(\n                    [d.get(\"hostname\", \"\") for d in attrs.get(\"dns_lookups\", [])])\n                behavior_data[\"commands_executed\"].extend(\n                    attrs.get(\"command_executions\", []))\n            return behavior_data\n        except Exception as e:\n            print(f\"[-] Behavior report error: {e}\")\n            return {}\n\n    def close(self):\n        self.client.close()\n\n# Usage\nenricher = VTEnricher(\"YOUR_VT_API_KEY\")\nreport = enricher.enrich_hash(\"275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f\")\nprint(json.dumps(report, indent=2, default=str))\nenricher.close()\n```\n\n### Step 2: Batch Hash Enrichment with Rate Limiting\n\n```python\nimport time\nimport csv\n\ndef batch_enrich(api_key, hash_file, output_file, rate_limit=4):\n    \"\"\"Enrich a list of hashes from a file with rate limiting.\"\"\"\n    enricher = VTEnricher(api_key)\n    results = []\n\n    with open(hash_file, \"r\") as f:\n        hashes = [line.strip() for line in f if line.strip()]\n\n    print(f\"[*] Enriching {len(hashes)} hashes (rate: {rate_limit}\u002Fmin)\")\n    for i, file_hash in enumerate(hashes):\n        report = enricher.enrich_hash(file_hash)\n        if report:\n            results.append(report)\n        if (i + 1) % rate_limit == 0:\n            print(f\"  [{i+1}\u002F{len(hashes)}] Rate limit pause (60s)...\")\n            time.sleep(60)\n\n    # Export to CSV\n    with open(output_file, \"w\", newline=\"\") as f:\n        if results:\n            writer = csv.DictWriter(f, fieldnames=results[0].keys())\n            writer.writeheader()\n            for r in results:\n                flat = {k: str(v) for k, v in r.items()}\n                writer.writerow(flat)\n\n    print(f\"[+] Enrichment complete: {len(results)}\u002F{len(hashes)} hashes\")\n    print(f\"[+] Results saved to {output_file}\")\n    enricher.close()\n    return results\n\nbatch_enrich(\"YOUR_API_KEY\", \"hashes.txt\", \"enrichment_results.csv\")\n```\n\n### Step 3: Extract Network Indicators for Pivoting\n\n```python\ndef extract_network_iocs(api_key, file_hash):\n    \"\"\"Extract network-based IOCs from VT for C2 identification.\"\"\"\n    client = vt.Client(api_key)\n    network_iocs = {\n        \"contacted_ips\": [],\n        \"contacted_domains\": [],\n        \"contacted_urls\": [],\n        \"embedded_urls\": [],\n    }\n\n    try:\n        # Get contacted IPs\n        it = client.iterator(f\"\u002Ffiles\u002F{file_hash}\u002Fcontacted_ips\")\n        for ip_obj in it:\n            network_iocs[\"contacted_ips\"].append({\n                \"ip\": ip_obj.id,\n                \"country\": getattr(ip_obj, \"country\", \"\"),\n                \"asn\": getattr(ip_obj, \"asn\", 0),\n                \"as_owner\": getattr(ip_obj, \"as_owner\", \"\"),\n            })\n\n        # Get contacted domains\n        it = client.iterator(f\"\u002Ffiles\u002F{file_hash}\u002Fcontacted_domains\")\n        for domain_obj in it:\n            network_iocs[\"contacted_domains\"].append({\n                \"domain\": domain_obj.id,\n                \"registrar\": getattr(domain_obj, \"registrar\", \"\"),\n                \"creation_date\": str(getattr(domain_obj, \"creation_date\", \"\")),\n            })\n\n        # Get contacted URLs\n        it = client.iterator(f\"\u002Ffiles\u002F{file_hash}\u002Fcontacted_urls\")\n        for url_obj in it:\n            network_iocs[\"contacted_urls\"].append({\n                \"url\": url_obj.url,\n                \"last_http_response_code\": getattr(url_obj, \"last_http_response_content_length\", 0),\n            })\n\n    except Exception as e:\n        print(f\"[-] Error extracting network IOCs: {e}\")\n    finally:\n        client.close()\n\n    print(f\"[+] Network IOCs: {len(network_iocs['contacted_ips'])} IPs, \"\n          f\"{len(network_iocs['contacted_domains'])} domains, \"\n          f\"{len(network_iocs['contacted_urls'])} URLs\")\n    return network_iocs\n```\n\n### Step 4: YARA Rule Matching and Threat Classification\n\n```python\ndef get_yara_matches(api_key, file_hash):\n    \"\"\"Retrieve YARA rule matches for threat classification.\"\"\"\n    client = vt.Client(api_key)\n    try:\n        file_obj = client.get_object(f\"\u002Ffiles\u002F{file_hash}\")\n        crowdsourced_yara = getattr(file_obj, \"crowdsourced_yara_results\", [])\n\n        matches = []\n        for rule in crowdsourced_yara:\n            matches.append({\n                \"rule_name\": rule.get(\"rule_name\", \"\"),\n                \"ruleset_name\": rule.get(\"ruleset_name\", \"\"),\n                \"author\": rule.get(\"author\", \"\"),\n                \"description\": rule.get(\"description\", \"\"),\n                \"source\": rule.get(\"source\", \"\"),\n            })\n\n        # Classify based on YARA matches\n        classifications = set()\n        for m in matches:\n            rule_lower = m[\"rule_name\"].lower()\n            if any(k in rule_lower for k in [\"apt\", \"nation\", \"state\"]):\n                classifications.add(\"apt\")\n            if any(k in rule_lower for k in [\"ransom\", \"crypto\"]):\n                classifications.add(\"ransomware\")\n            if any(k in rule_lower for k in [\"trojan\", \"rat\", \"backdoor\"]):\n                classifications.add(\"trojan\")\n            if any(k in rule_lower for k in [\"loader\", \"dropper\"]):\n                classifications.add(\"loader\")\n\n        print(f\"[+] YARA: {len(matches)} rules matched\")\n        print(f\"[+] Classifications: {classifications or {'unclassified'}}\")\n        return {\"matches\": matches, \"classifications\": list(classifications)}\n    finally:\n        client.close()\n```\n\n### Step 5: Generate Enrichment Report\n\n```python\ndef generate_enrichment_report(hash_report, behavior, network, yara_data):\n    \"\"\"Generate comprehensive enrichment report.\"\"\"\n    report = {\n        \"metadata\": {\n            \"generated\": datetime.now().isoformat(),\n            \"hash\": hash_report.get(\"sha256\", \"\"),\n        },\n        \"verdict\": {\n            \"threat_level\": hash_report.get(\"threat_level\", \"unknown\"),\n            \"detection_ratio\": hash_report.get(\"detection_ratio\", \"0\u002F0\"),\n            \"classifications\": yara_data.get(\"classifications\", []),\n            \"threat_names\": hash_report.get(\"popular_threat_names\", {}),\n        },\n        \"behavioral_indicators\": {\n            \"processes\": behavior.get(\"processes_created\", [])[:10],\n            \"dns_queries\": behavior.get(\"dns_lookups\", [])[:10],\n            \"commands\": behavior.get(\"commands_executed\", [])[:10],\n        },\n        \"network_indicators\": {\n            \"c2_candidates\": network.get(\"contacted_ips\", [])[:10],\n            \"domains\": network.get(\"contacted_domains\", [])[:10],\n        },\n        \"yara_matches\": yara_data.get(\"matches\", [])[:10],\n        \"recommendation\": (\n            \"BLOCK and investigate\" if hash_report.get(\"threat_level\") in (\"critical\", \"high\")\n            else \"Monitor and analyze\" if hash_report.get(\"threat_level\") == \"medium\"\n            else \"Low risk - continue monitoring\"\n        ),\n    }\n\n    with open(f\"enrichment_{hash_report.get('sha256', 'unknown')[:16]}.json\", \"w\") as f:\n        json.dump(report, f, indent=2, default=str)\n    return report\n```\n\n## Validation Criteria\n\n- VT API v3 queried successfully with proper authentication\n- File hash enriched with detection stats, behavioral data, and network indicators\n- Batch enrichment handles rate limiting correctly\n- Network IOCs extracted for C2 identification\n- YARA matches retrieved and used for classification\n- Enrichment report generated with actionable verdict\n\n## References\n\n- [VirusTotal API v3 Documentation](https:\u002F\u002Fdocs.virustotal.com\u002Freference\u002Foverview)\n- [vt-py Official Python Client](https:\u002F\u002Fgithub.com\u002FVirusTotal\u002Fvt-py)\n- [VirusTotal Intelligence](https:\u002F\u002Fwww.virustotal.com\u002Fgui\u002Fintelligence-overview)\n- [Torq: VT Hash Enrichment Workflow](https:\u002F\u002Fkb.torq.io\u002Fen\u002Farticles\u002F9350251-virustotal-file-hash-enrichment-with-cache-workflow-template)\n- [Dynatrace: Enrich Observables with VT](https:\u002F\u002Fwww.dynatrace.com\u002Fnews\u002Fblog\u002Fenrich-observables-with-virustotal-threat-intelligence\u002F)\n- [Penligent: VT in Incident Response](https:\u002F\u002Fwww.penligent.ai\u002Fhackinglabs\u002Fvirustotal-in-incident-response-how-to-identify-malware-fast-and-pivot-without-leaking-data\u002F)\n",{"name":5,"note":25,"tags":26,"author":35,"domain":36,"source":37,"license":15,"version":38,"nist_csf":39,"subdomain":31,"description":7,"mitre_attack":44,"source_commit":50},"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.",[27,28,29,30,31,32,33,34],"virustotal","malware-analysis","hash-enrichment","ioc","threat-intelligence","triage","api","detection","mahipal","cybersecurity","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","1.0",[40,41,42,43],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[45,46,47,48,49],"T1591","T1592","T1593","T1589","T1027","04450304b12645cb2b974ab96d28c0664758a88d","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa",".claude\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill performing-malware-hash-enrichment-with-virustotal",{"tool":67,"command":68},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill performing-malware-hash-enrichment-with-virustotal",{"tool":70,"command":71},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill performing-malware-hash-enrichment-with-virustotal","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002FSKILL.md",true,[75,79,85],{"path":76,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fapi-reference.md","REFERENCE","参考文档",916,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002Freferences\u002Fapi-reference.md",{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"scripts\u002Fagent.py","SCRIPT","脚本",5455,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002Fscripts\u002Fagent.py",[92,100,107,115,123,131],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":20},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":111,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":20},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":119,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":20},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":127,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":20},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":132,"name":133,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":20},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]