Перейти к содержанию
Skillpedia
Безопасность35k · #7703

building-ioc-defanging-and-sharing-pipeline

Что он делает

Этот инструмент строит автоматизированную систему, которая упорядочивает и подготавливает к передаче информацию об угрозах безопасности (например, вредоносные сайты или IP-адреса). Он делает эти данные безопасными для передачи, чтобы по ним нельзя было случайно перейти, и приводит их к стандартному формату, который понимают другие системы безопасности.

Когда использовать

  • ✓Когда готовите списки опасных сайтов или IP-адресов для передачи команде.
  • ✓Когда автоматизируете отправку оповещений безопасности в другие инструменты.
  • ✓Когда нужно организовать данные о безопасности в соответствии с определенными правилами.

Ссылка на скилл

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

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/building-ioc-defanging-and-sharing-pipeline/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Сделай безопасным для передачи этот список URL и IP: hxxps://malicious-site[.]com, 192.168.1.1, another-bad-domain[.]org”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

Сначала инструмент «очищает» и упорядочивает входящие данные. Затем он изменяет адреса так, чтобы по ним нельзя было случайно перейти (например, заменяет «.» на «[.]»), и конвертирует их в стандарт STIX 2.1, который понимают другие инструменты безопасности.

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с GitHub.

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("[@]", "@")

…
Частые вопросы

Что означает «defanging»?

Это обезвреживание индикаторов угроз (URL или IP-адресов): их изменяют так, чтобы по ним нельзя было случайно перейти. Например, «http://» превращается в «hxxp://», а «.» в «[.]».

Что такое IOC?

IOC (Indicators of Compromise, индикаторы компрометации) это технические признаки того, что система могла быть атакована или взломана, например вредоносный IP-адрес, подозрительное доменное имя или файл с известным хешем.

Для чего используется формат STIX 2.1?

STIX 2.1 это стандартный язык описания киберугроз. Благодаря нему разные инструменты безопасности могут обмениваться информацией единообразно и автоматически.

Подробности

Оригинальное описание автора

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

Популярность

Звёзды на GitHub
35k
Место в рейтинге
#7703
Лицензия
Apache-2.0
Обновлён
31.08.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы