[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D68BVRNP9GCS61MYP50CH2":3,"skill-same:01M7D68BVRNP9GCS61MYP50CH2":112},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":73,"commitSha":74,"skillDirectory":75,"forksCount":76,"repositoryHtmlUrl":77,"repositoryHomepageUrl":6,"ownerHtmlUrl":78,"ownerBlogUrl":79,"ownerDescription":80,"updatedAt":81,"install":82,"resources":95},"01M7D68BVRNP9GCS61MYP50CH2","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.","SaiVatsal\u002FSkills-I-Use","SaiVatsal","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F242597752?v=4","01M7D5YM1T4VXW9203M0GFAHZ1","SaiVatsalPolimera","01M7D5YM2D61ST39XVR2V7B7ZJ",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",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":25,"author":34,"domain":35,"license":15,"version":36,"mitre_f3":37,"nist_csf":61,"subdomain":33,"description":7,"mitre_attack":66,"atlas_techniques":71},[26,27,28,29,30,31,32,33],"certificate-transparency","ct-logs","phishing","crt-sh","certstream","ssl","domain-monitoring","threat-intelligence","mahipal","cybersecurity","1.0",{"tactics":38,"version":42,"techniques":43},[39,40,41],"resource-development","reconnaissance","initial-access","1.1",[44,48,52,55,58],{"id":45,"name":46,"source":47,"tactic":39},"T1583.001","Acquire Infrastructure: Domains","attack",{"id":49,"name":50,"source":51,"tactic":39},"F1020.002","Create Fake Materials: Fake Website","f3",{"id":53,"name":54,"source":47,"tactic":40},"T1593","Search Open Websites\u002FDomains",{"id":56,"name":57,"source":47,"tactic":40},"T1598","Phishing for Information",{"id":59,"name":60,"source":47,"tactic":41},"T1660","Phishing",[62,63,64,65],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[45,67,68,69,70],"T1583.004","T1566.002","T1608.005","T1596.003",[72],"AML.T0052","main","8a3b3de73262a4c4db64523949360f3c599c2fb1","Anthropic-Cybersecurity-Skills-main\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing",0,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use","https:\u002F\u002Fgithub.com\u002FSaiVatsal","https:\u002F\u002Fsaivatsal.github.io\u002FPortfolio\u002F","The Longer It Takes The Stronger It Becomes ","2026-09-21 22:45:58",{"source":8,"skillName":5,"commands":83,"prompt":93,"zipAvailable":94},[84,87,90],{"tool":85,"command":86},"npx","npx skills add SaiVatsal\u002FSkills-I-Use --skill analyzing-certificate-transparency-for-phishing",{"tool":88,"command":89},"bunx","bunx skills add SaiVatsal\u002FSkills-I-Use --skill analyzing-certificate-transparency-for-phishing",{"tool":91,"command":92},"pnpm","pnpm dlx skills add SaiVatsal\u002FSkills-I-Use --skill analyzing-certificate-transparency-for-phishing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002FSKILL.md",true,[96,100,106],{"path":97,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":101,"resourceType":102,"resourceTypeDesc":103,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Fapi-reference.md","REFERENCE","参考文档",2850,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002Freferences\u002Fapi-reference.md",{"path":107,"resourceType":108,"resourceTypeDesc":109,"sizeBytes":110,"sourceHtmlUrl":111},"scripts\u002Fagent.py","SCRIPT","脚本",7465,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fanalyzing-certificate-transparency-for-phishing\u002Fscripts\u002Fagent.py",[113,121,129,138,145,152],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":117,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":20},"01M7DJZP6E6KMBQV4CZSDPZEZ8","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":125,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":20},"01M7DJZFTS5TS06K2TV3MDTE67","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":133,"licenseFileUrl":134,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":20},"01M7DJRK4SRQ908F2TJM6EZ7EV","ui-styling","Create beautiful, accessible user interfaces with shadcn\u002Fui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns, forms, tables), customizing themes and colors, implementing dark mode, generating visual designs and posters, or establishing consistent styling patterns across applications.","MIT","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fui-styling\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fui-styling\u002FSKILL.md",[],[],{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":133,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":20},"01M7DJR902059VEQP23PVM2WA0","design","Comprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social\u002Fads\u002Fweb\u002Fprint), icon design (15 styles, SVG, Gemini 3.1 Pro), social photos (HTML→screenshot, multi-platform). Actions: design logo, create CIP, generate mockups, build slides, design banner, generate icon, create social photos, social media images, brand identity, design system. Platforms: Facebook, Twitter, LinkedIn, YouTube, Instagram, Pinterest, TikTok, Threads, Google Ads.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fdesign\u002FSKILL.md",[],[],{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":133,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":20},"01M7DJR56QF5N6XYTCPCFHFMNP","design-system","Token architecture, component specifications, and slide generation. Three-layer tokens (primitive→semantic→component), CSS variables, spacing\u002Ftypography scales, component specs, strategic slide creation. Use for design tokens, systematic design, brand-compliant presentations.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fdesign-system\u002FSKILL.md",[],[],{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":133,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":20},"01M7DJQXB6M0SFF7NX8J5N01AH","banner-design","Design banners for social media, ads, website heroes, creative assets, and print. Multiple art direction options with AI-generated visuals. Actions: design, create, generate banner. Platforms: Facebook, Twitter\u002FX, LinkedIn, YouTube, Instagram, Google Display, website hero, print. Styles: minimalist, gradient, bold typography, photo-based, illustrated, geometric, retro, glassmorphism, 3D, neon, duotone, editorial, collage. Uses ui-ux-pro-max, frontend-design, ai-artist, ai-multimodal skills.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fbanner-design\u002FSKILL.md",[],[]]