[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ADM6QBG7HTA5XH47CWCV59":3,"skill-same:01M6ADM6QBG7HTA5XH47CWCV59":127},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":86,"commitSha":87,"skillDirectory":88,"forksCount":89,"repositoryHtmlUrl":90,"repositoryHomepageUrl":91,"ownerHtmlUrl":92,"ownerBlogUrl":93,"ownerDescription":94,"updatedAt":95,"install":96,"resources":109},"01M6ADM6QBG7HTA5XH47CWCV59","analyzing-certificate-transparency-for-phishing",null,"Monitor Certificate Transparency logs using crt.sh and Certstream to detect phishing domains, lookalike certificates, and unauthorized certificate issuance targeting your organization.","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",35884,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"analyzing certificate transparency for phishing","threat-intelligence","domain-monitoring","ssl","certstream","crt-sh","phishing","ct-logs","certificate-transparency","cybersecurity","monitoring","logs","website","search","create","development","monitor","infrastructure","2026-11-10 10:12:30",false,"---\nname: analyzing-certificate-transparency-for-phishing\ndescription: Monitor Certificate Transparency logs using crt.sh and Certstream to\n  detect phishing domains, lookalike certificates, and unauthorized certificate issuance\n  targeting your organization.\ndomain: cybersecurity\nsubdomain: threat-intelligence\ntags:\n- certificate-transparency\n- ct-logs\n- phishing\n- crt-sh\n- certstream\n- ssl\n- domain-monitoring\n- threat-intelligence\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\natlas_techniques:\n- AML.T0052\nnist_csf:\n- ID.RA-01\n- ID.RA-05\n- DE.CM-01\n- DE.AE-02\nmitre_attack:\n- T1583.001\n- T1583.004\n- T1566.002\n- T1608.005\n- T1596.003\nmitre_f3:\n  version: '1.1'\n  tactics:\n  - resource-development\n  - reconnaissance\n  - initial-access\n  techniques:\n  - id: T1583.001\n    name: 'Acquire Infrastructure: Domains'\n    tactic: resource-development\n    source: attack\n  - id: F1020.002\n    name: 'Create Fake Materials: Fake Website'\n    tactic: resource-development\n    source: f3\n  - id: T1593\n    name: Search Open Websites\u002FDomains\n    tactic: reconnaissance\n    source: attack\n  - id: T1598\n    name: Phishing for Information\n    tactic: reconnaissance\n    source: attack\n  - id: T1660\n    name: Phishing\n    tactic: initial-access\n    source: attack\n---\n# Analyzing Certificate Transparency for Phishing\n\n## Overview\n\nCertificate Transparency (CT) is an Internet security standard that creates a public, append-only log of all issued SSL\u002FTLS certificates. Monitoring CT logs enables early detection of phishing domains that register certificates mimicking legitimate brands, unauthorized certificate issuance for owned domains, and certificate-based attack infrastructure. This skill covers querying CT logs via crt.sh, real-time monitoring with Certstream, building automated alerting for suspicious certificates, and integrating findings into threat intelligence workflows.\n\n\n## When to Use\n\n- When investigating security incidents that require analyzing certificate transparency for phishing\n- When building detection rules or threat hunting queries for this domain\n- When SOC analysts need structured procedures for this analysis type\n- When validating security monitoring coverage for related attack techniques\n\n## Prerequisites\n\n- Python 3.9+ with `requests`, `certstream`, `tldextract`, `Levenshtein` libraries\n- Access to crt.sh (https:\u002F\u002Fcrt.sh\u002F) for historical CT log queries\n- Certstream (https:\u002F\u002Fcertstream.calidog.io\u002F) for real-time monitoring\n- List of organization domains and brand keywords to monitor\n- Understanding of SSL\u002FTLS certificate structure and issuance process\n\n## Key Concepts\n\n### Certificate Transparency Logs\n\nCT logs are cryptographically assured, publicly auditable, append-only records of TLS certificate issuance. Major CAs (Let's Encrypt, DigiCert, Sectigo, Google Trust Services) submit all issued certificates to multiple CT logs. As of 2025, Chrome and Safari require CT for all publicly trusted certificates.\n\n### Phishing Detection via CT\n\nAttackers register lookalike domains and obtain free certificates (often from Let's Encrypt) to make phishing sites appear legitimate with HTTPS. CT monitoring detects these early because the certificate appears in logs before the phishing campaign launches, providing a window for proactive blocking.\n\n### crt.sh Database\n\ncrt.sh is a free web interface and PostgreSQL database operated by Sectigo that indexes CT logs. It supports wildcard searches (`%.example.com`), direct SQL queries, and JSON API responses. It tracks certificate issuance, expiration, and revocation across all major CT logs.\n\n## Workflow\n\n### Step 1: Query crt.sh for Certificate History\n\n```python\nimport requests\nimport json\nfrom datetime import datetime\nimport tldextract\n\nclass CTLogMonitor:\n    CRT_SH_URL = \"https:\u002F\u002Fcrt.sh\"\n\n    def __init__(self, monitored_domains, brand_keywords):\n        self.monitored_domains = monitored_domains\n        self.brand_keywords = [k.lower() for k in brand_keywords]\n\n    def query_crt_sh(self, domain, include_expired=False):\n        \"\"\"Query crt.sh for certificates matching a domain.\"\"\"\n        params = {\n            \"q\": f\"%.{domain}\",\n            \"output\": \"json\",\n        }\n        if not include_expired:\n            params[\"exclude\"] = \"expired\"\n\n        resp = requests.get(self.CRT_SH_URL, params=params, timeout=30)\n        if resp.status_code == 200:\n            certs = resp.json()\n            print(f\"[+] crt.sh: {len(certs)} certificates for *.{domain}\")\n            return certs\n        return []\n\n    def find_suspicious_certs(self, domain):\n        \"\"\"Find certificates that may be phishing attempts.\"\"\"\n        certs = self.query_crt_sh(domain)\n        suspicious = []\n\n        for cert in certs:\n            common_name = cert.get(\"common_name\", \"\").lower()\n            name_value = cert.get(\"name_value\", \"\").lower()\n            issuer = cert.get(\"issuer_name\", \"\")\n            not_before = cert.get(\"not_before\", \"\")\n            not_after = cert.get(\"not_after\", \"\")\n\n            # Check for exact domain matches (legitimate)\n            extracted = tldextract.extract(common_name)\n            cert_domain = f\"{extracted.domain}.{extracted.suffix}\"\n            if cert_domain == domain:\n                continue  # Legitimate certificate\n\n            # Flag suspicious patterns\n            flags = []\n            if domain.replace(\".\", \"\") in common_name.replace(\".\", \"\"):\n                flags.append(\"contains target domain string\")\n            if any(kw in common_name for kw in self.brand_keywords):\n                flags.append(\"contains brand keyword\")\n            if \"let's encrypt\" in issuer.lower():\n                flags.append(\"free CA (Let's Encrypt)\")\n\n            if flags:\n                suspicious.append({\n                    \"common_name\": cert.get(\"common_name\", \"\"),\n                    \"name_value\": cert.get(\"name_value\", \"\"),\n                    \"issuer\": issuer,\n                    \"not_before\": not_before,\n                    \"not_after\": not_after,\n                    \"serial\": cert.get(\"serial_number\", \"\"),\n                    \"flags\": flags,\n                    \"crt_sh_id\": cert.get(\"id\", \"\"),\n                    \"crt_sh_url\": f\"https:\u002F\u002Fcrt.sh\u002F?id={cert.get('id', '')}\",\n                })\n\n        print(f\"[+] Found {len(suspicious)} suspicious certificates\")\n        return suspicious\n\nmonitor = CTLogMonitor(\n    monitored_domains=[\"mycompany.com\", \"mycompany.org\"],\n    brand_keywords=[\"mycompany\", \"mybrand\", \"myproduct\"],\n)\nsuspicious = monitor.find_suspicious_certs(\"mycompany.com\")\nfor cert in suspicious[:5]:\n    print(f\"  [{cert['common_name']}] Flags: {cert['flags']}\")\n```\n\n### Step 2: Real-Time Monitoring with Certstream\n\n```python\nimport certstream\nimport Levenshtein\nimport re\nfrom datetime import datetime\n\nclass CertstreamMonitor:\n    def __init__(self, watched_domains, brand_keywords, similarity_threshold=0.8):\n        self.watched_domains = [d.lower() for d in watched_domains]\n        self.brand_keywords = [k.lower() for k in brand_keywords]\n        self.threshold = similarity_threshold\n        self.alerts = []\n\n    def start_monitoring(self, max_alerts=100):\n        \"\"\"Start real-time CT log monitoring.\"\"\"\n        print(\"[*] Starting Certstream monitoring...\")\n        print(f\"    Watching: {self.watched_domains}\")\n        print(f\"    Keywords: {self.brand_keywords}\")\n\n        def callback(message, context):\n            if message[\"message_type\"] == \"certificate_update\":\n                data = message[\"data\"]\n                leaf = data.get(\"leaf_cert\", {})\n                all_domains = leaf.get(\"all_domains\", [])\n\n                for domain in all_domains:\n                    domain_lower = domain.lower().strip(\"*.\")\n                    if self._is_suspicious(domain_lower):\n                        alert = {\n                            \"domain\": domain,\n                            \"all_domains\": all_domains,\n                            \"issuer\": leaf.get(\"issuer\", {}).get(\"O\", \"\"),\n                            \"fingerprint\": leaf.get(\"fingerprint\", \"\"),\n                            \"not_before\": leaf.get(\"not_before\", \"\"),\n                            \"detected_at\": datetime.now().isoformat(),\n                            \"reason\": self._get_reason(domain_lower),\n                        }\n                        self.alerts.append(alert)\n                        print(f\"  [ALERT] {domain} - {alert['reason']}\")\n\n                        if len(self.alerts) >= max_alerts:\n                            raise KeyboardInterrupt\n\n        try:\n            certstream.listen_for_events(callback, url=\"wss:\u002F\u002Fcertstream.calidog.io\u002F\")\n        except KeyboardInterrupt:\n            print(f\"\\n[+] Monitoring stopped. {len(self.alerts)} alerts collected.\")\n        return self.alerts\n\n    def _is_suspicious(self, domain):\n        \"\"\"Check if domain is suspicious relative to watched domains.\"\"\"\n        for watched in self.watched_domains:\n            # Exact keyword match\n            watched_base = watched.split(\".\")[0]\n            if watched_base in domain and domain != watched:\n                return True\n\n            # Levenshtein distance (typosquatting detection)\n            domain_base = tldextract.extract(domain).domain\n            similarity = Levenshtein.ratio(watched_base, domain_base)\n            if similarity >= self.threshold and domain_base != watched_base:\n                return True\n\n        # Brand keyword match\n        for keyword in self.brand_keywords:\n            if keyword in domain:\n                return True\n\n        return False\n\n    def _get_reason(self, domain):\n        \"\"\"Determine why domain was flagged.\"\"\"\n        reasons = []\n        for watched in self.watched_domains:\n            watched_base = watched.split(\".\")[0]\n            if watched_base in domain:\n                reasons.append(f\"contains '{watched_base}'\")\n            domain_base = tldextract.extract(domain).domain\n            similarity = Levenshtein.ratio(watched_base, domain_base)\n            if similarity >= self.threshold and domain_base != watched_base:\n                reasons.append(f\"similar to '{watched}' ({similarity:.0%})\")\n        for kw in self.brand_keywords:\n            if kw in domain:\n                reasons.append(f\"brand keyword '{kw}'\")\n        return \"; \".join(reasons) if reasons else \"unknown\"\n\ncs_monitor = CertstreamMonitor(\n    watched_domains=[\"mycompany.com\"],\n    brand_keywords=[\"mycompany\", \"mybrand\"],\n    similarity_threshold=0.75,\n)\nalerts = cs_monitor.start_monitoring(max_alerts=50)\n```\n\n### Step 3: Enumerate Subdomains from CT Logs\n\n```python\ndef enumerate_subdomains_ct(domain):\n    \"\"\"Discover all subdomains from Certificate Transparency logs.\"\"\"\n    params = {\"q\": f\"%.{domain}\", \"output\": \"json\"}\n    resp = requests.get(\"https:\u002F\u002Fcrt.sh\", params=params, timeout=30)\n\n    if resp.status_code != 200:\n        return []\n\n    certs = resp.json()\n    subdomains = set()\n    for cert in certs:\n        name_value = cert.get(\"name_value\", \"\")\n        for name in name_value.split(\"\\n\"):\n            name = name.strip().lower()\n            if name.endswith(f\".{domain}\") or name == domain:\n                name = name.lstrip(\"*.\")\n                subdomains.add(name)\n\n    sorted_subs = sorted(subdomains)\n    print(f\"[+] CT subdomain enumeration for {domain}: {len(sorted_subs)} subdomains\")\n    return sorted_subs\n\nsubdomains = enumerate_subdomains_ct(\"example.com\")\nfor sub in subdomains[:20]:\n    print(f\"  {sub}\")\n```\n\n### Step 4: Generate CT Intelligence Report\n\n```python\ndef generate_ct_report(suspicious_certs, certstream_alerts, domain):\n    report = f\"\"\"# Certificate Transparency Intelligence Report\n## Target Domain: {domain}\n## Generated: {datetime.now().isoformat()}\n\n## Summary\n- Suspicious certificates found: {len(suspicious_certs)}\n- Real-time alerts triggered: {len(certstream_alerts)}\n\n## Suspicious Certificates (crt.sh)\n| Common Name | Issuer | Flags | crt.sh Link |\n|------------|--------|-------|-------------|\n\"\"\"\n    for cert in suspicious_certs[:20]:\n        flags = \"; \".join(cert.get(\"flags\", []))\n        report += (f\"| {cert['common_name']} | {cert['issuer'][:30]} \"\n                   f\"| {flags} | [View]({cert['crt_sh_url']}) |\\n\")\n\n    report += f\"\"\"\n## Real-Time Certstream Alerts\n| Domain | Issuer | Reason | Detected |\n|--------|--------|--------|----------|\n\"\"\"\n    for alert in certstream_alerts[:20]:\n        report += (f\"| {alert['domain']} | {alert['issuer']} \"\n                   f\"| {alert['reason']} | {alert['detected_at'][:19]} |\\n\")\n\n    report += \"\"\"\n## Recommendations\n1. Add flagged domains to DNS sinkhole \u002F web proxy blocklist\n2. Submit takedown requests for confirmed phishing domains\n3. Monitor CT logs continuously for new certificate registrations\n4. Implement CAA DNS records to restrict certificate issuance for your domains\n5. Deploy DMARC to prevent email spoofing from lookalike domains\n\"\"\"\n    with open(f\"ct_report_{domain.replace('.','_')}.md\", \"w\") as f:\n        f.write(report)\n    print(f\"[+] CT report saved\")\n    return report\n\ngenerate_ct_report(suspicious, alerts if 'alerts' in dir() else [], \"mycompany.com\")\n```\n\n## Validation Criteria\n\n- crt.sh queries return certificate data for target domains\n- Suspicious certificates identified based on lookalike patterns\n- Certstream real-time monitoring detects new phishing certificates\n- Subdomain enumeration produces comprehensive list from CT logs\n- Alerts generated with reason classification\n- CT intelligence report created with actionable recommendations\n\n## References\n\n- [crt.sh Certificate Search](https:\u002F\u002Fcrt.sh\u002F)\n- [Certstream Real-Time CT Monitor](https:\u002F\u002Fcertstream.calidog.io\u002F)\n- [River Security: CT Logs for Attack Surface Discovery](https:\u002F\u002Friversecurity.eu\u002Ffinding-attack-surface-and-fraudulent-domains-via-certificate-transparency-logs\u002F)\n- [Let's Encrypt: Certificate Transparency Logs](https:\u002F\u002Fletsencrypt.org\u002Fdocs\u002Fct-logs\u002F)\n- [SSLMate Cert Spotter](https:\u002F\u002Fsslmate.com\u002Fcertspotter\u002F)\n- [CyberSierra: CT Logs as Early Warning System](https:\u002F\u002Fcybersierra.co\u002Fblog\u002Fssl-certificate-transparency-logs\u002F)\n","# Analyzing Certificate Transparency for Phishing\n\n## Overview\n\nCertificate Transparency (CT) is an Internet security standard that creates a public, append-only log of all issued SSL\u002FTLS certificates. Monitoring CT logs enables early detection of phishing domains that register certificates mimicking legitimate brands, unauthorized certificate issuance for owned domains, and certificate-based attack infrastructure. This skill covers querying CT logs via crt.sh, real-time monitoring with Certstream, building automated alerting for suspicious certificates, and integrating findings into threat intelligence workflows.\n\n\n## When to Use\n\n- When investigating security incidents that require analyzing certificate transparency for phishing\n- When building detection rules or threat hunting queries for this domain\n- When SOC analysts need structured procedures for this analysis type\n- When validating security monitoring coverage for related attack techniques\n\n## Prerequisites\n\n- Python 3.9+ with `requests`, `certstream`, `tldextract`, `Levenshtein` libraries\n- Access to crt.sh (https:\u002F\u002Fcrt.sh\u002F) for historical CT log queries\n- Certstream (https:\u002F\u002Fcertstream.calidog.io\u002F) for real-time monitoring\n- List of organization domains and brand keywords to monitor\n- Understanding of SSL\u002FTLS certificate structure and issuance process\n\n## Key Concepts\n\n### Certificate Transparency Logs\n\nCT logs are cryptographically assured, publicly auditable, append-only records of TLS certificate issuance. Major CAs (Let's Encrypt, DigiCert, Sectigo, Google Trust Services) submit all issued certificates to multiple CT logs. As of 2025, Chrome and Safari require CT for all publicly trusted certificates.\n\n### Phishing Detection via CT\n\nAttackers register lookalike domains and obtain free certificates (often from Let's Encrypt) to make phishing sites appear legitimate with HTTPS. CT monitoring detects these early because the certificate appears in logs before the phishing campaign launches, providing a window for proactive blocking.\n\n### crt.sh Database\n\ncrt.sh is a free web interface and PostgreSQL database operated by Sectigo that indexes CT logs. It supports wildcard searches (`%.example.com`), direct SQL queries, and JSON API responses. It tracks certificate issuance, expiration, and revocation across all major CT logs.\n\n## Workflow\n\n### Step 1: Query crt.sh for Certificate History\n\n```python\nimport requests\nimport json\nfrom datetime import datetime\nimport tldextract\n\nclass CTLogMonitor:\n    CRT_SH_URL = \"https:\u002F\u002Fcrt.sh\"\n\n    def __init__(self, monitored_domains, brand_keywords):\n        self.monitored_domains = monitored_domains\n        self.brand_keywords = [k.lower() for k in brand_keywords]\n\n    def query_crt_sh(self, domain, include_expired=False):\n        \"\"\"Query crt.sh for certificates matching a domain.\"\"\"\n        params = {\n            \"q\": f\"%.{domain}\",\n            \"output\": \"json\",\n        }\n        if not include_expired:\n            params[\"exclude\"] = \"expired\"\n\n        resp = requests.get(self.CRT_SH_URL, params=params, timeout=30)\n        if resp.status_code == 200:\n            certs = resp.json()\n            print(f\"[+] crt.sh: {len(certs)} certificates for *.{domain}\")\n            return certs\n        return []\n\n    def find_suspicious_certs(self, domain):\n        \"\"\"Find certificates that may be phishing attempts.\"\"\"\n        certs = self.query_crt_sh(domain)\n        suspicious = []\n\n        for cert in certs:\n            common_name = cert.get(\"common_name\", \"\").lower()\n            name_value = cert.get(\"name_value\", \"\").lower()\n            issuer = cert.get(\"issuer_name\", \"\")\n            not_before = cert.get(\"not_before\", \"\")\n            not_after = cert.get(\"not_after\", \"\")\n\n            # Check for exact domain matches (legitimate)\n            extracted = tldextract.extract(common_name)\n            cert_domain = f\"{extracted.domain}.{extracted.suffix}\"\n            if cert_domain == domain:\n                continue  # Legitimate certificate\n\n            # Flag suspicious patterns\n            flags = []\n            if domain.replace(\".\", \"\") in common_name.replace(\".\", \"\"):\n                flags.append(\"contains target domain string\")\n            if any(kw in common_name for kw in self.brand_keywords):\n                flags.append(\"contains brand keyword\")\n            if \"let's encrypt\" in issuer.lower():\n                flags.append(\"free CA (Let's Encrypt)\")\n\n            if flags:\n                suspicious.append({\n                    \"common_name\": cert.get(\"common_name\", \"\"),\n                    \"name_value\": cert.get(\"name_value\", \"\"),\n                    \"issuer\": issuer,\n                    \"not_before\": not_before,\n                    \"not_after\": not_after,\n                    \"serial\": cert.get(\"serial_number\", \"\"),\n                    \"flags\": flags,\n                    \"crt_sh_id\": cert.get(\"id\", \"\"),\n                    \"crt_sh_url\": f\"https:\u002F\u002Fcrt.sh\u002F?id={cert.get('id', '')}\",\n                })\n\n        print(f\"[+] Found {len(suspicious)} suspicious certificates\")\n        return suspicious\n\nmonitor = CTLogMonitor(\n    monitored_domains=[\"mycompany.com\", \"mycompany.org\"],\n    brand_keywords=[\"mycompany\", \"mybrand\", \"myproduct\"],\n)\nsuspicious = monitor.find_suspicious_certs(\"mycompany.com\")\nfor cert in suspicious[:5]:\n    print(f\"  [{cert['common_name']}] Flags: {cert['flags']}\")\n```\n\n### Step 2: Real-Time Monitoring with Certstream\n\n```python\nimport certstream\nimport Levenshtein\nimport re\nfrom datetime import datetime\n\nclass CertstreamMonitor:\n    def __init__(self, watched_domains, brand_keywords, similarity_threshold=0.8):\n        self.watched_domains = [d.lower() for d in watched_domains]\n        self.brand_keywords = [k.lower() for k in brand_keywords]\n        self.threshold = similarity_threshold\n        self.alerts = []\n\n    def start_monitoring(self, max_alerts=100):\n        \"\"\"Start real-time CT log monitoring.\"\"\"\n        print(\"[*] Starting Certstream monitoring...\")\n        print(f\"    Watching: {self.watched_domains}\")\n        print(f\"    Keywords: {self.brand_keywords}\")\n\n        def callback(message, context):\n            if message[\"message_type\"] == \"certificate_update\":\n                data = message[\"data\"]\n                leaf = data.get(\"leaf_cert\", {})\n                all_domains = leaf.get(\"all_domains\", [])\n\n                for domain in all_domains:\n                    domain_lower = domain.lower().strip(\"*.\")\n                    if self._is_suspicious(domain_lower):\n                        alert = {\n                            \"domain\": domain,\n                            \"all_domains\": all_domains,\n                            \"issuer\": leaf.get(\"issuer\", {}).get(\"O\", \"\"),\n                            \"fingerprint\": leaf.get(\"fingerprint\", \"\"),\n                            \"not_before\": leaf.get(\"not_before\", \"\"),\n                            \"detected_at\": datetime.now().isoformat(),\n                            \"reason\": self._get_reason(domain_lower),\n                        }\n                        self.alerts.append(alert)\n                        print(f\"  [ALERT] {domain} - {alert['reason']}\")\n\n                        if len(self.alerts) >= max_alerts:\n                            raise KeyboardInterrupt\n\n        try:\n            certstream.listen_for_events(callback, url=\"wss:\u002F\u002Fcertstream.calidog.io\u002F\")\n        except KeyboardInterrupt:\n            print(f\"\\n[+] Monitoring stopped. {len(self.alerts)} alerts collected.\")\n        return self.alerts\n\n    def _is_suspicious(self, domain):\n        \"\"\"Check if domain is suspicious relative to watched domains.\"\"\"\n        for watched in self.watched_domains:\n            # Exact keyword match\n            watched_base = watched.split(\".\")[0]\n            if watched_base in domain and domain != watched:\n                return True\n\n            # Levenshtein distance (typosquatting detection)\n            domain_base = tldextract.extract(domain).domain\n            similarity = Levenshtein.ratio(watched_base, domain_base)\n            if similarity >= self.threshold and domain_base != watched_base:\n                return True\n\n        # Brand keyword match\n        for keyword in self.brand_keywords:\n            if keyword in domain:\n                return True\n\n        return False\n\n    def _get_reason(self, domain):\n        \"\"\"Determine why domain was flagged.\"\"\"\n        reasons = []\n        for watched in self.watched_domains:\n            watched_base = watched.split(\".\")[0]\n            if watched_base in domain:\n                reasons.append(f\"contains '{watched_base}'\")\n            domain_base = tldextract.extract(domain).domain\n            similarity = Levenshtein.ratio(watched_base, domain_base)\n            if similarity >= self.threshold and domain_base != watched_base:\n                reasons.append(f\"similar to '{watched}' ({similarity:.0%})\")\n        for kw in self.brand_keywords:\n            if kw in domain:\n                reasons.append(f\"brand keyword '{kw}'\")\n        return \"; \".join(reasons) if reasons else \"unknown\"\n\ncs_monitor = CertstreamMonitor(\n    watched_domains=[\"mycompany.com\"],\n    brand_keywords=[\"mycompany\", \"mybrand\"],\n    similarity_threshold=0.75,\n)\nalerts = cs_monitor.start_monitoring(max_alerts=50)\n```\n\n### Step 3: Enumerate Subdomains from CT Logs\n\n```python\ndef enumerate_subdomains_ct(domain):\n    \"\"\"Discover all subdomains from Certificate Transparency logs.\"\"\"\n    params = {\"q\": f\"%.{domain}\", \"output\": \"json\"}\n    resp = requests.get(\"https:\u002F\u002Fcrt.sh\", params=params, timeout=30)\n\n    if resp.status_code != 200:\n        return []\n\n    certs = resp.json()\n    subdomains = set()\n    for cert in certs:\n        name_value = cert.get(\"name_value\", \"\")\n        for name in name_value.split(\"\\n\"):\n            name = name.strip().lower()\n            if name.endswith(f\".{domain}\") or name == domain:\n                name = name.lstrip(\"*.\")\n                subdomains.add(name)\n\n    sorted_subs = sorted(subdomains)\n    print(f\"[+] CT subdomain enumeration for {domain}: {len(sorted_subs)} subdomains\")\n    return sorted_subs\n\nsubdomains = enumerate_subdomains_ct(\"example.com\")\nfor sub in subdomains[:20]:\n    print(f\"  {sub}\")\n```\n\n### Step 4: Generate CT Intelligence Report\n\n```python\ndef generate_ct_report(suspicious_certs, certstream_alerts, domain):\n    report = f\"\"\"# Certificate Transparency Intelligence Report\n## Target Domain: {domain}\n## Generated: {datetime.now().isoformat()}\n\n## Summary\n- Suspicious certificates found: {len(suspicious_certs)}\n- Real-time alerts triggered: {len(certstream_alerts)}\n\n## Suspicious Certificates (crt.sh)\n| Common Name | Issuer | Flags | crt.sh Link |\n|------------|--------|-------|-------------|\n\"\"\"\n    for cert in suspicious_certs[:20]:\n        flags = \"; \".join(cert.get(\"flags\", []))\n        report += (f\"| {cert['common_name']} | {cert['issuer'][:30]} \"\n                   f\"| {flags} | [View]({cert['crt_sh_url']}) |\\n\")\n\n    report += f\"\"\"\n## Real-Time Certstream Alerts\n| Domain | Issuer | Reason | Detected |\n|--------|--------|--------|----------|\n\"\"\"\n    for alert in certstream_alerts[:20]:\n        report += (f\"| {alert['domain']} | {alert['issuer']} \"\n                   f\"| {alert['reason']} | {alert['detected_at'][:19]} |\\n\")\n\n    report += \"\"\"\n## Recommendations\n1. Add flagged domains to DNS sinkhole \u002F web proxy blocklist\n2. Submit takedown requests for confirmed phishing domains\n3. Monitor CT logs continuously for new certificate registrations\n4. Implement CAA DNS records to restrict certificate issuance for your domains\n5. Deploy DMARC to prevent email spoofing from lookalike domains\n\"\"\"\n    with open(f\"ct_report_{domain.replace('.','_')}.md\", \"w\") as f:\n        f.write(report)\n    print(f\"[+] CT report saved\")\n    return report\n\ngenerate_ct_report(suspicious, alerts if 'alerts' in dir() else [], \"mycompany.com\")\n```\n\n## Validation Criteria\n\n- crt.sh queries return certificate data for target domains\n- Suspicious certificates identified based on lookalike patterns\n- Certstream real-time monitoring detects new phishing certificates\n- Subdomain enumeration produces comprehensive list from CT logs\n- Alerts generated with reason classification\n- CT intelligence report created with actionable recommendations\n\n## References\n\n- [crt.sh Certificate Search](https:\u002F\u002Fcrt.sh\u002F)\n- [Certstream Real-Time CT Monitor](https:\u002F\u002Fcertstream.calidog.io\u002F)\n- [River Security: CT Logs for Attack Surface Discovery](https:\u002F\u002Friversecurity.eu\u002Ffinding-attack-surface-and-fraudulent-domains-via-certificate-transparency-logs\u002F)\n- [Let's Encrypt: Certificate Transparency Logs](https:\u002F\u002Fletsencrypt.org\u002Fdocs\u002Fct-logs\u002F)\n- [SSLMate Cert Spotter](https:\u002F\u002Fsslmate.com\u002Fcertspotter\u002F)\n- [CyberSierra: CT Logs as Early Warning System](https:\u002F\u002Fcybersierra.co\u002Fblog\u002Fssl-certificate-transparency-logs\u002F)\n",{"name":5,"tags":47,"author":48,"domain":33,"license":15,"version":49,"mitre_f3":50,"nist_csf":74,"subdomain":25,"description":7,"mitre_attack":79,"atlas_techniques":84},[32,31,30,29,28,27,26,25],"mahipal","1.0",{"tactics":51,"version":55,"techniques":56},[52,53,54],"resource-development","reconnaissance","initial-access","1.1",[57,61,65,68,71],{"id":58,"name":59,"source":60,"tactic":52},"T1583.001","Acquire Infrastructure: Domains","attack",{"id":62,"name":63,"source":64,"tactic":52},"F1020.002","Create Fake Materials: Fake Website","f3",{"id":66,"name":67,"source":60,"tactic":53},"T1593","Search Open Websites\u002FDomains",{"id":69,"name":70,"source":60,"tactic":53},"T1598","Phishing for Information",{"id":72,"name":73,"source":60,"tactic":54},"T1660","Phishing",[75,76,77,78],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[58,80,81,82,83],"T1583.004","T1566.002","T1608.005","T1596.003",[85],"AML.T0052","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fanalyzing-certificate-transparency-for-phishing",4379,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":8,"skillName":5,"commands":97,"prompt":107,"zipAvailable":108},[98,101,104],{"tool":99,"command":100},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-certificate-transparency-for-phishing",{"tool":102,"command":103},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-certificate-transparency-for-phishing",{"tool":105,"command":106},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-certificate-transparency-for-phishing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002FSKILL.md",true,[110,115,121],{"path":111,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":113,"sourceHtmlUrl":114},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002FLICENSE",{"path":116,"resourceType":117,"resourceTypeDesc":118,"sizeBytes":119,"sourceHtmlUrl":120},"references\u002Fapi-reference.md","REFERENCE","参考文档",2850,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002Freferences\u002Fapi-reference.md",{"path":122,"resourceType":123,"resourceTypeDesc":124,"sizeBytes":125,"sourceHtmlUrl":126},"scripts\u002Fagent.py","SCRIPT","脚本",7465,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002Fscripts\u002Fagent.py",[128,155,179,206,231,258],{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":135,"publishedAt":42},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[134],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[136,137,138,139,140,33,141,142,143,144,145,146,147,148,149,150,151,152,153,154],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","security","incident response","identity","pr","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":162,"publishedAt":42},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[161],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[163,151,164,165,140,166,33,143,167,168,169,170,171,172,173,174,175,176,177,178],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":180,"name":181,"nameZh":6,"description":182,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":183,"categories":184,"keywords":189,"publishedAt":42},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[185,188],{"categoryNo":186,"categoryName":187,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[173,190,191,192,193,33,41,194,167,195,196,197,198,199,200,201,202,203,204,205],"backup","recovery","validating backup integrity for recovery","testing","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":207,"name":208,"nameZh":6,"description":209,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":210,"categories":211,"keywords":213,"publishedAt":42},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[212],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[214,215,216,33,217,218,35,219,220,221,222,223,224,225,226,227,170,228,229,230],"windows","kape","triaging windows with kape","registry","browser","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":232,"name":233,"nameZh":6,"description":234,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":235,"categories":236,"keywords":238,"publishedAt":42},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[237],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[239,240,241,33,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":259,"name":260,"nameZh":6,"description":261,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":262,"categories":263,"keywords":265,"publishedAt":42},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[264],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[140,266,33,267,268,269,270,271,272,273,274,201,275,202,276,277,278,279,280,281],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]