Chuyển đến nội dung
Skillpedia
Bảo mật35k · #7703

building-ioc-defanging-and-sharing-pipeline

Skill này làm gì

Công cụ này xây dựng một hệ thống tự động để sắp xếp và chuẩn bị thông tin về mối đe dọa (như website hoặc địa chỉ IP độc hại). Nó giúp việc chia sẻ an toàn bằng cách ngăn việc nhấp nhầm và sắp xếp dữ liệu theo định dạng chuẩn cho các hệ thống bảo mật khác.

Khi nào nên dùng

  • ✓Khi chuẩn bị danh sách website hoặc IP nguy hiểm để chia sẻ với đội của bạn.
  • ✓Khi tự động hóa việc gửi cảnh báo bảo mật đến các công cụ khác.
  • ✓Khi sắp xếp thông tin bảo mật theo các quy định cụ thể.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/building-ioc-defanging-and-sharing-pipeline/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/building-ioc-defanging-and-sharing-pipeline/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm cho danh sách URL và IP này an toàn khi chia sẻ: hxxps://malicious-site[.]com, 192.168.1.1, another-bad-domain[.]org”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ trước tiên “làm sạch” và sắp xếp dữ liệu đầu vào. Sau đó, nó chỉnh sửa địa chỉ để không thể bị kích hoạt nhầm (ví dụ đổi “.” thành “[.]”) và chuyển dữ liệu sang định dạng chuẩn (STIX 2.1) để các công cụ bảo mật khác hiểu được.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Building IOC Defanging and Sharing Pipeline

Overview

IOC defanging modifies potentially malicious indicators (URLs, IP addresses, domains, email addresses) to prevent accidental clicks or execution while preserving readability for analysis and sharing. This skill covers building an automated pipeline that ingests raw IOCs from multiple sources, normalizes and deduplicates them, applies defanging for safe human consumption, converts them to STIX 2.1 format for machine consumption, and distributes through TAXII servers, MISP instances, and email reports.

When to Use

  • When deploying or configuring building ioc defanging and sharing pipeline capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Python 3.9+ with defang, ioc-fanger, stix2, requests, validators libraries
  • MISP instance or TAXII server for automated sharing
  • Understanding of IOC types: IPv4/IPv6, domains, URLs, email addresses, file hashes
  • Familiarity with STIX 2.1 Indicator patterns and TLP marking definitions
  • Access to threat intelligence feeds for IOC ingestion

Key Concepts

IOC Defanging Standards

Defanging replaces active protocol and domain components to prevent execution: http:// becomes hxxp://, https:// becomes hxxps://, dots in domains/IPs become [.], @ in emails becomes [@]. This is critical for sharing IOCs in reports, emails, Slack channels, and paste sites where auto-linking could trigger network connections to malicious infrastructure.

IOC Normalization

Raw IOCs from different sources come in inconsistent formats. Normalization involves converting to lowercase, removing trailing slashes and whitespace, extracting domains from URLs, resolving URL encoding, validating format correctness, and deduplicating across sources.

STIX 2.1 Indicator Patterns

STIX patterns express IOCs in a standardized format: [ipv4-addr:value = '203.0.113.1'], [domain-name:value = 'malicious.example.com'], [url:value = 'http://evil.com/payload'], [file:hashes.'SHA-256' = 'abc123...']. Each indicator includes valid_from, indicator_types, confidence, and optional TLP markings.

Workflow

Step 1: Build IOC Extraction and Normalization

import re
import hashlib
from urllib.parse import urlparse, unquote
from datetime import datetime

class IOCExtractor:
    """Extract and normalize IOCs from text."""

    PATTERNS = {
        "ipv4": r'\b(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\b',
        "domain": r'\b(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}\b',
        "url": r'https?://[^\s<>"{}|\\^`\[\]]+',
        "email": r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b',
        "md5": r'\b[a-fA-F0-9]{32}\b',
        "sha1": r'\b[a-fA-F0-9]{40}\b',
        "sha256": r'\b[a-fA-F0-9]{64}\b',
    }

    WHITELIST_DOMAINS = {
        "google.com", "microsoft.com", "amazon.com", "github.com",
        "cloudflare.com", "akamai.com", "example.com",
    }

    def extract_from_text(self, text):
        """Extract all IOC types from free text."""
        # Refang any already-defanged indicators first
        text = self._refang(text)
        iocs = {"ipv4": set(), "domain": set(), "url": set(),
                "email": set(), "md5": set(), "sha1": set(), "sha256": set()}

        for ioc_type, pattern in self.PATTERNS.items():
            matches = re.findall(pattern, text)
            for match in matches:
                normalized = self._normalize(match, ioc_type)
                if normalized and not self._is_whitelisted(normalized, ioc_type):
                    iocs[ioc_type].add(normalized)

        # Remove domains that are part of URLs
        url_domains = set()
        for url in iocs["url"]:
            parsed = urlparse(url)
            url_domains.add(parsed.netloc)
        iocs["domain"] -= url_domains

        total = sum(len(v) for v in iocs.values())
        print(f"[+] Extracted {total} unique IOCs from text")
        return {k: sorted(v) for k, v in iocs.items()}

    def _refang(self, text):
        """Convert defanged indicators back to active form."""
        text = text.replace("hxxp://", "http://").replace("hxxps://", "https://")
        text = text.replace("[.]", ".").replace("[@]", "@")

…
Câu hỏi thường gặp

Defang nghĩa là gì?

Đây là việc chỉnh sửa các chỉ báo mối đe dọa (như URL hoặc IP) để không thể bị kích hoạt nhầm, ví dụ khi nhấp chuột. Ví dụ, “http://” thành “hxxp://” và “.” thành “[.]”.

IOC là gì?

IOC là “Indicators of Compromise” (dấu hiệu xâm nhập). Đây là các chi tiết kỹ thuật cho thấy hệ thống có thể đã bị tấn công, như địa chỉ IP độc hại, tên miền đáng ngờ hoặc file có mã hash đã biết.

Định dạng STIX 2.1 dùng để làm gì?

STIX 2.1 là ngôn ngữ chuẩn để mô tả mối đe dọa mạng. Dùng định dạng này cho phép các công cụ bảo mật khác nhau trao đổi thông tin nhất quán và tự động.

Chi tiết

Mô tả gốc của tác giả

Build an automated pipeline that ingests raw IOCs (URLs, IPs, domains, emails), normalizes and deduplicates them, then produces defanged renderings for safe human reading alongside canonical STIX 2.1 bundles distributed via TAXII servers, MISP, or email reports. Use when preparing indicators of compromise for safe analyst sharing or automating threat intel distribution to TAXII/MISP feeds.

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#7703
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự