In this lesson,
we'll discuss the topic of cryptographic flaws,
focusing specifically on issues related
to digital certificates and SSL/TLS communications.
These certificates are important
for secure data exchanges on the web,
and their integrity is vital for maintaining the trust
and security in online transactions.
Now, let's look at digital certificates.
Digital certificates authenticate the identity
of web servers and facilitate the secure exchange
of cryptographic key.
However, flaws in these certificates or their management
can lead to significant security vulnerabilities.
For instance, expired certificates
can make a site vulnerable to a man-in-the-middle attack
or on-path attack as it's now called,
as attackers can easily impersonate the web server
using a fake certificate.
Improperly issued certificates,
such as those mistakenly issued to the wrong entity
can allow attackers to impersonate legitimate websites.
This happened in 2013 when Symantec accidentally issued
Google's certificate to a unauthorized third party.
Certificates are susceptible to cryptographic attacks
due to weak algorithms as well, like SHA-1 algorithm.
The SHA-1 algorithm was deprecated due to vulnerabilities
and collision attacks which enable attackers
to create fraudulent certificates
and bypass security controls.
Certificates with outdated security standards
or improperly configured settings can expose communications
to interception or manipulation.
For instance, an improperly configured certificate
might include an overly broad trust chain,
granting unnecessary trust
to an intermediate Certificate Authority (CA).
In 2019, a misconfigured intermediate CA
in Apple's macOS trust store allowed certificates
signed by the CA to be trusted by the operating system,
despite not being properly vetted.
This misconfiguration could have able attackers
to issue fraudulent certificates,
potentially intercepting
or manipulating secure communications.
Digital certificates contain several useful fields
that should be looked at during a penetration test.
For example, the Common Name (CN),
and the Subject Alternative Names (SANs) fields
identify the domain names
that the certificate is authorized to secure.
SANs list specific subdomains
covered under a single certificate,
which can provide insights into the network structure
of the organization.
Another field penetration testers can look at
is the Validity Period.
Certificates are valid for a specific period.
Out-of-date certificates might indicate an oversight
in security practices from the access administration team,
often pinpointing to broader administrative issues.
The Signature Algorithm field
should also be closely inspected.
Algorithm used for signing the certificate
can indicate its robustness.
Algorithms like sha256WithRSAEncryption
are currently considered secure,
whereas older ones like md5WithRSAEncryption are not.
Tools like OpenSSL or online SSL checkers
can be used to gather detailed certificate information.
Now, these tools can validate the certificate chain,
check for known vulnerabilities,
and assess the certificate's compliance
with current best practices.
For example, by using the online SSL checker
on the domain such as diontraining.com,
you might find the certificate with the following:
first, we have the Common Name
with the *.diontraining.com,
meaning any subdomain of diontraining.com will be covered.
Next, we have the SANs,
which is again the Subject Alternative Name
with the *.diontraining.com again
and diontraining.com, which just simply means
that any subdomain of diontraining.com
and diontraining.com itself are the alternative names.
Next, we see the certificate is valid from March 31st, 2024
to April 30th, 2025.
Next, we see the Signature Algorithm
which is sha256WithRSAEncryption
which we've identified as being good.
And the last portion we'll look at is the issuer
which is Amazon.
This information can indicate whether the domain is secured
with a broadly trusted CA
and whether the certificate covers all necessary subdomains.
Another topic we need to discuss
is Certificate Transparency, also known as CT.
Certificate Transparency is a framework
introduced by Google.
It helps in detecting mistakenly
or maliciously issues certificates
by providing publicly auditable logs of issued certificates.
CT maintains a tamper-evident, append-only log
of publicly trusted certificates.
By requiring certificate authorities
to submit certificates to these logs before issuance,
CT enables website owners,
browsers, and the general public to monitor
and audit the issuance process.
This type of transparency makes it easier
to spot certificates that may have been mistakenly issued
to the wrong domain or maliciously issued to a fake company.
For instance, in 2017,
a security researcher discovered
that the Egyptian government had issued
rogue SSL certificates to conduct mass surveillance.
Certificate Transparency logs helped in the quick detection
and revocation of these certificates.
Lastly, we need to quickly discuss the mechanisms
that are available for certificate revocation.
Revocation of mechanisms
like the Online Certificate Status Protocol (OCSP)
and the Certificate Revocation Lists (CRL)
are used for checking if a certificate has been revoked
due to compromise or other issues.
To improve performance, the OCSP stapling is typically used.
OCSP stapling is a performance optimization technique
that shifts the burden of certificate validation
from a client to the server.
Instead of the client directly querying the OCSP server
to verify the certificate's validity,
the web server takes on this responsibility.
The server periodically retrieves
a signed validation response
from the OCSP server and "staples" this proof
to the TLS handshake.
When a client initiates a connection to the web server,
the server provides
the pre-validated certificate status directly,
removing the need for the client
to independently check with the OCSP server.
This not only speeds up secure connection establishment
but also enhances privacy
by preventing the OCSP server from tracking client requests.
So remember, understanding and assessing cryptographic flaws
in digital certificates is important
for ensuring the security of SSL/TLS communication.
Pentesters must be able to identify
and exploit vulnerabilities associated with mismanagement
or flawed certificates to assess the security posture
of an organization effectively.
Now, this knowledge ensures
that secure communication channels remain robust
against the ever-evolving security threats.