Earlier quoted context omitted.
Most servers just listen on :80 and respond to all requests. Almost nobody checks the host header intentionally, it's just a happy mistake if they use a reverse proxy. You can often decloak servers behind Cloudflare because of this. But OP's post already answered their question: someone scanned ipv4 space. And what they mean is that a server they point to via DNS is receiving requests, but DNS is a red herring.
This really depends on the setup. Most web servers host multiple virtual hosts. IP addresses are expensive. If you're deploying a service behind a reverse proxy, it either must be only accessible from the reverse proxy via an internal network, or check the IP address of the reverse proxy. It absolutely must not trust X-Forwarded-For: headers from random IPs.
Ask HN: How did the internet discover my subdomain?
41–50 of 322 posts
Re: Ask HN: How did the internet discover my subdomain?
#42LPT, this is an object lesson in the weakness of security through obscurity
Re: Ask HN: How did the internet discover my subdomain?
#43Earlier quoted context omitted.
This really depends on the setup. Most web servers host multiple virtual hosts. IP addresses are expensive. If you're deploying a service behind a reverse proxy, it either must be only accessible from the reverse proxy via an internal network, or check the IP address of the reverse proxy. It absolutely must not trust X-Forwarded-For: headers from random IPs.
I just don't see how any of this matters. OP's server is reachable via ipv4 and someone sent an http request to it. Their post even says that this is the case.
Re: Ask HN: How did the internet discover my subdomain?
#44Earlier quoted context omitted.
Port scanning usually can't discover subdomains. Most servers don't expose the of the domains they server content for. In case of HTTP they usually only serve the subdomain content if the Host: request-header includes it.
How deep in the domain hierarchy you are doesn't matter from a network layer: a bare tld (yes this exists), a normal domain, a subdomain, a sub-subdomain, etc can all be assigned different IPs and go different places. You can issue a GET against / for any IP you want (like we see in the logs OP posted). The only time this would actually matter is if a host at an address is serving content for multiple hostnames and d…
I'm quite sure OP meant a virtual host only reachable with the correct Host: header.
Re: Ask HN: How did the internet discover my subdomain?
#45Re: Ask HN: How did the internet discover my subdomain?
#46Re: Ask HN: How did the internet discover my subdomain?
#47Re: Ask HN: How did the internet discover my subdomain?
#48Re: Ask HN: How did the internet discover my subdomain?
#49Certificate Transparency logs, or they don't actually know the domain name: just port-scanning[1] then making requests to open web ports. [1] Turns out you can port-scan the entire internet in under 5 minutes: https://github.com/robertdavidgraham/masscan
Re: Ask HN: How did the internet discover my subdomain?
#50Certificate Transparency logs, or they don't actually know the domain name: just port-scanning[1] then making requests to open web ports. [1] Turns out you can port-scan the entire internet in under 5 minutes: https://github.com/robertdavidgraham/masscan
I have a DNS client that feeds into my passive DNS database by reading CT logs and then trying to resolve them.