Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)35k · #8008

implementing-canary-tokens-for-network-intrusion

Skill này làm gì

Công cụ này tạo ra các “báo động kỹ thuật số” gọi là “canary tokens”. Nếu ai đó cố truy cập một trong số này, bạn sẽ được thông báo ngay lập tức. Đây là cách để biết liệu có người không được phép đang cố xâm nhập hệ thống của bạn hay không.

Khi nào nên dùng

  • ✓Khi bạn muốn biết ai đó có đang cố truy cập tệp hoặc hệ thống mà họ không được phép không.
  • ✓Để tạo hệ thống cảnh báo sớm chống truy cập trái phép.
  • ✓Để bắt kẻ xâm nhập khi chúng di chuyển từ hệ thống này sang hệ thống khác trong mạng.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-canary-tokens-for-network-intrusion/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/implementing-canary-tokens-for-network-intrusion/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

“Tạo một báo động kỹ thuật số để thông báo khi ai đó cố đọc tệp cấu hình cơ sở dữ liệu production.”

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

Cách hoạt động

Công cụ tạo các liên kết hoặc mã đặc biệt (token). Bạn đặt các token này ở những vị trí nhạy cảm. Nếu ai đó nhấp hoặc sử dụng một trong các token này, bạn sẽ nhận được cảnh báo.

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.

Implementing Canary Tokens for Network Intrusion Detection

When to Use

  • When deploying deception-based tripwires across network infrastructure to detect intrusions
  • When building early warning systems that alert on unauthorized access to sensitive resources
  • When planting fake AWS credentials, DNS beacons, or HTTP tokens to catch attackers during lateral movement
  • When integrating canary token alerts with SOC workflows via Slack, Microsoft Teams, or SIEM webhooks
  • When complementing traditional IDS/IPS with zero-false-positive deception technology

Prerequisites

  • Python 3.8+ with requests library installed
  • Network access to canarytokens.org API (or self-hosted Canarytokens instance)
  • Webhook endpoint for alert delivery (Slack, Teams, email, or generic HTTP)
  • For Thinkst Canary enterprise: valid console domain and API auth token
  • Administrative access to target systems where tokens will be planted
  • Appropriate authorization for all deployment activities

Core Concepts

What Are Canary Tokens?

Canary tokens are digital tripwires -- resources that should never be accessed during normal operations. When an attacker interacts with a canary token, it immediately triggers an alert with near-zero false positives. Unlike signature-based detection, canary tokens detect attackers by their behavior (accessing bait resources) rather than matching known patterns.

Token Types for Network Intrusion Detection

Token Type Trigger Mechanism Best Placement Detection Scenario
DNS Token DNS resolution of FQDN Config files, scripts, internal docs Attacker reads configs during recon
HTTP Token HTTP GET to unique URL Internal wikis, bookmark files, HTML Attacker browses internal resources
AWS API Key AWS API call with fake creds .aws/credentials, env files, repos Attacker tests found credentials
Cloned Site Visit to cloned page Internal portals, admin panels Attacker accesses cloned services
SVN Token SVN checkout Repository configs Attacker clones repositories
SQL Server Database login attempt Connection strings, config files Attacker attempts DB access

Alert Flow Architecture

[Attacker Action] --> [Token Triggered] --> [Canarytokens Server]
                                                    |
                                            [Webhook POST]
                                                    |
                          +-------------------------+-------------------------+
                          |                         |                         |
                    [Slack Alert]           [Email Alert]             [SIEM Ingestion]
                          |                         |                         |
                    [SOC Analyst]           [On-Call Page]           [Correlation Rule]

Instructions

Step 1: Generate DNS Canary Tokens

DNS tokens are the most versatile -- they trigger on any DNS resolution, even from air-gapped networks with only DNS egress. The token is an FQDN that, when resolved, alerts the token owner.

import requests

# Create DNS canary token via Canarytokens.org
response = requests.post("https://canarytokens.org/generate", data={
    "type": "dns",
    "email": "soc@company.com",
    "memo": "Production database server - /etc/app/db.conf",
    "webhook_url": "https://hooks.slack.com/services/T.../B.../xxx"
}, timeout=15)

token_data = response.json()
dns_hostname = token_data["hostname"]
# Example: abc123def456.canarytokens.com

Plant DNS tokens in locations attackers commonly inspect:

  • /etc/hosts entries pointing to the canary FQDN
  • Application configuration files (database_host, backup_server)
  • SSH config files (~/.ssh/config) with canary hostnames
  • Internal DNS zone files as decoy A records
  • CI/CD pipeline environment variables

Step 2: Deploy HTTP Canary Tokens

HTTP tokens generate a unique URL that triggers on any HTTP request. They reveal the source IP, User-Agent, and other HTTP headers of the requester.

# Create HTTP token
response = requests.post("https://canarytokens.org/generate", data={
    "type": "http",
    "email": "soc@company.com",
    "memo": "Internal wiki - IT admin passwords page",
    "webhook_url": "https://hooks.slack.com/services/T.../B.../xxx"
}, timeout=15)

http_url = response.json()["url"]

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

“Canary tokens” là gì?

Đó giống như các dây cảnh báo kỹ thuật số. Chúng là tài nguyên không nên bị truy cập trong hoạt động bình thường, nên nếu có ai truy cập thì đó là tín hiệu cảnh báo.

Vì sao dùng “canary tokens” thay vì phần mềm diệt virus?

Phần mềm diệt virus tìm các mối đe dọa đã biết. Canary tokens phát hiện mọi truy cập trái phép, kể cả thứ mới và chưa biết, vì chúng dựa trên hành vi của người truy cập.

Có những loại “token” nào?

Có các token kích hoạt khi ai đó cố phân giải một địa chỉ internet (DNS), truy cập một liên kết (HTTP), sử dụng thông tin xác thực AWS giả (AWS API Key), và các loại khác.

Chi tiết

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

Deploys DNS, HTTP, and AWS API key canary tokens across network infrastructure to detect unauthorized access and lateral movement. Integrates with webhook alerting (Slack, Teams, email, generic HTTP) for real-time intrusion notifications. Provides automated token generation, placement strategies, and monitoring for enterprise network environments. Use when building deception-based network intrusio

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

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