跳到主要内容
知仓学习社ZHICANG

implementing-honeytokens-for-breach-detection

Deploys canary tokens and honeytokens (fake AWS credentials, DNS canaries,

读凭据联网写文件严重 5 · 高危 2mukul975/Anthropic-Cybersecurity-Skills

它会碰到什么

扫了多少4 个文本文件,22 KB
它会碰到什么读凭据联网写文件
命中总数20 处
命中统计严重 5 · 高 2 · 中 6 · 低 3
逐条看命中(7 条严重或高危)
  • 严重 references/api-reference.md:26cred-paths
    | AWS keys | `~/.aws/credentials` | Key used in API call |
  • 严重 scripts/agent.py:134cred-paths
    {"type": "aws_credentials", "location": "/opt/backup/.aws/credentials",
  • 严重 scripts/agent.py:142cred-paths
    {"type": "dns", "location": "/root/.ssh/config",
  • 严重 SKILL.md:70cred-paths
    1. AWS credential files (~/.aws/credentials) with canary keys
  • 严重 SKILL.md:81cred-paths
    with open("/opt/backup/.aws/credentials", "w") as f:
  • scripts/agent.py:169cred-envread
    parser.add_argument("--email", default=os.getenv("CANARY_EMAIL", "soc@company.com"))
  • scripts/agent.py:170cred-envread
    parser.add_argument("--webhook", default=os.getenv("CANARY_WEBHOOK"))

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Implementing Honeytokens for Breach Detection

When to Use

  • When deploying or configuring implementing honeytokens for breach detection 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

  • Familiarity with security operations concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Instructions

Deploy honeytokens across critical systems to detect unauthorized access. Each token

type alerts via webhook when triggered by an attacker.

import requests

# Create a DNS canary token via Canarytokens
resp = requests.post("https://canarytokens.org/generate", data={
    "type": "dns",
    "email": "soc@company.com",
    "memo": "Production DB server honeytoken",
})
token = resp.json()
print(f"DNS token: {token['hostname']}")

Token types to deploy:

  1. AWS credential files (~/.aws/credentials) with canary keys
  2. DNS tokens embedded in configuration files
  3. Document beacons (Word/PDF) in sensitive file shares
  4. Database honeytoken records in user tables
  5. Web bugs in internal wiki/documentation pages

Examples

# Generate a fake AWS credentials file with canary token
aws_creds = f"[default]\naws_access_key_id = {canary_key_id}\naws_secret_access_key = {canary_secret}\n"
with open("/opt/backup/.aws/credentials", "w") as f:
    f.write(aws_creds)

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。