[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73EP8P9RS8DQJWKW68WNBZ4":3,"skill-same:01M73EP8P9RS8DQJWKW68WNBZ4":109},{"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},"01M73EP8P9RS8DQJWKW68WNBZ4","performing-malware-ioc-extraction",null,"Malware IOC extraction is the process of analyzing malicious software to identify actionable indicators of compromise including file hashes, network indicators (C2 domains, IP addresses, URLs), regist","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\u002Fcore\u002Fskills\u002Fperforming-malware-ioc-extraction\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fperforming-malware-ioc-extraction\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: performing-malware-ioc-extraction\ndescription: Malware IOC extraction is the process of analyzing malicious software\n  to identify actionable indicators of compromise including file hashes, network indicators\n  (C2 domains, IP addresses, URLs), regist\ndomain: cybersecurity\nsubdomain: threat-intelligence\ntags:\n- threat-intelligence\n- cti\n- ioc\n- mitre-attack\n- stix\n- malware-analysis\n- yara\n- reverse-engineering\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- T1071\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 IOC Extraction\n\n## Overview\n\nMalware IOC extraction is the process of analyzing malicious software to identify actionable indicators of compromise including file hashes, network indicators (C2 domains, IP addresses, URLs), registry modifications, mutex names, embedded strings, and behavioral artifacts. This skill covers static analysis with PE parsing and string extraction, dynamic analysis with sandbox detonation, automated IOC extraction using tools like YARA, and formatting results as STIX 2.1 indicators for sharing.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing malware ioc extraction\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 `pefile`, `yara-python`, `oletools`, `stix2` libraries\n- Access to malware analysis sandbox (Cuckoo, CAPE, Any.Run, Joe Sandbox)\n- VirusTotal API key for enrichment\n- Isolated analysis environment (VM or container)\n- Understanding of PE file format, common packing techniques\n- Familiarity with YARA rule syntax\n\n## Key Concepts\n\n### Static Analysis IOCs\n- **File Hashes**: MD5, SHA-1, SHA-256 of the sample and any dropped files\n- **Import Hash (imphash)**: Hash of imported function table, groups malware families\n- **Rich Header Hash**: PE rich header hash for compiler fingerprinting\n- **Strings**: Embedded URLs, IP addresses, domain names, registry paths, mutex names\n- **PE Metadata**: Compilation timestamp, section names, resources, digital signatures\n- **Embedded Artifacts**: PDB paths, version info, certificate details\n\n### Dynamic Analysis IOCs\n- **Network Activity**: DNS queries, HTTP requests, TCP\u002FUDP connections, SSL certificates\n- **File System**: Created\u002Fmodified\u002Fdeleted files and directories\n- **Registry**: Created\u002Fmodified registry keys and values\n- **Process**: Spawned processes, injected processes, service creation\n- **Behavioral**: API calls, mutex creation, scheduled tasks, persistence mechanisms\n\n### YARA Rules\nYARA is a pattern-matching tool for identifying and classifying malware. Rules consist of strings (text, hex, regex) and conditions that define matching logic. Rules can detect malware families, packers, exploit kits, and specific campaign tools.\n\n## Workflow\n\n### Step 1: Static Analysis - PE Parsing and Hash Generation\n\n```python\nimport pefile\nimport hashlib\nimport os\n\ndef analyze_pe(filepath):\n    \"\"\"Extract IOCs from a PE file through static analysis.\"\"\"\n    iocs = {\"hashes\": {}, \"pe_info\": {}, \"strings\": [], \"imports\": []}\n\n    # Calculate file hashes\n    with open(filepath, \"rb\") as f:\n        data = f.read()\n    iocs[\"hashes\"][\"md5\"] = hashlib.md5(data).hexdigest()\n    iocs[\"hashes\"][\"sha1\"] = hashlib.sha1(data).hexdigest()\n    iocs[\"hashes\"][\"sha256\"] = hashlib.sha256(data).hexdigest()\n    iocs[\"hashes\"][\"file_size\"] = len(data)\n\n    # Parse PE headers\n    try:\n        pe = pefile.PE(filepath)\n        iocs[\"hashes\"][\"imphash\"] = pe.get_imphash()\n        iocs[\"pe_info\"][\"compilation_time\"] = str(pe.FILE_HEADER.TimeDateStamp)\n        iocs[\"pe_info\"][\"machine_type\"] = hex(pe.FILE_HEADER.Machine)\n        iocs[\"pe_info\"][\"subsystem\"] = pe.OPTIONAL_HEADER.Subsystem\n\n        # Extract sections\n        iocs[\"pe_info\"][\"sections\"] = []\n        for section in pe.sections:\n            iocs[\"pe_info\"][\"sections\"].append({\n                \"name\": section.Name.decode(\"utf-8\", errors=\"ignore\").strip(\"\\x00\"),\n                \"virtual_size\": section.Misc_VirtualSize,\n                \"raw_size\": section.SizeOfRawData,\n                \"entropy\": section.get_entropy(),\n                \"md5\": section.get_hash_md5(),\n            })\n\n        # Extract imports\n        if hasattr(pe, \"DIRECTORY_ENTRY_IMPORT\"):\n            for entry in pe.DIRECTORY_ENTRY_IMPORT:\n                dll_name = entry.dll.decode(\"utf-8\", errors=\"ignore\")\n                functions = [\n                    imp.name.decode(\"utf-8\", errors=\"ignore\")\n                    for imp in entry.imports\n                    if imp.name\n                ]\n                iocs[\"imports\"].append({\"dll\": dll_name, \"functions\": functions})\n\n        # Check for suspicious characteristics\n        iocs[\"pe_info\"][\"is_dll\"] = pe.is_dll()\n        iocs[\"pe_info\"][\"is_driver\"] = pe.is_driver()\n        iocs[\"pe_info\"][\"is_exe\"] = pe.is_exe()\n\n        # Version info\n        if hasattr(pe, \"VS_VERSIONINFO\"):\n            for entry in pe.FileInfo:\n                for st in entry:\n                    for item in st.entries.items():\n                        key = item[0].decode(\"utf-8\", errors=\"ignore\")\n                        val = item[1].decode(\"utf-8\", errors=\"ignore\")\n                        iocs[\"pe_info\"][f\"version_{key}\"] = val\n\n        pe.close()\n\n    except pefile.PEFormatError as e:\n        iocs[\"pe_info\"][\"error\"] = str(e)\n\n    return iocs\n```\n\n### Step 2: String Extraction and IOC Pattern Matching\n\n```python\nimport re\n\ndef extract_ioc_strings(filepath):\n    \"\"\"Extract IOC-relevant strings from binary file.\"\"\"\n    patterns = {\n        \"ipv4\": re.compile(\n            r\"\\b(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}\"\n            r\"(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\b\"\n        ),\n        \"domain\": re.compile(\n            r\"\\b(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+\"\n            r\"(?:com|net|org|io|ru|cn|tk|xyz|top|info|biz|cc|ws|pw)\\b\"\n        ),\n        \"url\": re.compile(\n            r\"https?:\u002F\u002F[^\\s\\\"'\u003C>]{5,200}\"\n        ),\n        \"email\": re.compile(\n            r\"\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\b\"\n        ),\n        \"registry\": re.compile(\n            r\"(?:HKEY_[A-Z_]+|HKLM|HKCU|HKU|HKCR|HKCC)\"\n            r\"\\\\[\\\\a-zA-Z0-9_ .{}-]+\"\n        ),\n        \"filepath_windows\": re.compile(\n            r\"[A-Z]:\\\\(?:[^\\\\\u002F:*?\\\"\u003C>|\\r\\n]+\\\\)*[^\\\\\u002F:*?\\\"\u003C>|\\r\\n]+\"\n        ),\n        \"mutex\": re.compile(\n            r\"(?:Global\\\\|Local\\\\)[a-zA-Z0-9_\\-{}.]{4,}\"\n        ),\n        \"useragent\": re.compile(\n            r\"Mozilla\u002F[45]\\.0[^\\\"']{10,200}\"\n        ),\n        \"bitcoin\": re.compile(\n            r\"\\b[13][a-km-zA-HJ-NP-Z1-9]{25,34}\\b\"\n        ),\n        \"pdb_path\": re.compile(\n            r\"[A-Z]:\\\\[^\\\"]{5,200}\\.pdb\"\n        ),\n    }\n\n    with open(filepath, \"rb\") as f:\n        data = f.read()\n\n    # Extract ASCII strings (min length 4)\n    ascii_strings = re.findall(rb\"[\\x20-\\x7e]{4,}\", data)\n    # Extract Unicode strings\n    unicode_strings = re.findall(\n        rb\"(?:[\\x20-\\x7e]\\x00){4,}\", data\n    )\n\n    all_strings = [s.decode(\"ascii\", errors=\"ignore\") for s in ascii_strings]\n    all_strings += [\n        s.decode(\"utf-16-le\", errors=\"ignore\") for s in unicode_strings\n    ]\n\n    extracted = {category: set() for category in patterns}\n\n    for string in all_strings:\n        for category, pattern in patterns.items():\n            matches = pattern.findall(string)\n            for match in matches:\n                extracted[category].add(match)\n\n    # Convert sets to sorted lists\n    return {k: sorted(v) for k, v in extracted.items() if v}\n```\n\n### Step 3: YARA Rule Scanning\n\n```python\nimport yara\n\ndef scan_with_yara(filepath, rules_path):\n    \"\"\"Scan file with YARA rules for malware classification.\"\"\"\n    rules = yara.compile(filepath=rules_path)\n    matches = rules.match(filepath)\n\n    results = []\n    for match in matches:\n        result = {\n            \"rule\": match.rule,\n            \"namespace\": match.namespace,\n            \"tags\": match.tags,\n            \"meta\": match.meta,\n            \"strings\": [],\n        }\n        for offset, identifier, data in match.strings:\n            result[\"strings\"].append({\n                \"offset\": hex(offset),\n                \"identifier\": identifier,\n                \"data\": data.hex() if len(data) \u003C 100 else data[:100].hex() + \"...\",\n            })\n        results.append(result)\n\n    return results\n\n\n# Example YARA rule for common malware indicators\nSAMPLE_YARA_RULE = \"\"\"\nrule Suspicious_Network_Indicators {\n    meta:\n        description = \"Detects suspicious network-related strings\"\n        author = \"CTI Analyst\"\n        severity = \"medium\"\n    strings:\n        $ua1 = \"Mozilla\u002F5.0\" ascii\n        $cmd1 = \"cmd.exe \u002Fc\" ascii nocase\n        $ps1 = \"powershell\" ascii nocase\n        $wget = \"wget\" ascii nocase\n        $curl = \"curl\" ascii nocase\n        $b64 = \"base64\" ascii nocase\n        $reg1 = \"HKLM\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run\" ascii nocase\n    condition:\n        uint16(0) == 0x5A4D and\n        (2 of ($ua1, $cmd1, $ps1, $wget, $curl, $b64)) or $reg1\n}\n\nrule Packed_Binary {\n    meta:\n        description = \"Detects potentially packed binary\"\n        author = \"CTI Analyst\"\n    condition:\n        uint16(0) == 0x5A4D and\n        for any section in pe.sections : (\n            section.entropy >= 7.0\n        )\n}\n\"\"\"\n```\n\n### Step 4: Generate STIX 2.1 Indicators\n\n```python\nfrom stix2 import (\n    Bundle, Indicator, Malware, Relationship,\n    File as STIXFile, DomainName, IPv4Address,\n    ObservedData,\n)\nfrom datetime import datetime\n\ndef create_stix_bundle(pe_iocs, string_iocs, yara_results, sample_name):\n    \"\"\"Create STIX 2.1 bundle from extracted IOCs.\"\"\"\n    objects = []\n\n    # Create Malware SDO\n    malware = Malware(\n        name=sample_name,\n        is_family=False,\n        malware_types=[\"unknown\"],\n        description=f\"Malware sample analyzed: {pe_iocs['hashes']['sha256']}\",\n        allow_custom=True,\n    )\n    objects.append(malware)\n\n    # File hash indicator\n    sha256 = pe_iocs[\"hashes\"][\"sha256\"]\n    hash_indicator = Indicator(\n        name=f\"Malware hash: {sha256[:16]}...\",\n        pattern=f\"[file:hashes.'SHA-256' = '{sha256}']\",\n        pattern_type=\"stix\",\n        valid_from=datetime.now().strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n        indicator_types=[\"malicious-activity\"],\n        allow_custom=True,\n    )\n    objects.append(hash_indicator)\n    objects.append(Relationship(\n        relationship_type=\"indicates\",\n        source_ref=hash_indicator.id,\n        target_ref=malware.id,\n    ))\n\n    # Network indicators from strings\n    for ip in string_iocs.get(\"ipv4\", []):\n        if not ip.startswith((\"10.\", \"172.\", \"192.168.\", \"127.\")):\n            ip_indicator = Indicator(\n                name=f\"C2 IP: {ip}\",\n                pattern=f\"[ipv4-addr:value = '{ip}']\",\n                pattern_type=\"stix\",\n                valid_from=datetime.now().strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n                indicator_types=[\"malicious-activity\"],\n                allow_custom=True,\n            )\n            objects.append(ip_indicator)\n            objects.append(Relationship(\n                relationship_type=\"indicates\",\n                source_ref=ip_indicator.id,\n                target_ref=malware.id,\n            ))\n\n    for domain in string_iocs.get(\"domain\", []):\n        domain_indicator = Indicator(\n            name=f\"C2 Domain: {domain}\",\n            pattern=f\"[domain-name:value = '{domain}']\",\n            pattern_type=\"stix\",\n            valid_from=datetime.now().strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n            indicator_types=[\"malicious-activity\"],\n            allow_custom=True,\n        )\n        objects.append(domain_indicator)\n        objects.append(Relationship(\n            relationship_type=\"indicates\",\n            source_ref=domain_indicator.id,\n            target_ref=malware.id,\n        ))\n\n    bundle = Bundle(objects=objects, allow_custom=True)\n    return bundle\n```\n\n## Validation Criteria\n\n- PE file parsed successfully with hashes, imports, and section analysis\n- String extraction identifies network IOCs (IPs, domains, URLs)\n- YARA rules match against known malware characteristics\n- STIX 2.1 bundle contains valid Indicator and Malware objects\n- Private IP ranges and benign strings filtered from IOC output\n- IOCs are actionable for blocking and detection rule creation\n\n## References\n\n- [pefile Documentation](https:\u002F\u002Fgithub.com\u002Ferocarrera\u002Fpefile)\n- [YARA Documentation](https:\u002F\u002Fyara.readthedocs.io\u002F)\n- [MITRE ATT&CK Software](https:\u002F\u002Fattack.mitre.org\u002Fsoftware\u002F)\n- [VirusTotal API](https:\u002F\u002Fdocs.virustotal.com\u002F)\n- [CAPE Sandbox](https:\u002F\u002Fgithub.com\u002Fkevoreilly\u002FCAPEv2)\n- [MalwareBazaar](https:\u002F\u002Fbazaar.abuse.ch\u002F)\n","# Performing Malware IOC Extraction\n\n## Overview\n\nMalware IOC extraction is the process of analyzing malicious software to identify actionable indicators of compromise including file hashes, network indicators (C2 domains, IP addresses, URLs), registry modifications, mutex names, embedded strings, and behavioral artifacts. This skill covers static analysis with PE parsing and string extraction, dynamic analysis with sandbox detonation, automated IOC extraction using tools like YARA, and formatting results as STIX 2.1 indicators for sharing.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing malware ioc extraction\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 `pefile`, `yara-python`, `oletools`, `stix2` libraries\n- Access to malware analysis sandbox (Cuckoo, CAPE, Any.Run, Joe Sandbox)\n- VirusTotal API key for enrichment\n- Isolated analysis environment (VM or container)\n- Understanding of PE file format, common packing techniques\n- Familiarity with YARA rule syntax\n\n## Key Concepts\n\n### Static Analysis IOCs\n- **File Hashes**: MD5, SHA-1, SHA-256 of the sample and any dropped files\n- **Import Hash (imphash)**: Hash of imported function table, groups malware families\n- **Rich Header Hash**: PE rich header hash for compiler fingerprinting\n- **Strings**: Embedded URLs, IP addresses, domain names, registry paths, mutex names\n- **PE Metadata**: Compilation timestamp, section names, resources, digital signatures\n- **Embedded Artifacts**: PDB paths, version info, certificate details\n\n### Dynamic Analysis IOCs\n- **Network Activity**: DNS queries, HTTP requests, TCP\u002FUDP connections, SSL certificates\n- **File System**: Created\u002Fmodified\u002Fdeleted files and directories\n- **Registry**: Created\u002Fmodified registry keys and values\n- **Process**: Spawned processes, injected processes, service creation\n- **Behavioral**: API calls, mutex creation, scheduled tasks, persistence mechanisms\n\n### YARA Rules\nYARA is a pattern-matching tool for identifying and classifying malware. Rules consist of strings (text, hex, regex) and conditions that define matching logic. Rules can detect malware families, packers, exploit kits, and specific campaign tools.\n\n## Workflow\n\n### Step 1: Static Analysis - PE Parsing and Hash Generation\n\n```python\nimport pefile\nimport hashlib\nimport os\n\ndef analyze_pe(filepath):\n    \"\"\"Extract IOCs from a PE file through static analysis.\"\"\"\n    iocs = {\"hashes\": {}, \"pe_info\": {}, \"strings\": [], \"imports\": []}\n\n    # Calculate file hashes\n    with open(filepath, \"rb\") as f:\n        data = f.read()\n    iocs[\"hashes\"][\"md5\"] = hashlib.md5(data).hexdigest()\n    iocs[\"hashes\"][\"sha1\"] = hashlib.sha1(data).hexdigest()\n    iocs[\"hashes\"][\"sha256\"] = hashlib.sha256(data).hexdigest()\n    iocs[\"hashes\"][\"file_size\"] = len(data)\n\n    # Parse PE headers\n    try:\n        pe = pefile.PE(filepath)\n        iocs[\"hashes\"][\"imphash\"] = pe.get_imphash()\n        iocs[\"pe_info\"][\"compilation_time\"] = str(pe.FILE_HEADER.TimeDateStamp)\n        iocs[\"pe_info\"][\"machine_type\"] = hex(pe.FILE_HEADER.Machine)\n        iocs[\"pe_info\"][\"subsystem\"] = pe.OPTIONAL_HEADER.Subsystem\n\n        # Extract sections\n        iocs[\"pe_info\"][\"sections\"] = []\n        for section in pe.sections:\n            iocs[\"pe_info\"][\"sections\"].append({\n                \"name\": section.Name.decode(\"utf-8\", errors=\"ignore\").strip(\"\\x00\"),\n                \"virtual_size\": section.Misc_VirtualSize,\n                \"raw_size\": section.SizeOfRawData,\n                \"entropy\": section.get_entropy(),\n                \"md5\": section.get_hash_md5(),\n            })\n\n        # Extract imports\n        if hasattr(pe, \"DIRECTORY_ENTRY_IMPORT\"):\n            for entry in pe.DIRECTORY_ENTRY_IMPORT:\n                dll_name = entry.dll.decode(\"utf-8\", errors=\"ignore\")\n                functions = [\n                    imp.name.decode(\"utf-8\", errors=\"ignore\")\n                    for imp in entry.imports\n                    if imp.name\n                ]\n                iocs[\"imports\"].append({\"dll\": dll_name, \"functions\": functions})\n\n        # Check for suspicious characteristics\n        iocs[\"pe_info\"][\"is_dll\"] = pe.is_dll()\n        iocs[\"pe_info\"][\"is_driver\"] = pe.is_driver()\n        iocs[\"pe_info\"][\"is_exe\"] = pe.is_exe()\n\n        # Version info\n        if hasattr(pe, \"VS_VERSIONINFO\"):\n            for entry in pe.FileInfo:\n                for st in entry:\n                    for item in st.entries.items():\n                        key = item[0].decode(\"utf-8\", errors=\"ignore\")\n                        val = item[1].decode(\"utf-8\", errors=\"ignore\")\n                        iocs[\"pe_info\"][f\"version_{key}\"] = val\n\n        pe.close()\n\n    except pefile.PEFormatError as e:\n        iocs[\"pe_info\"][\"error\"] = str(e)\n\n    return iocs\n```\n\n### Step 2: String Extraction and IOC Pattern Matching\n\n```python\nimport re\n\ndef extract_ioc_strings(filepath):\n    \"\"\"Extract IOC-relevant strings from binary file.\"\"\"\n    patterns = {\n        \"ipv4\": re.compile(\n            r\"\\b(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}\"\n            r\"(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\b\"\n        ),\n        \"domain\": re.compile(\n            r\"\\b(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+\"\n            r\"(?:com|net|org|io|ru|cn|tk|xyz|top|info|biz|cc|ws|pw)\\b\"\n        ),\n        \"url\": re.compile(\n            r\"https?:\u002F\u002F[^\\s\\\"'\u003C>]{5,200}\"\n        ),\n        \"email\": re.compile(\n            r\"\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\b\"\n        ),\n        \"registry\": re.compile(\n            r\"(?:HKEY_[A-Z_]+|HKLM|HKCU|HKU|HKCR|HKCC)\"\n            r\"\\\\[\\\\a-zA-Z0-9_ .{}-]+\"\n        ),\n        \"filepath_windows\": re.compile(\n            r\"[A-Z]:\\\\(?:[^\\\\\u002F:*?\\\"\u003C>|\\r\\n]+\\\\)*[^\\\\\u002F:*?\\\"\u003C>|\\r\\n]+\"\n        ),\n        \"mutex\": re.compile(\n            r\"(?:Global\\\\|Local\\\\)[a-zA-Z0-9_\\-{}.]{4,}\"\n        ),\n        \"useragent\": re.compile(\n            r\"Mozilla\u002F[45]\\.0[^\\\"']{10,200}\"\n        ),\n        \"bitcoin\": re.compile(\n            r\"\\b[13][a-km-zA-HJ-NP-Z1-9]{25,34}\\b\"\n        ),\n        \"pdb_path\": re.compile(\n            r\"[A-Z]:\\\\[^\\\"]{5,200}\\.pdb\"\n        ),\n    }\n\n    with open(filepath, \"rb\") as f:\n        data = f.read()\n\n    # Extract ASCII strings (min length 4)\n    ascii_strings = re.findall(rb\"[\\x20-\\x7e]{4,}\", data)\n    # Extract Unicode strings\n    unicode_strings = re.findall(\n        rb\"(?:[\\x20-\\x7e]\\x00){4,}\", data\n    )\n\n    all_strings = [s.decode(\"ascii\", errors=\"ignore\") for s in ascii_strings]\n    all_strings += [\n        s.decode(\"utf-16-le\", errors=\"ignore\") for s in unicode_strings\n    ]\n\n    extracted = {category: set() for category in patterns}\n\n    for string in all_strings:\n        for category, pattern in patterns.items():\n            matches = pattern.findall(string)\n            for match in matches:\n                extracted[category].add(match)\n\n    # Convert sets to sorted lists\n    return {k: sorted(v) for k, v in extracted.items() if v}\n```\n\n### Step 3: YARA Rule Scanning\n\n```python\nimport yara\n\ndef scan_with_yara(filepath, rules_path):\n    \"\"\"Scan file with YARA rules for malware classification.\"\"\"\n    rules = yara.compile(filepath=rules_path)\n    matches = rules.match(filepath)\n\n    results = []\n    for match in matches:\n        result = {\n            \"rule\": match.rule,\n            \"namespace\": match.namespace,\n            \"tags\": match.tags,\n            \"meta\": match.meta,\n            \"strings\": [],\n        }\n        for offset, identifier, data in match.strings:\n            result[\"strings\"].append({\n                \"offset\": hex(offset),\n                \"identifier\": identifier,\n                \"data\": data.hex() if len(data) \u003C 100 else data[:100].hex() + \"...\",\n            })\n        results.append(result)\n\n    return results\n\n\n# Example YARA rule for common malware indicators\nSAMPLE_YARA_RULE = \"\"\"\nrule Suspicious_Network_Indicators {\n    meta:\n        description = \"Detects suspicious network-related strings\"\n        author = \"CTI Analyst\"\n        severity = \"medium\"\n    strings:\n        $ua1 = \"Mozilla\u002F5.0\" ascii\n        $cmd1 = \"cmd.exe \u002Fc\" ascii nocase\n        $ps1 = \"powershell\" ascii nocase\n        $wget = \"wget\" ascii nocase\n        $curl = \"curl\" ascii nocase\n        $b64 = \"base64\" ascii nocase\n        $reg1 = \"HKLM\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run\" ascii nocase\n    condition:\n        uint16(0) == 0x5A4D and\n        (2 of ($ua1, $cmd1, $ps1, $wget, $curl, $b64)) or $reg1\n}\n\nrule Packed_Binary {\n    meta:\n        description = \"Detects potentially packed binary\"\n        author = \"CTI Analyst\"\n    condition:\n        uint16(0) == 0x5A4D and\n        for any section in pe.sections : (\n            section.entropy >= 7.0\n        )\n}\n\"\"\"\n```\n\n### Step 4: Generate STIX 2.1 Indicators\n\n```python\nfrom stix2 import (\n    Bundle, Indicator, Malware, Relationship,\n    File as STIXFile, DomainName, IPv4Address,\n    ObservedData,\n)\nfrom datetime import datetime\n\ndef create_stix_bundle(pe_iocs, string_iocs, yara_results, sample_name):\n    \"\"\"Create STIX 2.1 bundle from extracted IOCs.\"\"\"\n    objects = []\n\n    # Create Malware SDO\n    malware = Malware(\n        name=sample_name,\n        is_family=False,\n        malware_types=[\"unknown\"],\n        description=f\"Malware sample analyzed: {pe_iocs['hashes']['sha256']}\",\n        allow_custom=True,\n    )\n    objects.append(malware)\n\n    # File hash indicator\n    sha256 = pe_iocs[\"hashes\"][\"sha256\"]\n    hash_indicator = Indicator(\n        name=f\"Malware hash: {sha256[:16]}...\",\n        pattern=f\"[file:hashes.'SHA-256' = '{sha256}']\",\n        pattern_type=\"stix\",\n        valid_from=datetime.now().strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n        indicator_types=[\"malicious-activity\"],\n        allow_custom=True,\n    )\n    objects.append(hash_indicator)\n    objects.append(Relationship(\n        relationship_type=\"indicates\",\n        source_ref=hash_indicator.id,\n        target_ref=malware.id,\n    ))\n\n    # Network indicators from strings\n    for ip in string_iocs.get(\"ipv4\", []):\n        if not ip.startswith((\"10.\", \"172.\", \"192.168.\", \"127.\")):\n            ip_indicator = Indicator(\n                name=f\"C2 IP: {ip}\",\n                pattern=f\"[ipv4-addr:value = '{ip}']\",\n                pattern_type=\"stix\",\n                valid_from=datetime.now().strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n                indicator_types=[\"malicious-activity\"],\n                allow_custom=True,\n            )\n            objects.append(ip_indicator)\n            objects.append(Relationship(\n                relationship_type=\"indicates\",\n                source_ref=ip_indicator.id,\n                target_ref=malware.id,\n            ))\n\n    for domain in string_iocs.get(\"domain\", []):\n        domain_indicator = Indicator(\n            name=f\"C2 Domain: {domain}\",\n            pattern=f\"[domain-name:value = '{domain}']\",\n            pattern_type=\"stix\",\n            valid_from=datetime.now().strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n            indicator_types=[\"malicious-activity\"],\n            allow_custom=True,\n        )\n        objects.append(domain_indicator)\n        objects.append(Relationship(\n            relationship_type=\"indicates\",\n            source_ref=domain_indicator.id,\n            target_ref=malware.id,\n        ))\n\n    bundle = Bundle(objects=objects, allow_custom=True)\n    return bundle\n```\n\n## Validation Criteria\n\n- PE file parsed successfully with hashes, imports, and section analysis\n- String extraction identifies network IOCs (IPs, domains, URLs)\n- YARA rules match against known malware characteristics\n- STIX 2.1 bundle contains valid Indicator and Malware objects\n- Private IP ranges and benign strings filtered from IOC output\n- IOCs are actionable for blocking and detection rule creation\n\n## References\n\n- [pefile Documentation](https:\u002F\u002Fgithub.com\u002Ferocarrera\u002Fpefile)\n- [YARA Documentation](https:\u002F\u002Fyara.readthedocs.io\u002F)\n- [MITRE ATT&CK Software](https:\u002F\u002Fattack.mitre.org\u002Fsoftware\u002F)\n- [VirusTotal API](https:\u002F\u002Fdocs.virustotal.com\u002F)\n- [CAPE Sandbox](https:\u002F\u002Fgithub.com\u002Fkevoreilly\u002FCAPEv2)\n- [MalwareBazaar](https:\u002F\u002Fbazaar.abuse.ch\u002F)\n",{"name":5,"note":25,"tags":26,"author":35,"domain":36,"source":37,"license":15,"version":38,"nist_csf":39,"subdomain":27,"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],"threat-intelligence","cti","ioc","mitre-attack","stix","malware-analysis","yara","reverse-engineering","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","T1071","04450304b12645cb2b974ab96d28c0664758a88d","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa","core\u002Fskills\u002Fperforming-malware-ioc-extraction",1,"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-11 23:56:26",{"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-ioc-extraction",{"tool":67,"command":68},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill performing-malware-ioc-extraction",{"tool":70,"command":71},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill performing-malware-ioc-extraction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fperforming-malware-ioc-extraction\u002FSKILL.md",true,[75,81,85,91,95,99,105],{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"assets\u002Ftemplate.md","ASSET","资产文件",2294,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fperforming-malware-ioc-extraction\u002Fassets\u002Ftemplate.md",{"path":82,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fapi-reference.md","REFERENCE","参考文档",1720,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fperforming-malware-ioc-extraction\u002Freferences\u002Fapi-reference.md",{"path":92,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fstandards.md",2949,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fperforming-malware-ioc-extraction\u002Freferences\u002Fstandards.md",{"path":96,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fworkflows.md",4140,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fperforming-malware-ioc-extraction\u002Freferences\u002Fworkflows.md",{"path":100,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":103,"sourceHtmlUrl":104},"scripts\u002Fagent.py","SCRIPT","脚本",6173,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fperforming-malware-ioc-extraction\u002Fscripts\u002Fagent.py",{"path":106,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":107,"sourceHtmlUrl":108},"scripts\u002Fprocess.py",16560,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fperforming-malware-ioc-extraction\u002Fscripts\u002Fprocess.py",[110,118,125,133,141,149],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":114,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"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":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"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":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":129,"sourceHtmlUrl":130,"categories":131,"keywords":132,"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":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":137,"sourceHtmlUrl":138,"categories":139,"keywords":140,"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":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":145,"sourceHtmlUrl":146,"categories":147,"keywords":148,"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":150,"name":151,"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":152,"categories":153,"keywords":154,"publishedAt":20},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]