Certificate Transparency Logs

TLS (Transport Layer Security) and SSL (Secure Sockets Layer)

TLS (Transport Layer Security) and SSL (Secure Sockets Layer) are cryptographic protocols used to secure internet communication. They provide encryption and authentication to protect data transmitted between two parties, typically a client (e.g., a web browser) and a server (e.g., a web server).

  1. SSL (Secure Sockets Layer):

    • SSL was the original protocol developed by Netscape in the 1990s to secure web communications. It had several versions, including SSL 2.0 and SSL 3.0. SSL 3.0 was widely used but had security vulnerabilities that led to its deprecation.

  2. TLS (Transport Layer Security):

    • TLS was introduced as an improved version of SSL, addressing the vulnerabilities of SSL 3.0. TLS 1.0 was essentially SSL 3.1, and subsequent versions (TLS 1.1, TLS 1.2, TLS 1.3) brought further security enhancements, performance improvements, and support for modern cryptographic algorithms.

Scraping SSL Certificates for Attack Surface Analysis

Analyzing SSL certificates can provide valuable insights into an organization's attack surface. By identifying exposed subdomains, services, and certificates with weak configurations, security professionals can assess potential vulnerabilities and strengthen security measures. Here are tools, techniques, and commands to scrape SSL certificates:

Tools:

  1. certsh:

    • Cert.sh is a Certificate Transparency (CT) log search engine that can be used to discover SSL certificates associated with a domain.

    • Website: cert.sh

Techniques:

  1. Certificate Transparency Logs:

    • Certificate Transparency (CT) logs are publicly available records of SSL certificates issued by Certificate Authorities (CAs). You can search these logs for certificates associated with specific domains.

  2. Subdomain Enumeration:

    • Before scraping SSL certificates, perform subdomain enumeration using tools like Sublist3r, Subfinder, or Amass to compile a list of target subdomains.

Commands and Steps:

  1. Search for SSL Certificates:

    • Use the cert.sh website or API to search for SSL certificates associated with a specific domain or subdomain.

    Example using cert.sh API:

    curl -s "https://crt.sh/?q=example.com&output=json" | jq -r '.[].name_value' | sort -u
  2. Analyze Certificate Data:

    • Extract relevant information from the certificates, such as subject names, issuer names, and expiration dates.

  3. Identify Subdomains and Services:

    • Cross-reference the obtained certificates with your list of subdomains to identify which subdomains have SSL certificates associated with them.

  4. Check for Weak Configurations:

    • Analyze the certificates for weak configurations, including weak encryption algorithms, short key lengths, or expired certificates.

  5. Map Attack Surface:

    • Use the gathered information to map the organization's attack surface, identifying potential targets for further analysis, vulnerability scanning, or penetration testing.

Last updated