mcpField
P
performing-brand-monitoring-for-impersonation

performing-brand-monitoring-for-impersonation

github.com/mukul975安全35.2k41 次安装8 周前更新
代码仓库

关于 performing-brand-monitoring-for-impersonation

面向需要监测品牌冒充的组织,介绍如何覆盖域名、社交媒体、应用等渠道。内容结合自动扫描、风险排序和下架请求准备。

主要功能

  1. 01扫描近似域名和抢注域名
  2. 02监测证书透明度日志
  3. 03检查社交媒体冒充账号
  4. 04发现仿冒移动应用
  5. 05依据风险指标排列发现项
  6. 06生成下架请求

适用场景

  1. 01查找仿冒企业品牌的钓鱼域名
  2. 02发现冒充高管的社交媒体账号
  3. 03识别应用商店中的仿冒应用
  4. 04为冒充网站准备滥用举报

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill performing-brand-monitoring-for-impersonation

安装后在 Claude Code 中输入/performing-brand-monitoring-for-impersonation确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

LICENSE
references/
api-reference.md
scripts/
agent.py

详细介绍

对仿冒行为进行品牌监控

概述

品牌仿冒攻击通过仿冒域名、虚假社交媒体资料、假冒移动应用以及模仿合法品牌的钓鱼网站来利用消费者信任。2025 年,品牌仿冒仍然是最昂贵的网络威胁之一,AI 生成的钓鱼邮件点击率高达 54%。本技能涵盖构建全面的品牌监控计划,利用自动化扫描和告警来检测域名抢注、社交媒体仿冒、虚假移动应用、未经授权的标识使用以及暗网中的品牌提及。

何时使用

  • 在开展涉及对仿冒行为进行品牌监控的安全评估时
  • 在针对相关安全事件遵循事件响应流程时
  • 在执行定期安全测试或审计活动时
  • 在通过动手测试验证安全控制措施时

前置条件

  • Python 3.9+ 以及 dnstwist、requests、beautifulsoup4、Levenshtein、tweepy 库
  • API 密钥:VirusTotal、Google Safe Browsing、Twitter/X API、Shodan
  • 品牌资产清单:域名、商标、标识、高管姓名
  • 证书透明度监控(Certstream 或 crt.sh)
  • 了解域名注册和 TLD 格局

关键概念

攻击面

品牌仿冒横跨多个渠道:域名抢注(错字抢注、同形异义字符、TLD 变体)、钓鱼网站(盗用品牌的克隆网站)、社交媒体(仿冒高管或公司的虚假资料)、移动应用(应用商店中的假冒应用)、电子邮件欺骗(显示名称和域名仿冒)以及暗网(论坛、市场中的品牌提及)。

检测方法

有效的品牌监控结合了主动扫描(使用 dnstwist 进行域名排列、CT 日志监控)、网络爬取(截图比对、标识检测)、社交媒体监控(资料名称匹配、帖子内容分析)、应用商店监控(名称和图标相似度检测)以及暗网监控(论坛抓取、市场跟踪)。

风险优先级排序

并非所有仿冒都是恶意的。风险因素包括:活跃的网页内容(尤其是登录页面)、存在 SSL 证书、配置了 MX 记录(具备接收电子邮件能力)、与合法网站的视觉相似度、近期注册日期,以及托管在与网络犯罪相关的地区。

工作流

步骤 1:多渠道品牌监控系统
import subprocess
import requests
import json
from datetime import datetime
from urllib.parse import urlparse
import Levenshtein

