Thanks, I really like this one and I want to build it. Before I start, I’d like your take on doing the lookup part a little differently.
The way I read it, every query would get checked against RDAP to see how old the domain is. I’m worried that hits rate limits fast, adds a network call to every lookup, and doesn’t work for a lot of country code TLDs that don’t publish a creation date.
What I was thinking instead:
Pull a free daily newly registered domain feed once a day and turn it into a lookup list on the SIEM. Wazuh can match a field against a list natively, so nothing runs per query.
Log queries at my resolver (Unbound on the firewall) and ship them to the SIEM.
Strip each query down to the registered domain before matching, so something like cdn.badsite.xyz gets checked as badsite.xyz. Otherwise subdomains never match the list.
Only alert on external lookups. Internal lab names will never show up in an NRD feed, so there’s no reason to spend log volume on them.
Keep RDAP only for enrichment, so when something fires I look up the exact registration date for that one domain instead of every query.
Two things I’m still unsure about and would love your opinion on:
Browsers using DNS over HTTPS skip the local resolver completely, so they’d never show up in the logs. Would you block DoH at the firewall to force everything through the resolver, or just accept the gap and write it up as a known blind spot?
Would you add a “first time this domain was ever seen in the lab” alert alongside the NRD one? It seems like it would catch things the feed misses, but I’m guessing it gets noisy the first few weeks.
Does that hold up, or am I overthinking it? I’ll write it up the same way as the scanner post either way: what fired, what was noise, and what I tuned.
@Itachixkurosaki That holds up, and it’s better than my version. Checking a daily list on the SIEM beats calling RDAP on every query.
For the feed: I work at WhoisFreaks, and we publish a free daily list on GitHub (GitHub - WhoisFreaks/daily-newly-registered-domains: Daily 10,000 free newly registered domains. Fresh domain name lists updated daily for SEO, lead generation, research, and threat intelligence. · GitHub). One CSV per day, about 10,000 domains. It covers only part of the gTLDs, no ccTLDs, and is one day behind. So a match means something, but no match proves nothing. Since you want “registered in the last 30 days”, keep the last 30 files, not just today’s. If you ever need wider coverage, the paid newly registered domains feed (Whoisfreaks [.] com/products/newly-registered-domains) refreshes twice a day and adds ccTLDs, though that coverage isn’t complete yet. The free list is enough for a lab.
Your two questions:
DoH: I’d do both. Block the common DoH providers at the firewall and set the Firefox canary domain (use-application-dns.net) so Firefox turns DoH off by itself. Some apps will still get around it, so write that up as a known blind spot. That part reads well in a write-up too.
First-seen alert: yes, it catches what the feed misses. Let it learn quietly for two or three weeks before alerting, and skip popular domains (the free Tranco top list works). After that it gets quiet fast in a small lab.
Looking forward to the write-up.
Thanks again, this was exactly the push I needed. I ended up building it tonight and it’s already live.
Here’s how it came together:
- A small script pulls your daily list every morning and keeps a rolling 30 days like you said. Your archive folder let me backfill the last month right away, so it started with a little over 280,000 domains.
- Unbound on the firewall logs every query and sends it over syslog to a box that already runs a Wazuh agent, so I didn’t have to install anything on the firewall itself.
- I swapped out the stock Unbound decoder in Wazuh for one that also pulls out the registered domain. Since your free feed is only gTLDs, I just keep the last two labels, so
cdn.whatever.xyzgets checked aswhatever.xyz. That ends up being correct for everything the feed can actually match. - The rule does a native list lookup on the SIEM, so nothing runs per query and RDAP stays out of the hot path.
- For testing I add a canary domain on the
.testTLD to the list every time it deploys. It can never be a real registration, so my test that says “this must alert” never goes stale as the list rolls over.
I sent a real lookup for the canary through the firewall and the alert landed in my Discord channel about a minute later, so the whole path works.
Funny enough, the night started with my whole lab going down because a network card on my main server hung. The firewall runs as a VM on that box, so everything lost its router at once. Once I tracked that down and got everything back up, I figured I might as well build something. ![]()
Next up is your DoH advice, both the firewall block and the Firefox canary domain, and I’ll write up whatever slips past as a known blind spot. Then the first seen alert, with a few weeks of quiet learning and the Tranco list to skip popular domains.
I’m going to let it run for a week or so before I do the writeup, so I have real hits and real noise to talk about instead of just the setup. I’ll tag you when it’s up.
One more thing I forgot to mention, since you brought up the detection thinking side.
A little while back I also submitted a rule upstream to SigmaHQ: new: Cisco IOS Login Brute Force Quiet Mode Triggered by darthsteven444-code · Pull Request #6488 · SigmaHQ/sigma · GitHub
It detects %SEC_LOGIN-1-QUIET_MODE_ON, which a Cisco IOS device logs when it locks out logins after too many failures. Their Cisco rules didn’t have anything covering a brute force against the device login itself. The device only enters quiet mode after repeated failures inside its window, so the event is already thresholded. That makes it a high confidence signal that won’t fire on one mistyped password, without needing any counting logic in the rule.
I wrote it against real logs from the Cisco router in my lab. All 14 of their automated checks passed, and one of the maintainers already updated my branch to the latest master, so it’s just waiting on the final two approvals to get merged.
Same idea as the DNS one, really: find a gap, build it against real telemetry, and prove it fires.
That’s a fast turnaround, nice work. The .test canary is a smart call. A test that can’t go stale as the list rolls over is exactly the kind of detail that stands out in a write-up. Keeping RDAP out of the hot path worked out well too.
One thing worth noting in the write-up: the list runs a day behind, so a domain registered and used the same day won’t match. That’s where your first-seen alert comes in, and showing how the two cover each other’s gaps is good detection thinking.
And congrats on the SigmaHQ PR. Getting a rule upstream, written against real logs from your own router, is a strong thing to point to in interviews. Looking forward to the write-up once you have a week of real hits.
Quick follow up like I said I would. You called out a few things so here’s where each one landed after about a week.
The day behind gap is actually bigger than a day
I pulled the numbers instead of guessing. Every file in the free WhoisFreaks feed is exactly 10,000 domains, so it’s a sample of what gets registered, not the whole thing. On top of that, the “latest” file I grab each morning turned out to be a byte for byte copy of the dated file from two days earlier. So realistically the list runs about 2 days behind, not 1. That made the first seen alert a lot more important than I thought going in.
First seen alert is live
New Wazuh rule that fires the first time anything on my network looks up a domain it has never looked up before. That’s what covers a domain that gets registered and used before it ever shows up on the list.
- I seeded the “already seen” list from a week of my own Unbound logs on linux-lab (759 domains to start). A cron job rebuilds it every morning between the feed pull and the deploy, so each domain only alerts once.
- It’s level 5 so it gets indexed for hunting but stays out of Discord. The NRD rule still runs first, so a real NRD hit stays loud.
- Two canaries in my tests keep it honest. example.com is pinned in the seen list and has to stay quiet, and a .test domain is never allowed in and has to fire. 6 out of 6 live tests passing.
- Found a bug in my own work on day one. Wazuh list lookups are case sensitive, so GOOGLE.COM kept alerting even though google.com was in the list. Now the list stores both spellings.
DoH blocking is in
Three layers on OPNsense:
- The Firefox canary domain returns NXDOMAIN so Firefox shuts DoH off on its own. Apple Private Relay domains are blocked too since they also go around Unbound.
- A known DoH server list blocked in Unbound by name.
- A firewall alias of DoH server IPs blocked on 443, plus DoT (853) blocked everywhere.
One gotcha: my own monitoring box probes 1.1.1.1 and 8.8.8.8 on 443 to check if the internet is up, and both are DoH servers. Blocking them would have tripped my own InternetDown alert, so that one host is exempted.
What a week of real data looks like
- NRD rule: 1 hit in 8 days, and it was my canary. A home network just doesn’t go to brand new domains much. Quiet is the right answer here.
- First seen rule: 573 alerts the first night across 167 domains, and most of that was me. I was upgrading a laptop and installing a new desktop at 2am, so package mirrors and project sites lit it up. Once that settled it ran around 3 to 10 alerts an hour, which is very livable for a hunting rule.
- Bonus finding: some devices take a failed lookup and retry it with my gateway’s “.Home” suffix stuck on the end. Harmless, but you only see that kind of thing when you log every query.
Things I’d tell anyone building this
- DNS logs see everything everybody in the house browses. I’m not posting my top domains list for that reason, and I’d think twice before shipping these logs anywhere you don’t fully control.
- While I was checking that this project didn’t open anything up, I found four Docker containers on my log box reachable from my whole LAN, because Docker published ports go right around UFW. Nothing to do with the DNS work, but I locked them to my tailnet only and confirmed it with a before and after test.
Next up is letting it run through the weekend for more data, then writing it up properly for my site. The Sigma rule is still in maintainer review, fingers crossed it gets merged.
Thanks again for pushing on the details, it made the whole thing better.