[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AFWYBV4S3X78B4R2QHVT0G":3,"skill-same:01M6AFWYBV4S3X78B4R2QHVT0G":116},{"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":6,"sourceHtmlUrl":16,"categories":17,"keywords":31,"publishedAt":52,"linkOnly":53,"markdownContent":54,"markdownBody":55,"frontMatter":56,"refName":75,"commitSha":76,"skillDirectory":77,"forksCount":78,"repositoryHtmlUrl":79,"repositoryHomepageUrl":80,"ownerHtmlUrl":81,"ownerBlogUrl":82,"ownerDescription":83,"updatedAt":84,"install":85,"resources":98},"01M6AFWYBV4S3X78B4R2QHVT0G","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.","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",35990,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002FSKILL.md",[18,23,26],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":27,"categoryName":28,"taxonomyType":29,"taxonomyTypeDesc":30},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],"performing malware hash enrichment with virustotal","enrichment","malware","VirusTotal","soc","hash-enrichment","api","analysis","sha-256","indicators","yara","malicious","ioc","threat-intelligence","file","workflows","threat intelligence","incident response","cybersecurity","sandbox","2026-11-10 10:12:30",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":57,"author":62,"domain":50,"license":15,"version":63,"nist_csf":64,"subdomain":45,"description":7,"mitre_attack":69},[58,59,37,44,45,60,38,61],"virustotal","malware-analysis","triage","detection","mahipal","1.0",[65,66,67,68],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[70,71,72,73,74],"T1591","T1592","T1593","T1589","T1027","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fperforming-malware-hash-enrichment-with-virustotal",4395,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":8,"skillName":5,"commands":86,"prompt":96,"zipAvailable":97},[87,90,93],{"tool":88,"command":89},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill performing-malware-hash-enrichment-with-virustotal",{"tool":91,"command":92},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill performing-malware-hash-enrichment-with-virustotal",{"tool":94,"command":95},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill performing-malware-hash-enrichment-with-virustotal","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002FSKILL.md",true,[99,104,110],{"path":100,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002FLICENSE",{"path":105,"resourceType":106,"resourceTypeDesc":107,"sizeBytes":108,"sourceHtmlUrl":109},"references\u002Fapi-reference.md","REFERENCE","参考文档",916,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002Freferences\u002Fapi-reference.md",{"path":111,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":114,"sourceHtmlUrl":115},"scripts\u002Fagent.py","SCRIPT","脚本",5455,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-malware-hash-enrichment-with-virustotal\u002Fscripts\u002Fagent.py",[117,143,167,194,220,246],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":124,"publishedAt":52},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[123],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[125,126,127,128,129,50,49,130,131,132,133,134,135,136,137,138,139,140,141,142],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","security","identity","pr","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":150,"publishedAt":52},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[149],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[151,139,152,153,129,154,50,131,155,156,157,158,159,160,161,162,163,164,165,166],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":177,"publishedAt":52},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[173,176],{"categoryNo":174,"categoryName":175,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[161,178,179,180,181,50,182,183,155,184,185,186,187,188,61,189,190,191,192,193],"backup","recovery","validating backup integrity for recovery","testing","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":201,"publishedAt":52},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[200],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[202,203,204,50,205,206,207,208,209,210,211,212,213,214,215,216,158,217,218,219],"windows","kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":221,"name":222,"nameZh":6,"description":223,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":224,"categories":225,"keywords":227,"publishedAt":52},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[226],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[228,229,230,50,231,232,233,234,235,236,237,238,239,240,241,242,38,243,244,245],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","prioritization","ssvc","decision-tree",{"skillNo":247,"name":248,"nameZh":6,"description":249,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":250,"categories":251,"keywords":253,"publishedAt":52},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[252],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[129,254,50,255,46,44,36,256,257,258,259,189,260,190,39,261,262,263,264,265],"triaging security incident","siem","NIST-800-61","NIST","severity","edr","execution","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]