[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AA2W685T2CCQENBS9Z3RDA":3,"skill-same:01M7AA2W685T2CCQENBS9Z3RDA":85},{"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":48,"commitSha":49,"skillDirectory":50,"forksCount":14,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M7AA2W685T2CCQENBS9Z3RDA","performing-malware-hash-enrichment-with-virustotal",null,"Enrich malware file hashes (MD5, SHA-1, SHA-256) using the VirusTotal API v3 to retrieve multi-engine detection rates, sandbox behavioral analysis, YARA rule matches, related indicators, and community threat intelligence. Use during SOC triage, incident response, or threat intelligence workflows to validate whether a file hash is malicious and gather context for IOC enrichment.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-malware-hash-enrichment-with-virustotal\ndescription: Enrich malware file hashes (MD5, SHA-1, SHA-256) using the VirusTotal\n  API v3 to retrieve multi-engine detection rates, sandbox behavioral analysis, YARA\n  rule matches, related indicators, and community threat intelligence. Use during\n  SOC triage, incident response, or threat intelligence workflows to validate whether\n  a file hash is malicious and gather context for IOC enrichment.\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\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,"tags":25,"author":34,"domain":35,"license":15,"version":36,"nist_csf":37,"subdomain":30,"description":7,"mitre_attack":42},[26,27,28,29,30,31,32,33],"virustotal","malware-analysis","hash-enrichment","ioc","threat-intelligence","triage","api","detection","mahipal","cybersecurity","1.0",[38,39,40,41],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[43,44,45,46,47],"T1591","T1592","T1593","T1589","T1027","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add NeelakshSaxena\u002FVayu --skill performing-malware-hash-enrichment-with-virustotal",{"tool":61,"command":62},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill performing-malware-hash-enrichment-with-virustotal",{"tool":64,"command":65},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill performing-malware-hash-enrichment-with-virustotal","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002FSKILL.md",true,[69,73,79],{"path":70,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fapi-reference.md","REFERENCE","参考文档",916,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002Freferences\u002Fapi-reference.md",{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"scripts\u002Fagent.py","SCRIPT","脚本",5455,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002Fscripts\u002Fagent.py",[86,93,100,107,114,121],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":20},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\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},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\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":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":20},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":20},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":20},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]