0

I'm trying to understand how the attack described in this article could work. Let's grant that this attacker, not associated with company.com, managed to take control of oldsub.company.com. Here's a description from the article:

Monsegur had used a trick known as domain name system enumeration to dig up one of the company’s defunct subdomains that had once directed visitors to a third-party service. He’d built his phishing site on the same URL of that service, so that the fake login page appeared to be hosted inside the company’s own network.

Here's the part I can't figure out: Presumably this company has a CA-signed certificate for company.com. Unless he was also able to steal the private key for that certificate, wouldn't anyone navigating to the stolen oldsub.company.com domain get a big browser security warning, that whatever certificate the hacker attempted to use for the stolen domain is not trusted?

Of course, since this was a staged, white-hat attack, maybe the attacker did have access to the real certificate. If that's the case, would a "victim" of the attack be able to claim that they checked the domain and received no certificate error, and that should prove the site is legitimate?

2 Answers 2

3

When accessing a web server for a domain the certificate is provided by the accessed server and not by some global directory service or similar. Different servers can provide different certificates, even for the same domain (like on a different port) or for subdomains.

In this specific attack no server exists on the abandoned subdomain, so an attempt to reach one would fail. By taking over this subdomain the attacker is able to provide its own server there, with its own (phishing) content but also with its own certificate. The attacker does not need to have access for the domain certificate belonging to the real owner of the domain for this: since the attacker can provide arbitrary content on the taken over subdomain it can also get a new certificate using a domain validation HTTP challenge.

But even if the attacker would not be able to get a certificate - unless the main domain has a HSTS policy which includes subdomains (and the victims browser knows about this from previous visits), the browser would access the subdomain by plain HTTP and from there the attacker could redirect the victim to another site.

5
  • "since the attacker can provide arbitrary content on the taken over subdomain it can also get a new certificate using a domain validation HTTP challenge." This is the part I didn't quite understand - my assumption was that there are standards in place, such that I can't just go get a trusted cert for sub.mycompany.com without somehow proving I was associated with mycompany.com.
    – slevin
    Jan 21, 2023 at 21:26
  • @slevin: The point of domain validation is that you only need to prove that you have access to the specific subdomain you want to get a certificate for. But even if the attacker would not be able to get a certificate - unless the main domain has a HSTS policy which includes subdomains (and the victims browser knows about this from previous visits), the browser would access the subdomain by plain HTTP and from there the attacker could redirect the victim to another site. Jan 21, 2023 at 21:28
  • "the browser would access the subdomain by plain HTTP and from there the attacker could redirect the victim to another site." - In this case, the victim of the attack would have the opportunity to notice that they're no longer on their company's domain though, right?
    – slevin
    Jan 21, 2023 at 21:32
  • @slevin: " the victim of the attack would have the opportunity to notice that they're no longer on their company's domain though" - They would have the opportunity but the question is how they are actually able to use it. The attacker will unlikely redirect to www.hello-i-am-the-attacker.example but more to company-name-secure-portal.example. It is really hard for a normal user to realize that this is not how it is supposed to be Jan 21, 2023 at 21:36
  • Understood. The article describes the targets here as new hires to the IT staff of a company, users who presumably would be more likely to notice a domain name switch.
    – slevin
    Jan 22, 2023 at 2:09
2

Unless he was also able to steal the private key for that certificate, wouldn't anyone navigating to the stolen oldsub.company.com domain get a big browser security warning, that whatever certificate the hacker attempted to use for the stolen domain is not trusted?

This assumption is false.

There may be more than one valid certificate for the same domain name, and there may be separate certificates for subdomains.

If you control the (sub-)domain and are able to place content into the webroot you can get your self a domain validated certificate from e.g. Let's Encrypt, which is trusted by almost all browsers. Having a certificate on the parent domain does not change this. CAA records is a mechanism that allows you to specify which CA's can issue certs, which can limit impact in ome caes.

2
  • Thanks, so the point is the attacker will have to solve the certificate problem somehow. If the company otherwise follows good practices with their certificates, should they be able to prevent an attacker from obtaining a cert for sub.mycompany.com because the attacker can't prove they are associated with mycompany.com?
    – slevin
    Jan 21, 2023 at 21:22
  • 2
    It depends. Using CAA records can make it more difficult, but ultimately Domain Validation doesn't check if you're affiliated with example.com when you apply for a certificate for subdomain.example.com. They validate that you have control over subdomain.example.com.
    – vidarlo
    Jan 21, 2023 at 21:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .