[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6HBP58B79NMD9WHCX3R362V":3,"skill-same:01M6HBP58B79NMD9WHCX3R362V":100},{"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":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":61,"commitSha":62,"skillDirectory":63,"forksCount":64,"repositoryHtmlUrl":65,"repositoryHomepageUrl":6,"ownerHtmlUrl":66,"ownerBlogUrl":6,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6HBP58B79NMD9WHCX3R362V","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.","HenriqueMC17\u002Fagente-core","HenriqueMC17","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F206460478?v=4","01M6HB63HBBF18AC4H09XTB549","Henrique Monteiro Cardoso","01M6HB63NGSQXWKWCFWW2B20W0",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fanalyzing-certificate-transparency-for-phishing\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"analyzing","for","transparency","certificate","analyzing certificate transparency for phishing","phishing","crt-sh","certstream","ssl","domain-monitoring","cybersecurity","t1566","ct-logs","aml","cm","domain","certificate-transparency","domains","targeting","monitor","2026-11-10 10:12:30",false,"---\nname: analyzing-certificate-transparency-for-phishing\ndescription: Monitor Certificate Transparency logs using crt.sh and Certstream to detect phishing domains, lookalike certificates, and unauthorized certificate issuance 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\ncategory: analyzing-certificate-transparency-for-phishing\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":44,"author":46,"domain":29,"license":15,"version":47,"category":5,"nist_csf":48,"subdomain":45,"description":7,"mitre_attack":53,"atlas_techniques":59},[35,31,24,25,26,27,28,45],"threat-intelligence","mahipal","1.0",[49,50,51,52],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[54,55,56,57,58],"T1583.001","T1583.004","T1566.002","T1608.005","T1596.003",[60],"AML.T0052","main","5eea5b3296f4673b5f481e8bcc1ba76281149f16","modules\u002Fanalyzing-certificate-transparency-for-phishing",0,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core","https:\u002F\u002Fgithub.com\u002FHenriqueMC17","Qualquer tecnologia suficientemente avançada é indistinguível da mágica.","2026-09-28 22:40:38",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add HenriqueMC17\u002Fagente-core --skill analyzing-certificate-transparency-for-phishing",{"tool":75,"command":76},"bunx","bunx skills add HenriqueMC17\u002Fagente-core --skill analyzing-certificate-transparency-for-phishing",{"tool":78,"command":79},"pnpm","pnpm dlx skills add HenriqueMC17\u002Fagente-core --skill analyzing-certificate-transparency-for-phishing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fanalyzing-certificate-transparency-for-phishing\u002FSKILL.md",true,[83,88,94],{"path":84,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fanalyzing-certificate-transparency-for-phishing\u002FLICENSE",{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fapi-reference.md","REFERENCE","参考文档",2850,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fanalyzing-certificate-transparency-for-phishing\u002Freferences\u002Fapi-reference.md",{"path":95,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":98,"sourceHtmlUrl":99},"scripts\u002Fagent.py","SCRIPT","脚本",7465,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fanalyzing-certificate-transparency-for-phishing\u002Fscripts\u002Fagent.py",[101,126,152,175,191,210],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":39},"01M6HPFF0RCN0X6WT5EBSV71GY","validating-backup-integrity-for-recovery","Validate backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to ensure backups are reliable for disaster recovery and ransomware response scenarios.","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[],[108,109,110,111,20,112,29,113,114,115,116,117,118,119,120,121,122,123,124,125],"integrity","backup","recovery","validating backup integrity for recovery","testing","validate","verification","hash-verification","incident-response","ransomware","detection","t1078","t1490","disaster-recovery","restore","incident","disaster recovery","ransomware response",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":39},"01M6HPFAWJVFK25Q33K3T7WQ8G","triaging-vulnerabilities-with-ssvc-framework","Triage and prioritize vulnerabilities using CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree framework to produce actionable remediation priorities.","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[],[133,134,135,136,137,29,138,139,140,141,142,143,144,145,146,147,148,149,150,151],"vulnerabilities","framework","ssvc","triaging vulnerabilities with ssvc framework","with","triage and prioritize","CISA","vulnerability-management","risk-management","cvss","remediation","vulnerability","prioritization","decision-tree","prioritize","decision","priorities","actionable","tree",{"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":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":39},"01M6HPF6JS9X72WP59094H3ASQ","triaging-security-incident","Performs initial triage of security incidents to determine severity, scope, and required response actions using the NIST SP 800-61r3 and SANS PICERL frameworks. Classifies incidents by type, assigns priority based on business impact, and routes...","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-security-incident\u002FSKILL.md",[],[159,160,123,29,161,162,163,119,120,164,165,166,167,168,169,170,171,172,173,174],"security","triaging security incident","actions","soc","NIST","analysis","severity-classification","incident-triage","SANS-PICERL","SOC-operations","picerl","conversion","isolation","scope","impact","consistency",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":39},"01M6HPF2EX6ZYNYYHKBRJN7GEF","triaging-security-incident-with-ir-playbook","Classify and prioritize security incidents using structured IR playbooks to determine severity, assign response teams, and initiate appropriate response procedures.","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-security-incident-with-ir-playbook\u002FSKILL.md",[],[159,182,183,160,123,137,29,184,162,116,185,186,119,120,187,165,147,188,189,190],"playbook","triaging security incident with ir playbook","teams","IR-playbook","severity","classification","classify","incidents","initiate",{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":195,"categories":196,"keywords":197,"publishedAt":39},"01M6HPEY9XPGE7X95AG4XJFQAW","triaging-security-alerts-in-splunk","Triages security alerts in Splunk Enterprise Security by classifying severity, investigating notable events, correlating related telemetry, and making escalation or closure decisions using SPL queries and the Incident Review dashboard. Use when...","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-security-alerts-in-splunk\u002FSKILL.md",[],[159,198,199,200,201,202,29,203,204,205,162,206,119,30,207,208,168,33,123,209],"security alerts","splunk","triaging security alerts in splunk","alerts","review","siem","dashboard","search","correlation-search","notable-events","incident-review","de",{"skillNo":211,"name":212,"nameZh":6,"description":213,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":214,"categories":215,"keywords":216,"publishedAt":39},"01M6HPET6XGEPEJPN7V032JGZ0","tracking-threat-actor-infrastructure","Threat actor infrastructure tracking involves monitoring and mapping adversary-controlled assets including command-and-control (C2) servers, phishing domains, exploit kit hosts, bulletproof hosting, a","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftracking-threat-actor-infrastructure\u002FSKILL.md",[],[217,218,219,220,29,221,222,223,45,224,225,30,226,227,33,228,209,36,229,230],"infrastructure","tracking threat actor infrastructure","tracking","threat","monitoring","mitre-attack","threat-actor","command-and-control","dns","command","exploit","intelligence","kit","hosts"]