Chuyển đến nội dung
Skillpedia
Thu thập dữ liệu web35k · #7933

extracting-iocs-from-malware-samples

Skill này làm gì

Công cụ này trích xuất các thông tin quan trọng (gọi là “chỉ báo”) từ mẫu mã độc. Nó tìm những thứ như địa chỉ website, đường dẫn tệp và các mẫu hành vi có thể dùng để phòng thủ trước mối đe dọa.

Khi nào nên dùng

  • ✓Sau khi phân tích một chương trình độc hại và cần thu thập các dấu vết.
  • ✓Để tạo danh sách chặn cho tường lửa hoặc hệ thống bảo mật.
  • ✓Để tạo quy tắc phát hiện cho các công cụ bảo mật khác.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/extracting-iocs-from-malware-samples/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/extracting-iocs-from-malware-samples/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

“Trích xuất các chỉ báo xâm phạm (IOC) từ mẫu mã độc 'malware.exe'.”

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

Cách hoạt động

Công cụ kiểm tra tệp và các báo cáo phân tích để tìm địa chỉ IP, tên miền, đường dẫn tệp và các dấu vết khác. Sau đó nó định dạng thông tin để các công cụ bảo mật khác dễ sử dụng.

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.

Extracting IOCs from Malware Samples

When to Use

  • A malware analysis (static or dynamic) is complete and actionable indicators need to be extracted for defense teams
  • Building blocklists for firewalls, proxies, and DNS sinkholes from analyzed samples
  • Creating YARA rules, Snort/Suricata signatures, or SIEM detection content from malware artifacts
  • Contributing to threat intelligence sharing platforms (MISP, OTX, ThreatConnect)
  • Tracking malware campaigns by correlating IOCs across multiple samples

Do not use for IOCs from unverified sources without validation; false positives in blocklists can disrupt legitimate business operations.

Prerequisites

  • Python 3.8+ with iocextract, pefile, yara-python libraries installed
  • Completed malware analysis report (static analysis, dynamic analysis, or reverse engineering)
  • Access to PCAP files, memory dumps, or sandbox reports from the analysis
  • MISP instance or STIX/TAXII server for structured IOC sharing
  • VirusTotal API key for IOC enrichment and validation
  • CyberChef for decoding obfuscated indicators

Workflow

Step 1: Extract File-Based IOCs

Compute hashes and identify file metadata indicators:

# Generate all standard hashes
md5sum malware_sample.exe
sha1sum malware_sample.exe
sha256sum malware_sample.exe

# Generate ssdeep fuzzy hash for similarity matching
ssdeep malware_sample.exe

# Generate imphash (import hash) for PE files
python3 -c "
import pefile
pe = pefile.PE('malware_sample.exe')
print(f'Imphash: {pe.get_imphash()}')
"

# Generate TLSH (Trend Micro Locality Sensitive Hash)
python3 -c "
import tlsh
with open('malware_sample.exe', 'rb') as f:
    h = tlsh.hash(f.read())
print(f'TLSH: {h}')
"

# Compile file metadata IOCs
python3 << 'PYEOF'
import pefile
import os
import hashlib
import datetime

pe = pefile.PE("malware_sample.exe")

print("FILE IOCs:")
with open("malware_sample.exe", "rb") as f:
    data = f.read()
    print(f"  MD5:        {hashlib.md5(data).hexdigest()}")
    print(f"  SHA-1:      {hashlib.sha1(data).hexdigest()}")
    print(f"  SHA-256:    {hashlib.sha256(data).hexdigest()}")
    print(f"  File Size:  {len(data)} bytes")

ts = pe.FILE_HEADER.TimeDateStamp
print(f"  Compile:    {datetime.datetime.utcfromtimestamp(ts)} UTC")
print(f"  Imphash:    {pe.get_imphash()}")
PYEOF

Step 2: Extract Network IOCs

Pull network indicators from strings, PCAP, and sandbox reports:

# Extract network IOCs from strings
import re

with open("malware_sample.exe", "rb") as f:
    data = f.read()

# Extract ASCII and Unicode strings
ascii_strings = re.findall(b'[ -~]{4,}', data)
unicode_strings = re.findall(b'(?:[ -~]\x00){4,}', data)

all_strings = [s.decode('ascii', errors='ignore') for s in ascii_strings]
all_strings += [s.decode('utf-16-le', errors='ignore') for s in unicode_strings]

# IP addresses (excluding private ranges for C2 indicators)
ip_pattern = re.compile(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')
ips = set()
for s in all_strings:
    for ip in ip_pattern.findall(s):
        # Filter out private/reserved ranges
        octets = [int(o) for o in ip.split('.')]
        if octets[0] not in [10, 127, 0] and not (octets[0] == 172 and 16 <= octets[1] <= 31) and not (octets[0] == 192 and octets[1] == 168):
            ips.add(ip)

# Domain names
domain_pattern = re.compile(r'\b[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z]{2,})+\b')
domains = set()
for s in all_strings:
    for d in domain_pattern.findall(s):
        if not d.endswith(('.dll', '.exe', '.sys', '.com.au')):
            domains.add(d)

# URLs
url_pattern = re.compile(r'https?://[^\s<>"{}|\\^`\[\]]+')
urls = set()
for s in all_strings:
    for u in url_pattern.findall(s):
        urls.add(u)

print("NETWORK IOCs:")
print(f"  IPs:     {ips}")
print(f"  Domains: {domains}")
print(f"  URLs:    {urls}")

Step 3: Extract Host-Based IOCs

Identify file paths, registry keys, mutexes, and services:

# Extract host-based IOCs from sandbox report
import json

with open("cuckoo_report.json") as f:
    report = json.load(f)

print("HOST IOCs:")

# File paths created or modified
print("\nFile Paths:")
for f in report["behavior"]["summary"].get("files", []):
    if any(p in f.lower() for p in ["temp", "appdata", "system32", "programdata"]):
        print(f"  [DROPPED] {f}")

# Registry keys for persistence
print("\nRegistry Keys:")

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

“Chỉ báo xâm phạm” (IOC) là gì?

Đó là các dấu hiệu số, như địa chỉ IP hoặc tên miền, cho thấy một hệ thống có thể đã bị xâm nhập hoặc bị mã độc lây nhiễm.

Tại sao cần “defang” IOC?

“Defang” nghĩa là chỉnh sửa IOC (như thêm dấu ngoặc vào địa chỉ IP) để chúng không vô tình được kích hoạt nếu ai đó bấm vào trong tài liệu hoặc email, nhờ đó tránh lây nhiễm.

Tôi có cần là chuyên gia bảo mật để dùng không?

Công cụ được thiết kế để đơn giản hóa việc trích xuất IOC. Tuy nhiên, hiểu bối cảnh phân tích mã độc sẽ giúp bạn diễn giải kết quả tốt hơn.

Chi tiết

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

Extracts indicators of compromise (IOCs) from malware samples, including file hashes, network indicators (IPs, domains, URLs, PCAP indicators), host artifacts (file paths, registry keys, mutexes), and behavioral patterns, using tools like CyberChef, then defangs and exports them in standard threat-intel formats. Use for IOC extraction, threat indicator harvesting, or building detection content fro

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#7933
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ự