News for hackers. Stuff that matters.
Re:Ask HN: How did internet discover my subdomain? by p0w3n3d on Friday March 07, 2025 @03:01AM (#43288126)
Finding IP does not mean finding the domain. When doing HTTP request to IP you specify the domain you want to connect to. For example you can configure your /etc/hosts to have xxxnakedhamsters.google.com pointing to 8.8.8.8 and make the http request, which will cause Google getting the domain request (i.e. header Host: xxxnakedhamsters.google.com) and it will refuse it or try to redirect to http. Of course it's only related to HTTP because HTTPS will require certificate. That's why they're speaking about certificates.
Re:Ask HN: How did internet discover my subdomain? by ghusto on Friday March 07, 2025 @03:23AM (#43288228)
First thing I’d do for an IP that answers is a reverse lookup, so I expect that’s at least in the list of things they’d try.
Re:Ask HN: How did internet discover my subdomain? by lewiscollard on Friday March 07, 2025 @04:57AM (#43288802)
Depending on the web server's configuration, you very much _can_ find the domain which is configured on an IP address, by attempting to connect to that IP address via HTTPS and seeing what certificate gets served. Here's an example:

https://138.68.161.203/

> Web sites prove their identity via certificates. Firefox does not trust this site because it uses a certificate that is not valid for 138.68.161.203. The certificate is only valid for the following names: exhaust.lewiscollard.com, www.exhaust.lewiscollard.com

Re:Ask HN: How did internet discover my subdomain? by jchw on Friday March 07, 2025 @05:50AM (#43289108)
I don't think that does you any good for Cloudflare, though. They will definitely be using SNI.
Re:Ask HN: How did internet discover my subdomain? by kelnos on Friday March 07, 2025 @06:32AM (#43289333)
That doesn't really matter, though. While OP is using Cloudflare, the actual server behind it is still a publicly-accessible IP address that an IPv4 space scanner can easily stumble upon.
Re:Ask HN: How did internet discover my subdomain? by jchw on Friday March 07, 2025 @07:20AM (#43289570)
I misunderstood, I thought the subdomain was an R2 bucket. If it's just normal Cloudflare proxying to some backend this is probably the most likely answer.

That said, while I think it's not the case here, using Cloudflare doesn't mean the underlying host is accessible, as even on the free tier you can use Cloudflare Tunnels, which I often do.

Re:Ask HN: How did internet discover my subdomain? by ratg13 on Friday March 07, 2025 @07:44PM (#43296440)
they only state they are using cloudflare for DNS, they didn't say if they were proxying the connection
Re:Ask HN: How did internet discover my subdomain? by jchw on Friday March 07, 2025 @11:57PM (#43297617)
Also a valid point. I guess without more details all we can really do is speculate about the exact setup. That said, I do now agree that the most likely answer is "the underlying host was accessible and caught by an IPv4 scanner" since well, that's pretty much what it says anyway.
Re:Ask HN: How did internet discover my subdomain? by melevittfl on Friday March 07, 2025 @06:22AM (#43289275)
But there's no evidence in the OP's post that they have, in fact, discovered the domain. The only thing posted is that there is a GET request to a listening web server.

The OP and all the people talking about certificates are making the same assumption. Namely that the scanning company discovered the DNS name for the server and tried to connect. When, if fact, they simply iterate through IP address blocks and make get requests to any listening web servers they find.

Re:Ask HN: How did internet discover my subdomain? by p0w3n3d on Friday March 07, 2025 @10:16AM (#43290815)
OP states that the domain was discovered
Re:Ask HN: How did internet discover my subdomain? by crazygringo on Friday March 07, 2025 @10:34AM (#43290981)
No they didn't. They said "How did the internet find my subdomain?" They're assuming the internet found their subdomain. They don't provide any evidence that happened, just that they found their IP address.
Re:Ask HN: How did internet discover my subdomain? by denysvitali on Saturday March 08, 2025 @03:03AM (#43298440)
I really doubt CloudFlare gives them an IPv4 and they can see all the logs for said IPv4
Re:Ask HN: How did internet discover my subdomain? by paxys on Friday March 07, 2025 @12:23PM (#43292054)
> When doing HTTP request to IP you specify the domain you want to connect to

No, you make HTTP requests to an IP, not a domain. You convert the domain name to an IP in an earlier step (via a DNS query). You can connect to servers using their raw IPs and open ports all day if you like, which is what's happening here. Yes servers will (likely) reject the requests by looking at the host header, but they will still receive the request.