class BrandMonitor:
    def __init__(self, brand_config):
        self.brand_name = brand_config["name"]
        self.domains = brand_config["domains"]
        self.keywords = brand_config["keywords"]
        self.executive_names = brand_config.get("executives", [])
        self.logo_hash = brand_config.get("logo_hash", "")
        self.findings = []

    def scan_domain_squatting(self):
        """Detect typosquatting and lookalike domains."""
        all_results = []
        for domain in self.domains:
            cmd = ["dnstwist", "--registered", "--format", "json",
                   "--nameservers", "8.8.8.8", "--threads", "30", domain]
            try:
                result = subprocess.run(cmd, capture_output=True, text=True, timeout=300)
                if result.returncode == 0:
                    domains = json.loads(result.stdout)
                    registered = [d for d in domains if d.get("dns_a") or d.get("dns_aaaa")]
                    all_results.extend(registered)
                    print(f"[+] Domain squatting scan for {domain}: "
                          f"{len(registered)} registered lookalikes")
            except (subprocess.TimeoutExpired, Exception) as e:
                print(f"[-] Error scanning {domain}: {e}")

        for entry in all_results:
            self.findings.append({
                "type": "domain_squatting",
                "indicator": entry.get("domain", ""),
                "fuzzer": entry.get("fuzzer", ""),
                "dns_a": entry.get("dns_a", []),
                "ssdeep_score": entry.get("ssdeep_score", 0),
                "detected_at": datetime.now().isoformat(),
            })
        return all_results

    def check_google_safe_browsing(self, urls, api_key):
        """Check URLs against Google Safe Browsing API."""
        url = f"https://safebrowsing.googleapis.com/v4/threatMatches:find?key={api_key}"
        body = {
            "client": {"clientId": "brand-monitor", "clientVersion": "1.0"},
            "threatInfo": {
                "threatTypes": ["MALWARE", "SOCIAL_ENGINEERING", "UNWANTED_SOFTWARE"],
                "platformTypes": ["ANY_PLATFORM"],
                "threatEntryTypes": ["URL"],
                "threatEntries": [{"url": u} for u in urls],
            },
        }
        resp = requests.post(url, json=body, timeout=15)
        if resp.status_code == 200:
            matches = resp.json().get("matches", [])
            print(f"[+] Google Safe Browsing: {len(matches)} threats found")
            return matches
        return []

    def monitor_social_media_impersonation(self, platform="twitter"):
        """Detect social media profiles impersonating brand or executives."""
        suspicious_profiles = []
        # Search for profiles with similar names
        for name in self.executive_names + [self.brand_name]:
            # Using a general search approach
            search_url = f"https://api.twitter.com/2/users/by/username/{name.replace(' ', '')}"
            # Note: In production, use authenticated Twitter API
            suspicious_profiles.append({
                "search_term": name,
                "platform": platform,
                "note": "Requires authenticated API access for full search",
            })
        return suspicious_profiles

    def monitor_app_stores(self):
        """Check for fake mobile apps impersonating the brand."""
        fake_apps = []
        for keyword in self.keywords:
            # Google Play Store search (unofficial)
            url = f"https://play.google.com/store/search?q={keyword}&c=apps"
            try:
                resp = requests.get(url, timeout=15, headers={
                    "User-Agent": "Mozilla/5.0"
                })
                if resp.status_code == 200:
                    # Parse results for brand name matches
                    from bs4 import BeautifulSoup
                    soup = BeautifulSoup(resp.text, "html.parser")
                    app_links = soup.find_all("a", href=lambda h: h and "/store/apps/details" in h)
                    for link in app_links:
                        app_name = link.get_text(strip=True)
                        if any(k.lower() in app_name.lower() for k in self.keywords):
                            fake_apps.append({
                                "name": app_name,
                                "url": f"https://play.google.com{link['href']}",
                                "platform": "google_play",
                                "keyword": keyword,
                            })
            except Exception as e:
                print(f"[-] App store search error: {e}")
        return fake_apps

    def generate_monitoring_report(self):
        report = {
            "brand": self.brand_name,
            "generated": datetime.now().isoformat(),
            "total_findings": len(self.findings),
            "findings_by_type": {},
            "high_priority": [],
        }
        for finding in self.findings:
            ftype = finding["type"]
            if ftype not in report["findings_by_type"]:
                report["findings_by_type"][ftype] = 0
            report["findings_by_type"][ftype] += 1

            # High priority: has web similarity or MX records
            if finding.get("ssdeep_score", 0) > 50:
                report["high_priority"].append(finding)

        with open(f"brand_monitoring_{self.brand_name.lower()}.json", "w") as f:
            json.dump(report, f, indent=2)
        print(f"[+] Brand monitoring report: {len(self.findings)} findings")
        return report

monitor = BrandMonitor({
    "name": "MyCompany",
    "domains": ["mycompany.com", "mycompany.org"],
    "keywords": ["mycompany", "mybrand", "myproduct"],
    "executives": ["CEO Name", "CTO Name"],
})
monitor.scan_domain_squatting()
report = monitor.generate_monitoring_report()
步骤 2:下架请求生成
def generate_takedown_request(finding, brand_info):
    """Generate abuse report for domain/site takedown."""
    request = f"""Subject: Abuse Report - Brand Impersonation / Phishing

Dear Abuse Team,

We are writing to report a domain that is impersonating {brand_info['name']}
for apparent phishing/fraud purposes.

Infringing Domain: {finding.get('indicator', '')}
IP Address: {', '.join(finding.get('dns_a', ['Unknown']))}
Detection Method: {finding.get('fuzzer', 'domain similarity analysis')}
Web Similarity Score: {finding.get('ssdeep_score', 'N/A')}%
Detection Date: {finding.get('detected_at', '')}

Our legitimate domain(s): {', '.join(brand_info['domains'])}

This domain appears to be impersonating our brand through {finding.get('fuzzer', 'typosquatting')}.
We request immediate suspension of this domain.

Evidence of infringement is available upon request.

Regards,
{brand_info['name']} Security Team
"""
    return request

验证标准

  • 通过 dnstwist 排列扫描检测到域名抢注
  • Google Safe Browsing 检查识别出已知威胁
  • 证书透明度监控检测到新的钓鱼证书
  • 社交媒体监控识别出仿冒资料
  • 应用商店监控检测到假冒应用
  • 生成包含所需证据的下架请求

参考资料

评论

支持 Markdown