Dağıt:s DNS, HTTP, and AWS API key canary tokens across network infrastructure to tespit etmeunauthorized access and lateral movement. Integrates with webhook alerting (Slack, Teams, email, generic
Install to Claude Code
npx -y skills add MustafaKemal0146/fetih --skill implementing-canary-tokens-for-network-intrusion --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Implementing Canary Tokens For Network Intrusion?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/mustafakemal0146-implementing-canary-tokens-for-network-intrusion)More formats (shields.io, HTML) on the badges page.
---
name: implementing-canary-tokens-for-network-intrusion
description: Dağıt:s DNS, HTTP, and AWS API key canary tokens across network infrastructure to tespit etmeunauthorized 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 building yaparken deception-based network intrusion
Tespit with Canarytokens.org and Thinkst Canary platforms.
tags:
- soc-operations
- honeytokens
- security-operations
- intrusion-Tespit
- deception
- breach-Tespit
- canary-tokens
- network-security
- fetih
- cybersecurity
- siber-güvenlik
triggers:
- alert
- api
- canary
- cloud
- dns
- email
- endpoint
- http
- implementing
- intrusion
- log
- network
category: soc-operations
source_subdomain: security-operations
nist_csf:
- DE.CM-01
- RS.MA-01
- GV.OV-01
- DE.AE-02
adapted_for: fetih
---
# Implementing Canary Tokens for Network Intrusion
## Ne Zaman Kullanılır
- Dağıt:ing yaparken deception-based tripwires across network infrastructure to tespit etmeintrusions
- building yaparken early warning systems that alert on unauthorized Erişim: sensitive resources
- planting yaparken: fake AWS credentials, DNS beacons, or HTTP tokens to catch attackers during lateral movement
- integrating yaparken canary token alerts with SOC workflows via Slack, Microsoft Teams, or SIEM webhooks
- complementing yaparken: traditional IDS/IPS with zero-false-positive deception technology
## Ön Gereksinimler
- Python 3.8+ with `requests` library installed
- Network Erişim: 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 Erişim: target systems where tokens will be planted
- Appropriate authorization for all Dağıt:ment 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 Tespit, canary tokens tespit etmeattackers by their behavior (accessing bait resources) rather than matching known patterns.
### Token Types for Network Intrusion Tespit
| Token Type | Trigger Mechanism | Best Placement | Tespit 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
### Adım 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.
```python
import requests
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"]
```
Plant DNS tokens in locations attackers commonly Denetle::
- `/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
### Adım 2: Dağıt: HTTP Canary Tokens
HTTP tokens Şunu üret: unique URL that triggers on any HTTP request. They reveal the
source IP, User-Agent, and other HTTP headers of the requester.
```python
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"]
```
Placement strategies for HTTP tokens:
- Hidden `<img>` tags in internal wiki pages with sensitive titles
- URL shortener redirects in shared bookmark collections
- Links in internal documentation labeled "admin credentials" or "VPN configs"
- `.url` or `.webloc` shortcut files in network shares
- Browser bookmark exports in user profile backups
### Adım 3: Şunu oluştur:WS API Key Tokens
AWS key tokens are among the highest-fidelity canary tokens. They generate real-looking
AWS access keys that trigger an alert whenever anyone attempts to use them against any
AWS API endpoint.
```python
response = requests.post("https://canarytokens.org/generate", data={
"type": "aws_keys",
"email": "soc@company.com",
"memo": "DevOps jump box - /home/Dağıt:/.aws/credentials",
"webhook_url": "https://hooks.slack.com/services/T.../B.../xxx"
}, timeout=15)
aws_token = response.json()
access_key_id = aws_token["access_key_id"]
secret_access_key = aws_token["secret_access_key"]
```
Dağıt: the fake credentials:
```ini
[default]
aws_access_key_id = AKIAIOSFODNN7EXAMPLE
aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
region = us-east-1
```
### Adım 4: Configure Webhook Alert Integration
Kur: real-time alerting to your SOC through multiple channels:
```python
def send_slack_alert(webhook_url, alert_data):
"""Forward canary token alert to Slack channel."""
payload = {
"text": f":rotating_light: *Canary Token Triggered*",
"attachments": [{
"color": "#FF0000",
"fields": [
{"title": "Token Memo", "value": alert_data.get("memo", "Unknown"), "short": True},
{"title": "Source IP", "value": alert_data.get("src_ip", "Unknown"), "short": True},
{"title": "Token Type", "value": alert_data.get("channel", "Unknown"), "short": True},
{"title": "Triggered At", "value": alert_data.get("time", "Unknown"), "short": True},
],
"footer": "Canarytokens Alert System",
}]
}
requests.post(webhook_url, json=payload, timeout=10)
```
```python
from flask import Flask, request, jsonify
import json, logging
app = Flask(__name__)
logging.basicConfig(filename="/var/log/canary_alerts.json", level=logging.INFO)
@app.route("/canary-webhook", methods=["POST"])
def receive_alert():
alert = request.json or request.form.to_dict()
logging.info(json.dumps({
"event_type": "canarytoken_triggered",
"memo": alert.get("memo"),
"src_ip": alert.get("src_ip"),
"token_type": alert.get("channel"),
"time": alert.get("time"),
"manage_url": alert.get("manage_url"),
"additional_data": alert.get("additional_data", {}),
}))
return jsonify({"status": "received"}), 200
```
### Adım 5: Enterprise Dağıt:ment with Thinkst Canary API
For organizations using Thinkst Canary, leverage the API for mass Dağıt:ment and
centralized management:
```python
import canarytools
console = canarytools.Console(
domain="yourcompany",
api_key="your_api_auth_token"
)
token_types = {
"dns": "DNS beacon in config files",
"aws-id": "AWS credentials on jump servers",
"http": "Web bug in internal documentation",
"doc-msword": "Word document in finance share",
"slack-api": "Fake Slack bot token in source code",
}
for kind, memo in token_types.items():
result = console.tokens.create(memo=memo, kind=kind)
print(f"[+] Created {kind} token: {result}")
alerts = console.tokens.alerts()
for alert in alerts:
print(f"[ALERT] {alert.memo} triggered from {alert.src_ip}")
```
### Adım 6: Token Placement Strategy by Network Zone
**DMZ / Public-Facing:**
- HTTP tokens in admin panel login pages (hidden image tag)
- DNS tokens in web server configuration files
- AWS keys in `.env` files on staging servers
**Internal Network / Corporate:**
- DNS tokens in Active Directory Group Policy scripts
- AWS keys in developer workstation backup directories
- HTTP tokens in internal SharePoint/Confluence pages titled "Emergency Credentials"
- Word document tokens in network shares (`\\fileserver\IT\passwords.docx`)
**Production / Data Center:**
- DNS tokens in database configuration files
- AWS keys in CI/CD environment variables
- SQL Server tokens in connection strings on application servers
- SVN/Git tokens in repository configuration files
**Cloud Infrastructure:**
- AWS key tokens in S3 bucket policies (decoy)
- DNS tokens in CloudFormation/Terraform templates
- HTTP tokens in Lambda function environment variables
- Cloned-site tokens mimicking cloud admin consoles
## Örnekler
### Full Dağıt:ment Script
```python
python scripts/agent.py --action full_Dağıt: \
--email soc@company.com \
--webhook https://hooks.slack.com/services/T.../B.../xxx \
--output Dağıt:ment_report.json
```
### Monitor Triggered Tokens
```python
python scripts/agent.py --action monitor \
--console-domain yourcompany \
--api-key YOUR_AUTH_TOKEN
```
### Generate Token Inventory
```python
python scripts/agent.py --action inventory \
--output token_inventory.json
```
## Doğrulama Checklist
- [ ] DNS tokens resolve correctly and Şunu üret:lerts within 60 seconds
- [ ] HTTP tokens return a valid response and log source IP
- [ ] AWS key tokens trigger alerts when used with `aws sts get-caller-identity`
- [ ] Webhook alerts arrive in Slack/Teams/SIEM within acceptable latency
- [ ] Token memo fields contain sufficient context for SOC triage
- [ ] Dağıt:ment locations are documented in token inventory
- [ ] Alert escalation procedures are defined and tested
- [ ] Tokens do not interfere with legitimate operations
- [ ] Self-hosted Canarytokens instance (if used) is hardened and monitored
- [ ] Token rotation schedule is established (quarterly recommended)
## References
- Canarytokens Documentation: https://docs.canarytokens.org/guide/
- Thinkst Canary Platform: https://canary.tools/
- Thinkst Canary API: https://docs.canary.tools/canarytokens/actions.html
- Canarytokens Open Source: https://github.com/thinkst/canarytokens
- Zeltser Honeytoken Setup Guide: https://zeltser.com/honeytokens-canarytokens-setup/
- Grafana Canary Token Case Study: https://grafana.com/blog/2025/08/25/canary-tokens-learn-all-about-the-unsung-heroes-of-security-at-grafana-labs/
- AWS Infrastructure Canarytoken: https://blog.thinkst.com/2025/09/introducing-the-aws-infrastructure-canarytoken.html
<!--
⚔ Bu skill FETIH AI Agent icin gelistirilmistir — https://github.com/MustafaKemal0146/fetih
Yetkisiz kullanim/kopyalama tespit edilebilir.
hash: 62f1827792aa7586
-->
Scanned 9/8/2026
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!