implementing-canary-tokens-for-network-intrusion
यह क्या करती है
यह टूल 'डिजिटल अलार्म' बनाता है, जिन्हें 'canary tokens' कहते हैं। अगर कोई इनमें से किसी अलार्म को एक्सेस करने की कोशिश करता है, तो आपको तुरंत सूचना मिल जाती है। इससे पता चलता है कि कोई अनधिकृत व्यक्ति आपके सिस्टम में घुसने की कोशिश तो नहीं कर रहा।
कब इस्तेमाल करें
- ✓जब आप जानना चाहते हैं कि कोई ऐसी फाइलों या सिस्टम तक पहुंचने की कोशिश तो नहीं कर रहा जहां उसे नहीं जाना चाहिए।
- ✓अनधिकृत एक्सेस के खिलाफ जल्दी चेतावनी देने वाला सिस्टम बनाने के लिए।
- ✓नेटवर्क में एक सिस्टम से दूसरे सिस्टम तक जाते हुए घुसपैठियों को पकड़ने के लिए।
Skill का लिंक
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-canary-tokens-for-network-intrusion/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“प्रोडक्शन डेटाबेस की कॉन्फ़िगरेशन फाइल कोई पढ़ने की कोशिश करे, तो उसके लिए एक डिजिटल अलार्म बनाओ।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह टूल खास लिंक या कोड बनाता है, जिन्हें tokens कहते हैं। आप इन tokens को संवेदनशील जगहों पर रख देते हैं। अगर कोई इनमें से किसी token पर क्लिक करता है या उसका इस्तेमाल करता है, तो आपको अलर्ट भेज दिया जाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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
requestslibrary 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/hostsentries 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"]
…
अक्सर पूछे जाने वाले सवाल
'canary tokens' क्या होते हैं?
ये डिजिटल ट्रिपवायर की तरह हैं। ये ऐसे संसाधन होते हैं जिन्हें सामान्य काम के दौरान कोई नहीं छूता। अगर कोई इन्हें एक्सेस करता है, तो यह खतरे का संकेत होता है।
antivirus की जगह 'canary tokens' क्यों इस्तेमाल करें?
Antivirus पहचानी हुई धमकियों को ढूंढता है। Canary tokens किसी भी अनधिकृत एक्सेस का पता लगा लेते हैं, भले ही वह नया या अनजाना हो, क्योंकि ये एक्सेस करने वाले व्यक्ति के व्यवहार पर आधारित हैं।
tokens के कौन-कौन से प्रकार होते हैं?
कुछ tokens तब ट्रिगर होते हैं जब कोई इंटरनेट एड्रेस (DNS) हल करने की कोशिश करता है, कुछ जब कोई link (HTTP) खोलता है, और कुछ जब कोई नकली cloud credentials (AWS API Key) इस्तेमाल करता है। इसके अलावा और भी प्रकार हैं।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 35k
- रैंकिंग में स्थान
- #8008
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 31/8/2026
कमेंट
- …
इस repository की और skills
abusing-dpapi-for-credential-access
35kआपके AI एजेंट को किसी खास काम के लिए तैयार instructions देता है, ताकि वह उसे बेहतर और तेज़ी से कर सके।
abusing-shadow-credentials-for-privesc
35kआपके AI एजेंट को साफ़ और अच्छी तरह से व्यवस्थित लिखना सिखाता है।
achieving-cmmc-level-2-compliance
35kयह आपके एजेंट को CMMC Level 2 compliance के लिए environment तैयार करने में मदद करता है। यह security requirements लागू करता है और ज़रूरी documentation संभालता है।
acquiring-disk-image-with-dd-and-dcfldd
35kआपके एजेंट को hard drives की exact copies बनाने में मदद करता है। जाँच के दौरान किसी भी जानकारी के खोने या बदलने से बचाने के लिए यह उपयोगी है।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।