[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71DVA9TXG9BAMM9SZHNF40M":3,"skill-same:01M71DVA9TXG9BAMM9SZHNF40M":66},{"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":18,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":14,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M71DVA9TXG9BAMM9SZHNF40M","intel-feeds-security",null,"- Run `stix2-validator` CLI tool against exported bundles: `stix2_validator emotet_campaign_bundle.","DCx7C5\u002Fai-marketplace","DCx7C5","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42419559?v=4","01M71C01G2AZV3NTNGWAWSHJPP","DC","01M71C01GQW6G50S2BYMS7PP3E",0,"MIT","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fintel-feeds-security\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"security","feeds","intel","intel feeds security","cli","cybersecurity","run","stix2","tool","campaign","bundles","bundle","cli tool","validator","exported","2026-11-10 10:12:30",false,"---\nname: intel-feeds-security\ndescription: \"- Run `stix2-validator` CLI tool against exported bundles: `stix2_validator emotet_campaign_bundle.\"\ndomain: cybersecurity\n---\n\n# Implementing Security Information Sharing with STIX 2.1\n\nBuild and share structured threat intelligence using STIX 2.1 objects\nwith the stix2 Python library and TAXII 2.1 transport protocol.\n\n## When to Use\n\n- Building a threat intelligence platform that exchanges IOCs with partner organizations\n- Automating ingestion and export of indicators from MISP, OpenCTI, or other TIP platforms\n- Creating machine-readable intelligence reports for ISAC\u002FISAO sharing communities\n- Publishing threat data to a TAXII 2.1 server for downstream consumption by SIEMs and SOARs\n- Converting unstructured threat reports into standardized STIX 2.1 bundles\n- Enriching detection rules with context by linking indicators to malware, campaigns, and threat actors\n\n**Do not use** for sharing simple IP blocklists or CSV-based IOC feeds that do not require relationship context; plain-text feeds with simpler formats like CSV or OpenIOC may be more efficient in those cases.\n\n## Prerequisites\n\n- Python 3.8+ with `stix2` library (`pip install stix2`)\n- `taxii2-client` for consuming TAXII feeds (`pip install taxii2-client`)\n- A TAXII 2.1 server endpoint for publishing (e.g., OpenTAXII, Medallion, or MISP TAXII service)\n- Familiarity with STIX 2.1 SDO types: Indicator, Malware, Threat Actor, Campaign, Attack Pattern, Identity\n- Familiarity with STIX 2.1 SRO types: Relationship, Sighting\n- Optional: OpenCTI or MISP instance for end-to-end integration testing\n\n## Workflow\n\n### Step 1: Install Dependencies\n\n```bash\npip install stix2 taxii2-client requests\n```\n\n### Step 2: Create STIX 2.1 Domain Objects (SDOs)\n\nCreate core intelligence objects that describe threats, actors, and campaigns:\n\n```python\nfrom stix2 import (\n    Indicator, Malware, ThreatActor, Campaign,\n    AttackPattern, Identity, Relationship, Bundle,\n    ExternalReference\n)\nfrom datetime import datetime\n\n# Create a producer identity\nproducer = Identity(\n    name=\"ACME Threat Intel Team\",\n    identity_class=\"organization\",\n    sectors=[\"technology\"],\n    contact_information=\"threatintel@acme.example.com\"\n)\n\n# Create a malware object\nemotet_malware = Malware(\n    name=\"Emotet\",\n    description=\"Banking trojan turned modular botnet loader. \"\n                \"Distributed via malspam with macro-enabled Office documents.\",\n    malware_types=[\"trojan\", \"bot\"],\n    is_family=True,\n    created_by_ref=producer.id\n)\n\n# Create an attack pattern referencing MITRE ATT&CK\nspearphishing_pattern = AttackPattern(\n    name=\"Spearphishing Attachment\",\n    description=\"Adversaries send spearphishing emails with a malicious attachment.\",\n    external_references=[\n        ExternalReference(\n            source_name=\"mitre-attack\",\n            external_id=\"T1566.001\",\n            url=\"https:\u002F\u002Fattack.mitre.org\u002Ftechniques\u002FT1566\u002F001\u002F\"\n        )\n    ],\n    created_by_ref=producer.id\n)\n\n# Create a threat actor\nthreat_actor = ThreatActor(\n    name=\"Mummy Spider\",\n    description=\"Cybercriminal group operating the Emotet botnet infrastructure.\",\n    threat_actor_types=[\"crime-syndicate\"],\n    aliases=[\"TA542\", \"Gold Crestwood\"],\n    primary_motivation=\"personal-gain\",\n    created_by_ref=producer.id\n)\n\n# Create a campaign\ncampaign = Campaign(\n    name=\"Emotet Q1 2026 Resurgence\",\n    description=\"Renewed Emotet distribution campaign using thread-hijacked \"\n                \"reply-chain emails with OneNote lure attachments.\",\n    first_seen=\"2026-01-15T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\nprint(f\"Created malware SDO: {emotet_malware.id}\")\nprint(f\"Created threat actor SDO: {threat_actor.id}\")\nprint(f\"Created campaign SDO: {campaign.id}\")\n```\n\n### Step 3: Create STIX Indicators with Patterns\n\nDefine detection patterns using the STIX Patterning Language:\n\n```python\n# File hash indicator\nhash_indicator = Indicator(\n    name=\"Emotet dropper hash\",\n    description=\"SHA-256 hash of Emotet first-stage dropper observed in Jan 2026 campaign.\",\n    indicator_types=[\"malicious-activity\"],\n    pattern_type=\"stix\",\n    pattern=\"[file:hashes.'SHA-256' = 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2']\",\n    valid_from=\"2026-01-15T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\n# Network indicator for C2 domain\nc2_indicator = Indicator(\n    name=\"Emotet C2 domain\",\n    description=\"Command and control domain observed in Emotet tier-1 botnet infrastructure.\",\n    indicator_types=[\"malicious-activity\"],\n    pattern_type=\"stix\",\n    pattern=\"[domain-name:value = 'malicious-c2.example.com']\",\n    valid_from=\"2026-01-20T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\n# Compound pattern: process spawning with suspicious command line\nprocess_indicator = Indicator(\n    name=\"Emotet PowerShell download cradle\",\n    description=\"PowerShell execution pattern used by Emotet to download next-stage payload.\",\n    indicator_types=[\"malicious-activity\"],\n    pattern_type=\"stix\",\n    pattern=(\n        \"[process:command_line MATCHES 'powershell.*-enc.*' \"\n        \"AND process:parent_ref.name = 'winword.exe']\"\n    ),\n    valid_from=\"2026-01-15T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\n# Email subject indicator\nemail_indicator = Indicator(\n    name=\"Emotet phishing subject line pattern\",\n    description=\"Subject line pattern seen in thread-hijacked Emotet phishing emails.\",\n    indicator_types=[\"malicious-activity\"],\n    pattern_type=\"stix\",\n    pattern=\"[email-message:subject MATCHES '^RE:.*Invoice.*[0-9]{6}']\",\n    valid_from=\"2026-01-15T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\nprint(f\"Created {4} indicator objects\")\n```\n\n### Step 4: Build Relationships Between Objects\n\nLink SDOs together using Relationship objects to express how threats are connected:\n\n```python\n# Malware uses attack pattern\nrel_malware_attack = Relationship(\n    relationship_type=\"uses\",\n    source_ref=emotet_malware.id,\n    target_ref=spearphishing_pattern.id,\n    description=\"Emotet is distributed via spearphishing attachments.\",\n    created_by_ref=producer.id\n)\n\n# Threat actor uses malware\nrel_actor_malware = Relationship(\n    relationship_type=\"uses\",\n    source_ref=threat_actor.id,\n    target_ref=emotet_malware.id,\n    description=\"Mummy Spider operates the Emotet malware infrastructure.\",\n    created_by_ref=producer.id\n)\n\n# Indicator indicates malware\nrel_indicator_malware = Relationship(\n    relationship_type=\"indicates\",\n    source_ref=hash_indicator.id,\n    target_ref=emotet_malware.id,\n    description=\"File hash indicator for Emotet dropper binary.\",\n    created_by_ref=producer.id\n)\n\n# Campaign uses malware\nrel_campaign_malware = Relationship(\n    relationship_type=\"uses\",\n    source_ref=campaign.id,\n    target_ref=emotet_malware.id,\n    created_by_ref=producer.id\n)\n\n# Threat actor attributed to campaign\nrel_actor_campaign = Relationship(\n    relationship_type=\"attributed-to\",\n    source_ref=campaign.id,\n    target_ref=threat_actor.id,\n    created_by_ref=producer.id\n)\n\nprint(f\"Created {5} relationship objects linking threat intelligence\")\n```\n\n### Step 5: Assemble and Serialize a STIX Bundle\n\nPackage all objects into a bundle for sharing:\n\n```python\nimport json\n\nbundle = Bundle(\n    objects=[\n        producer,\n        emotet_malware,\n        spearphishing_pattern,\n        threat_actor,\n        campaign,\n        hash_indicator,\n        c2_indicator,\n        process_indicator,\n        email_indicator,\n        rel_malware_attack,\n        rel_actor_malware,\n        rel_indicator_malware,\n        rel_campaign_malware,\n        rel_actor_campaign,\n    ]\n)\n\n# Serialize to JSON\nbundle_json = bundle.serialize(pretty=True)\n\n# Write bundle to file for sharing\nwith open(\"emotet_campaign_bundle.json\", \"w\") as f:\n    f.write(bundle_json)\n\nprint(f\"Bundle {bundle.id} contains {len(bundle.objects)} objects\")\nprint(f\"Written to emotet_campaign_bundle.json\")\n\n# Validate the bundle by re-parsing\nfrom stix2 import parse\nparsed = parse(bundle_json, allow_custom=False)\nprint(f\"Bundle validation passed: {len(parsed.objects)} objects parsed successfully\")\n```\n\n### Step 6: Consume Intelligence from a TAXII 2.1 Server\n\nRetrieve published threat intelligence from a TAXII feed:\n\n```python\nfrom taxii2client.v21 import Server, Collection, as_pages\nimport json\n\n# Connect to a TAXII 2.1 server\ntaxii_server = Server(\n    \"https:\u002F\u002Ftaxii.example.com\u002Ftaxii2\u002F\",\n    user=\"readonly\",\n    password=\"readonly_password\"\n)\n\n# Discover API roots and collections\napi_root = taxii_server.api_roots[0]\nprint(f\"API Root: {api_root.title}\")\n\nfor collection in api_root.collections:\n    print(f\"  Collection: {collection.title} (ID: {collection.id})\")\n\n# Fetch indicators from a specific collection\ntarget_collection = Collection(\n    f\"https:\u002F\u002Ftaxii.example.com\u002Ftaxii2\u002Fcollections\u002F{api_root.collections[0].id}\u002F\",\n    user=\"readonly\",\n    password=\"readonly_password\"\n)\n\n# Retrieve objects with filtering\nresponse = target_collection.get_objects(\n    added_after=\"2026-01-01T00:00:00Z\",\n    type=[\"indicator\", \"malware\"]\n)\n\nstix_data = json.loads(response.text)\nprint(f\"Retrieved {len(stix_data.get('objects', []))} objects from TAXII server\")\n\n# Process each retrieved object\nfor obj in stix_data.get(\"objects\", []):\n    if obj[\"type\"] == \"indicator\":\n        print(f\"  Indicator: {obj['name']} | Pattern: {obj['pattern'][:60]}...\")\n    elif obj[\"type\"] == \"malware\":\n        print(f\"  Malware: {obj['name']} | Family: {obj.get('is_family', False)}\")\n```\n\n### Step 7: Publish Intelligence to a TAXII 2.1 Server\n\nPush your STIX bundle to a writable TAXII collection:\n\n```python\nimport requests\nimport json\n\nTAXII_URL = \"https:\u002F\u002Ftaxii.example.com\u002Ftaxii2\u002Fcollections\u002FCOLLECTION_ID\u002Fobjects\u002F\"\nTAXII_USER = \"publisher\"\nTAXII_PASS = \"publisher_password\"\n\nheaders = {\n    \"Content-Type\": \"application\u002Ftaxii+json;version=2.1\",\n    \"Accept\": \"application\u002Ftaxii+json;version=2.1\"\n}\n\n# Read the bundle we created earlier\nwith open(\"emotet_campaign_bundle.json\", \"r\") as f:\n    bundle_data = f.read()\n\nresponse = requests.post(\n    TAXII_URL,\n    headers=headers,\n    auth=(TAXII_USER, TAXII_PASS),\n    data=bundle_data,\n    timeout=30\n)\n\nif response.status_code in (200, 201, 202):\n    status = response.json()\n    print(f\"Published successfully. Status ID: {status.get('id')}\")\n    print(f\"  Total count: {status.get('total_count')}\")\n    print(f\"  Success count: {status.get('success_count')}\")\n    print(f\"  Failure count: {status.get('failure_count')}\")\nelse:\n    print(f\"Publishing failed: {response.status_code} - {response.text}\")\n```\n\n### Step 8: Validate and Lint STIX Objects\n\nEnsure objects comply with the STIX 2.1 specification:\n\n```python\nfrom stix2 import parse, exceptions\nimport json\n\ndef validate_stix_bundle(bundle_path):\n    \"\"\"Validate all objects in a STIX bundle against the 2.1 spec.\"\"\"\n    with open(bundle_path, \"r\") as f:\n        raw = json.load(f)\n\n    errors = []\n    valid_count = 0\n\n    for obj in raw.get(\"objects\", []):\n        try:\n            parsed = parse(json.dumps(obj), allow_custom=False)\n            valid_count += 1\n        except (exceptions.InvalidValueError, exceptions.MissingPropertiesError) as e:\n            errors.append({\n                \"object_id\": obj.get(\"id\", \"unknown\"),\n                \"object_type\": obj.get(\"type\", \"unknown\"),\n                \"error\": str(e)\n            })\n\n    print(f\"Validation results: {valid_count} valid, {len(errors)} errors\")\n    for err in errors:\n        print(f\"  ERROR in {err['object_type']} ({err['object_id']}): {err['error']}\")\n\n    return len(errors) == 0\n\nvalidate_stix_bundle(\"emotet_campaign_bundle.json\")\n```\n\n## Verification\n\n- Confirm all STIX objects serialize to valid JSON and include required properties (`type`, `id`, `created`, `modified`)\n- Verify relationship `source_ref` and `target_ref` point to existing object IDs within the bundle\n- Validate indicator patterns parse correctly using the STIX patterning grammar\n- Test TAXII publishing returns a success status with `success_count` matching the number of objects sent\n- Re-retrieve published objects from the TAXII server and confirm they round-trip without data loss\n- Check that consuming systems (SIEM, SOAR, TIP) can ingest the bundle and create corresponding detection rules or enrichment data\n- Run `stix2-validator` CLI tool against exported bundles: `stix2_validator emotet_campaign_bundle.json`\n","# Implementing Security Information Sharing with STIX 2.1\n\nBuild and share structured threat intelligence using STIX 2.1 objects\nwith the stix2 Python library and TAXII 2.1 transport protocol.\n\n## When to Use\n\n- Building a threat intelligence platform that exchanges IOCs with partner organizations\n- Automating ingestion and export of indicators from MISP, OpenCTI, or other TIP platforms\n- Creating machine-readable intelligence reports for ISAC\u002FISAO sharing communities\n- Publishing threat data to a TAXII 2.1 server for downstream consumption by SIEMs and SOARs\n- Converting unstructured threat reports into standardized STIX 2.1 bundles\n- Enriching detection rules with context by linking indicators to malware, campaigns, and threat actors\n\n**Do not use** for sharing simple IP blocklists or CSV-based IOC feeds that do not require relationship context; plain-text feeds with simpler formats like CSV or OpenIOC may be more efficient in those cases.\n\n## Prerequisites\n\n- Python 3.8+ with `stix2` library (`pip install stix2`)\n- `taxii2-client` for consuming TAXII feeds (`pip install taxii2-client`)\n- A TAXII 2.1 server endpoint for publishing (e.g., OpenTAXII, Medallion, or MISP TAXII service)\n- Familiarity with STIX 2.1 SDO types: Indicator, Malware, Threat Actor, Campaign, Attack Pattern, Identity\n- Familiarity with STIX 2.1 SRO types: Relationship, Sighting\n- Optional: OpenCTI or MISP instance for end-to-end integration testing\n\n## Workflow\n\n### Step 1: Install Dependencies\n\n```bash\npip install stix2 taxii2-client requests\n```\n\n### Step 2: Create STIX 2.1 Domain Objects (SDOs)\n\nCreate core intelligence objects that describe threats, actors, and campaigns:\n\n```python\nfrom stix2 import (\n    Indicator, Malware, ThreatActor, Campaign,\n    AttackPattern, Identity, Relationship, Bundle,\n    ExternalReference\n)\nfrom datetime import datetime\n\n# Create a producer identity\nproducer = Identity(\n    name=\"ACME Threat Intel Team\",\n    identity_class=\"organization\",\n    sectors=[\"technology\"],\n    contact_information=\"threatintel@acme.example.com\"\n)\n\n# Create a malware object\nemotet_malware = Malware(\n    name=\"Emotet\",\n    description=\"Banking trojan turned modular botnet loader. \"\n                \"Distributed via malspam with macro-enabled Office documents.\",\n    malware_types=[\"trojan\", \"bot\"],\n    is_family=True,\n    created_by_ref=producer.id\n)\n\n# Create an attack pattern referencing MITRE ATT&CK\nspearphishing_pattern = AttackPattern(\n    name=\"Spearphishing Attachment\",\n    description=\"Adversaries send spearphishing emails with a malicious attachment.\",\n    external_references=[\n        ExternalReference(\n            source_name=\"mitre-attack\",\n            external_id=\"T1566.001\",\n            url=\"https:\u002F\u002Fattack.mitre.org\u002Ftechniques\u002FT1566\u002F001\u002F\"\n        )\n    ],\n    created_by_ref=producer.id\n)\n\n# Create a threat actor\nthreat_actor = ThreatActor(\n    name=\"Mummy Spider\",\n    description=\"Cybercriminal group operating the Emotet botnet infrastructure.\",\n    threat_actor_types=[\"crime-syndicate\"],\n    aliases=[\"TA542\", \"Gold Crestwood\"],\n    primary_motivation=\"personal-gain\",\n    created_by_ref=producer.id\n)\n\n# Create a campaign\ncampaign = Campaign(\n    name=\"Emotet Q1 2026 Resurgence\",\n    description=\"Renewed Emotet distribution campaign using thread-hijacked \"\n                \"reply-chain emails with OneNote lure attachments.\",\n    first_seen=\"2026-01-15T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\nprint(f\"Created malware SDO: {emotet_malware.id}\")\nprint(f\"Created threat actor SDO: {threat_actor.id}\")\nprint(f\"Created campaign SDO: {campaign.id}\")\n```\n\n### Step 3: Create STIX Indicators with Patterns\n\nDefine detection patterns using the STIX Patterning Language:\n\n```python\n# File hash indicator\nhash_indicator = Indicator(\n    name=\"Emotet dropper hash\",\n    description=\"SHA-256 hash of Emotet first-stage dropper observed in Jan 2026 campaign.\",\n    indicator_types=[\"malicious-activity\"],\n    pattern_type=\"stix\",\n    pattern=\"[file:hashes.'SHA-256' = 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2']\",\n    valid_from=\"2026-01-15T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\n# Network indicator for C2 domain\nc2_indicator = Indicator(\n    name=\"Emotet C2 domain\",\n    description=\"Command and control domain observed in Emotet tier-1 botnet infrastructure.\",\n    indicator_types=[\"malicious-activity\"],\n    pattern_type=\"stix\",\n    pattern=\"[domain-name:value = 'malicious-c2.example.com']\",\n    valid_from=\"2026-01-20T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\n# Compound pattern: process spawning with suspicious command line\nprocess_indicator = Indicator(\n    name=\"Emotet PowerShell download cradle\",\n    description=\"PowerShell execution pattern used by Emotet to download next-stage payload.\",\n    indicator_types=[\"malicious-activity\"],\n    pattern_type=\"stix\",\n    pattern=(\n        \"[process:command_line MATCHES 'powershell.*-enc.*' \"\n        \"AND process:parent_ref.name = 'winword.exe']\"\n    ),\n    valid_from=\"2026-01-15T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\n# Email subject indicator\nemail_indicator = Indicator(\n    name=\"Emotet phishing subject line pattern\",\n    description=\"Subject line pattern seen in thread-hijacked Emotet phishing emails.\",\n    indicator_types=[\"malicious-activity\"],\n    pattern_type=\"stix\",\n    pattern=\"[email-message:subject MATCHES '^RE:.*Invoice.*[0-9]{6}']\",\n    valid_from=\"2026-01-15T00:00:00Z\",\n    created_by_ref=producer.id\n)\n\nprint(f\"Created {4} indicator objects\")\n```\n\n### Step 4: Build Relationships Between Objects\n\nLink SDOs together using Relationship objects to express how threats are connected:\n\n```python\n# Malware uses attack pattern\nrel_malware_attack = Relationship(\n    relationship_type=\"uses\",\n    source_ref=emotet_malware.id,\n    target_ref=spearphishing_pattern.id,\n    description=\"Emotet is distributed via spearphishing attachments.\",\n    created_by_ref=producer.id\n)\n\n# Threat actor uses malware\nrel_actor_malware = Relationship(\n    relationship_type=\"uses\",\n    source_ref=threat_actor.id,\n    target_ref=emotet_malware.id,\n    description=\"Mummy Spider operates the Emotet malware infrastructure.\",\n    created_by_ref=producer.id\n)\n\n# Indicator indicates malware\nrel_indicator_malware = Relationship(\n    relationship_type=\"indicates\",\n    source_ref=hash_indicator.id,\n    target_ref=emotet_malware.id,\n    description=\"File hash indicator for Emotet dropper binary.\",\n    created_by_ref=producer.id\n)\n\n# Campaign uses malware\nrel_campaign_malware = Relationship(\n    relationship_type=\"uses\",\n    source_ref=campaign.id,\n    target_ref=emotet_malware.id,\n    created_by_ref=producer.id\n)\n\n# Threat actor attributed to campaign\nrel_actor_campaign = Relationship(\n    relationship_type=\"attributed-to\",\n    source_ref=campaign.id,\n    target_ref=threat_actor.id,\n    created_by_ref=producer.id\n)\n\nprint(f\"Created {5} relationship objects linking threat intelligence\")\n```\n\n### Step 5: Assemble and Serialize a STIX Bundle\n\nPackage all objects into a bundle for sharing:\n\n```python\nimport json\n\nbundle = Bundle(\n    objects=[\n        producer,\n        emotet_malware,\n        spearphishing_pattern,\n        threat_actor,\n        campaign,\n        hash_indicator,\n        c2_indicator,\n        process_indicator,\n        email_indicator,\n        rel_malware_attack,\n        rel_actor_malware,\n        rel_indicator_malware,\n        rel_campaign_malware,\n        rel_actor_campaign,\n    ]\n)\n\n# Serialize to JSON\nbundle_json = bundle.serialize(pretty=True)\n\n# Write bundle to file for sharing\nwith open(\"emotet_campaign_bundle.json\", \"w\") as f:\n    f.write(bundle_json)\n\nprint(f\"Bundle {bundle.id} contains {len(bundle.objects)} objects\")\nprint(f\"Written to emotet_campaign_bundle.json\")\n\n# Validate the bundle by re-parsing\nfrom stix2 import parse\nparsed = parse(bundle_json, allow_custom=False)\nprint(f\"Bundle validation passed: {len(parsed.objects)} objects parsed successfully\")\n```\n\n### Step 6: Consume Intelligence from a TAXII 2.1 Server\n\nRetrieve published threat intelligence from a TAXII feed:\n\n```python\nfrom taxii2client.v21 import Server, Collection, as_pages\nimport json\n\n# Connect to a TAXII 2.1 server\ntaxii_server = Server(\n    \"https:\u002F\u002Ftaxii.example.com\u002Ftaxii2\u002F\",\n    user=\"readonly\",\n    password=\"readonly_password\"\n)\n\n# Discover API roots and collections\napi_root = taxii_server.api_roots[0]\nprint(f\"API Root: {api_root.title}\")\n\nfor collection in api_root.collections:\n    print(f\"  Collection: {collection.title} (ID: {collection.id})\")\n\n# Fetch indicators from a specific collection\ntarget_collection = Collection(\n    f\"https:\u002F\u002Ftaxii.example.com\u002Ftaxii2\u002Fcollections\u002F{api_root.collections[0].id}\u002F\",\n    user=\"readonly\",\n    password=\"readonly_password\"\n)\n\n# Retrieve objects with filtering\nresponse = target_collection.get_objects(\n    added_after=\"2026-01-01T00:00:00Z\",\n    type=[\"indicator\", \"malware\"]\n)\n\nstix_data = json.loads(response.text)\nprint(f\"Retrieved {len(stix_data.get('objects', []))} objects from TAXII server\")\n\n# Process each retrieved object\nfor obj in stix_data.get(\"objects\", []):\n    if obj[\"type\"] == \"indicator\":\n        print(f\"  Indicator: {obj['name']} | Pattern: {obj['pattern'][:60]}...\")\n    elif obj[\"type\"] == \"malware\":\n        print(f\"  Malware: {obj['name']} | Family: {obj.get('is_family', False)}\")\n```\n\n### Step 7: Publish Intelligence to a TAXII 2.1 Server\n\nPush your STIX bundle to a writable TAXII collection:\n\n```python\nimport requests\nimport json\n\nTAXII_URL = \"https:\u002F\u002Ftaxii.example.com\u002Ftaxii2\u002Fcollections\u002FCOLLECTION_ID\u002Fobjects\u002F\"\nTAXII_USER = \"publisher\"\nTAXII_PASS = \"publisher_password\"\n\nheaders = {\n    \"Content-Type\": \"application\u002Ftaxii+json;version=2.1\",\n    \"Accept\": \"application\u002Ftaxii+json;version=2.1\"\n}\n\n# Read the bundle we created earlier\nwith open(\"emotet_campaign_bundle.json\", \"r\") as f:\n    bundle_data = f.read()\n\nresponse = requests.post(\n    TAXII_URL,\n    headers=headers,\n    auth=(TAXII_USER, TAXII_PASS),\n    data=bundle_data,\n    timeout=30\n)\n\nif response.status_code in (200, 201, 202):\n    status = response.json()\n    print(f\"Published successfully. Status ID: {status.get('id')}\")\n    print(f\"  Total count: {status.get('total_count')}\")\n    print(f\"  Success count: {status.get('success_count')}\")\n    print(f\"  Failure count: {status.get('failure_count')}\")\nelse:\n    print(f\"Publishing failed: {response.status_code} - {response.text}\")\n```\n\n### Step 8: Validate and Lint STIX Objects\n\nEnsure objects comply with the STIX 2.1 specification:\n\n```python\nfrom stix2 import parse, exceptions\nimport json\n\ndef validate_stix_bundle(bundle_path):\n    \"\"\"Validate all objects in a STIX bundle against the 2.1 spec.\"\"\"\n    with open(bundle_path, \"r\") as f:\n        raw = json.load(f)\n\n    errors = []\n    valid_count = 0\n\n    for obj in raw.get(\"objects\", []):\n        try:\n            parsed = parse(json.dumps(obj), allow_custom=False)\n            valid_count += 1\n        except (exceptions.InvalidValueError, exceptions.MissingPropertiesError) as e:\n            errors.append({\n                \"object_id\": obj.get(\"id\", \"unknown\"),\n                \"object_type\": obj.get(\"type\", \"unknown\"),\n                \"error\": str(e)\n            })\n\n    print(f\"Validation results: {valid_count} valid, {len(errors)} errors\")\n    for err in errors:\n        print(f\"  ERROR in {err['object_type']} ({err['object_id']}): {err['error']}\")\n\n    return len(errors) == 0\n\nvalidate_stix_bundle(\"emotet_campaign_bundle.json\")\n```\n\n## Verification\n\n- Confirm all STIX objects serialize to valid JSON and include required properties (`type`, `id`, `created`, `modified`)\n- Verify relationship `source_ref` and `target_ref` point to existing object IDs within the bundle\n- Validate indicator patterns parse correctly using the STIX patterning grammar\n- Test TAXII publishing returns a success status with `success_count` matching the number of objects sent\n- Re-retrieve published objects from the TAXII server and confirm they round-trip without data loss\n- Check that consuming systems (SIEM, SOAR, TIP) can ingest the bundle and create corresponding detection rules or enrichment data\n- Run `stix2-validator` CLI tool against exported bundles: `stix2_validator emotet_campaign_bundle.json`\n",{"name":5,"domain":24,"description":7},"main","a91f1293287ffa9f4f1b8f486cd6e835a1568c84","skills\u002Fintel-feeds-security","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace","https:\u002F\u002Fgithub.com\u002FDCx7C5","#Python","2026-09-01 11:21:00",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add DCx7C5\u002Fai-marketplace --skill intel-feeds-security",{"tool":52,"command":53},"bunx","bunx skills add DCx7C5\u002Fai-marketplace --skill intel-feeds-security",{"tool":55,"command":56},"pnpm","pnpm dlx skills add DCx7C5\u002Fai-marketplace --skill intel-feeds-security","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fintel-feeds-security\u002FSKILL.md",true,[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"index.json","REFERENCE","参考文档",558,"https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fintel-feeds-security\u002Findex.json",[67,92,115,137,159,175],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":34},"01M71HAPZ01KQ30RKTB0FFSQ05","services-wmi-persistence-detect","Detect WMI event subscription persistence by enumerating ActiveScriptEventConsumer, CommandLineEventConsumer, and permanent subscriptions in the WMI repository.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fservices\u002Fwmi\u002Fpersistence\u002Fdetect\u002FSKILL.md",[],[74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,24,91],"services","detect","services wmi persistence detect","wmi","persistence","de","cm","process","activescript","event","subscriptions","commandline-consumer","repository","subscription","event-subscription","t1546.003","forensics","process-forensics",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":34},"01M71HAK6JTTTS229T17WJMMCG","services-wmi-exec-exploit","Perform lateral movement across Windows networks using WMI-based remote execution techniques including Impacket wmiexec.py, CrackMapExec, and native WMI commands for stealthy post-exploitation during red team engagements.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fservices\u002Fwmi\u002Fexec\u002Fexploit\u002FSKILL.md",[],[99,74,100,77,101,102,103,24,104,105,106,107,108,109,79,110,111,112,113,114],"exploit","services wmi exec exploit","exec","remote","traffic","Bash","analysis","team","across","crackmapexec","native","command","lateral movement","read","lateral-movement","Impacket",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":34},"01M71HAG6MHKNQV8KDZKMT4886","registry-artifact-extract","Extract and analyze Windows Registry hives to uncover user activity, installed software, autostart entries, and evidence of system compromise.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fregistry\u002Fartifact\u002Fextract\u002FSKILL.md",[],[122,123,124,125,126,127,24,104,128,105,129,130,79,112,131,132,133,134,135,136],"artifact","registry","registry artifact extract","extract","evidence-collection","artifact-analysis","collection","analyze","uncover","software","activity","digital-forensics","windows-registry","regripper","sonnet",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":34},"01M71HACR4A8XTWTTSXK4124AA","processes-token-impersonate-detect","Detect Windows token impersonation and privilege abuse including SeImpersonatePrivilege exploitation via Potato attacks and token stealing techniques.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Ftoken\u002Fimpersonate\u002Fdetect\u002FSKILL.md",[],[75,144,145,146,147,148,149,80,150,24,91,151,152,153,154,155,156,157,158,79],"processes token impersonate detect","token","processes","attacks","windows","escalation","techniques","privilege-escalation","seimpersonate","token-impersonation","printspoofer","exploitation","potato","impersonation","via",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":34},"01M71HAABSB4Z6QFSXEG00R4RK","processes-thread-injection-detect","Detect Windows thread injection techniques including CreateRemoteThread, QueueUserAPC, NtCreateThreadEx, and thread hijacking via process memory analysis.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Fthread\u002Finjection\u002Fdetect\u002FSKILL.md",[],[166,167,75,168,146,148,169,80,170,150,24,91,105,171,172,173,174,158,79,81],"thread","processes thread injection detect","injection","memory","process-injection","api","apc-injection","thread-injection","nt-api",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":34},"01M71HA7H311V5G14WMX58HQSS","processes-hollow-technique-detect","Detect process hollowing (RunPE) by identifying processes with mismatched image paths between PEB and VAD tree, or unmapped PE headers in memory.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Fhollow\u002Ftechnique\u002Fdetect\u002FSKILL.md",[],[182,75,146,183,169,80,184,185,24,91,186,187,188,189,190,191,79,81,192,193],"processes hollow technique detect","tree","memory-forensics","process-hollow","peb","runpe","image","pe-header","in memory","with","mismatched","headers"]