November 30, 2026
I Built a Self-Hosted Monitor That Texts Me When Subdomains Die
How takeOverWatch watches 3,500+ bug-bounty domains every day and sends a Telegram alert when a subdomain goes dead or looks ready to beโฆ

By Aman Bhuiyan
12 min read
How takeOverWatch watches 3,500+ bug-bounty domains every day and sends a Telegram alert when a subdomain goes dead or looks ready to be taken over.
Picture a marketing team on the last day of a campaign. The landing page comes down, the Shopify store is deleted, and the S3 bucket that held the images is emptied and removed. Everyone closes the ticket and moves on.
Nobody touches the DNS record.
shop.example.com still points at a Shopify store that no longer exists. assets.example.com still points at a bucket that someone deleted. These leftovers are called dangling CNAMEs, and they are one of the quietest ways for a trusted domain to be turned against its owner. If anyone can re-register the thing a dangling record points to, they can serve their own content on the company's subdomain. That is a subdomain takeover: phishing pages, stolen cookies and injected content, all wearing a domain your users already trust.
What bothered me most was the timing. A takeover is not something you find once and then leave on the shelf. It becomes possible the day something is switched off, so a scan from last month says nothing about the shop deleted last night.
So I set out to build a watchman: a small, self-hosted tool that checks thousands of bug-bounty domains every single day and taps my phone on the shoulder the moment something changes. This is the story of how I built it, what broke along the way, and what I'd do differently. I called it takeOverWatch.
The short version:_ Takeovers appear the day something is decommissioned, so a one-time scan misses them. takeOverWatch runs daily, re-verifies every finding before alerting, and also sends a "went dead" digest, which is often the earliest signal of all._
โ ๏ธ Read this before you run anything. Use this only on assets you are authorized to test, such as in-scope bug-bounty targets, and follow each program's rules. Every alert from takeOverWatch is a lead, not proof. Test each one manually before you call it a takeover or report it, even when the message says VULNERABLE or CONFIRMED. And never claim a resource just to prove a point unless the program explicitly allows it.
Two jobs, one daily habit
I gave the tool two jobs, and both run every day:
- Takeover alerts. A subdomain points at a cloud resource that looks unclaimed.
- A "went dead" digest. A daily list of subdomains that resolved yesterday and don't today. These are often the first sign that something was shut down.
Here is the road every domain travels, from a line in a text file to a ping on my phone, and finally to me:
The first five steps are automated. The sixth never will be, and you should never skip it.
Building the machine
What started as one script grew into three parts, each with a clear job:
subtakeover.pyis the engine. It handles subdomain discovery, DNS resolution and takeover fingerprinting, and also ships with a GUI and a CLI for one-off scans.subwatch.pyis the monitor. It loops over a target list, drives the engine, removes duplicate findings, tracks liveness and sends the Telegram messages.collectSub.shis an optional, very thorough (and slow) Bash enumerator with about 25 sources, for deep dives on a single target.
Under the hood, every base domain takes the same road:
Results stream out of the engine host by host, so the monitor filters, re-checks and queues alerts while the cycle is still running.
One design choice made everything easier. The engine knows nothing about GUIs, CLIs or Telegram. It reports progress through three callbacks (on_log, on_result, on_progress), so the desktop GUI, the command line and the background monitor all drive the same engine and simply handle the callbacks differently.
Step 1: Choosing what to watch
Before the tool could watch anything, it needed something to watch. I didn't want to hand-curate a list, so I let the community do it. By default, the monitor pulls wildcards.txt from the public arkadiyt/bounty-targets-data repository: an automatically updated list of wildcard scopes (*.example.com) from public bug-bounty programs, currently about 3,500 base domains. It downloads the list again at the start of every cycle, so new programs join the watch without me lifting a finger.
I also set a few rules so the tool would never wander out of scope:
*.api.example.comstays exactly that narrow. It is not widened toexample.com, because that would scan outside the scope.- Malformed patterns like
*-vpn.example.comare reduced to the registrable domain or skipped. They are never guessed into an invalid hostname. - You can point
--urlat your own list, which is the better option if you only hunt on a few programs.
Step 2: The lie in my logs
My first version was simple. It used two sources: crt.sh (certificate-transparency logs) and a 244-word brute-force list. It looked fine, right up until I read the logs closely.
Lesson 1: Check that each source actually returns results
Here is what I found. crt.sh rate-limits by IP. After a few hundred requests, every query got HTTP 429, and my code logged that at debug level and carried on. For weeks, the monitor was effectively running on the 244-word list alone. It had never really been watching.
I fixed it in three parts:
- Add subfinder. It queries about 40 passive sources plus any API keys you configure (Chaos, VirusTotal, Shodan, SecurityTrails, GitHub and more). It also reads crt.sh through its Postgres interface, which isn't subject to the HTTP 429s.
- Back off properly. When crt.sh returns a 429, pause all crt.sh requests for 15 minutes instead of retrying for every domain.
- Log every source. Print one line per domain showing what each source produced:
example.com: 172 live in 128s (540 candidates -> dnsx 172; subfinder 314, brute 244)example.com: 172 live in 128s (540 candidates -> dnsx 172; subfinder 314, brute 244)On my benchmark domain, this took the result from 17 live hosts to 172.
A per-domain log line like this makes it obvious when a source silently stops producing results.
Lesson 2: Bigger wordlists aren't automatically better
Next I tried throwing more at the problem. I benchmarked a 5,000-word brute force and 3,000 alterx permutations on top of subfinder's results. Both found zero additional hosts and cost 2 to 3 minutes per domain. Across 3,500 domains, that is a lot of time for nothing.
Both remain available as opt-in flags (--wordlist, --permutations) for when you're focused on a single target, but they're off in the daily loop.
Lesson 3: Screen in bulk, then check carefully
The last problem was speed. Resolving thousands of candidates one at a time in Python is slow, so now every candidate first goes through dnsx, a fast Go resolver, and only names with an A, AAAA or CNAME record continue to the slower per-host checks.
Dangling CNAMEs are deliberately kept, since they're exactly what we're looking for.
Step 3: Teaching it to spot a takeover
With a list of live hosts in hand, the next question was the important one: which of them point at something abandoned? For each live host, the engine follows the CNAME chain and matches it against a fingerprint database of 45 providers, based on the community project can-i-take-over-xyz. Every host ends up with one of three verdicts:
- Vulnerable: The CNAME points to a known provider and the HTTP response contains that provider's "unclaimed" marker (for example
NoSuchBucketor There isn't a GitHub Pages site here). - Potential: The CNAME points to a provider (or anywhere) and the target is NXDOMAIN. This is a dangling record that needs manual checking.
- None: It resolves normally and the resource looks active.
Wildcard DNS is detected up front by resolving two random names. Without that check, every brute-forced word would appear to "exist".
Step 4: Teaching it to doubt itself
Raw fingerprint matches produce false positives, and I knew that a monitor that cries wolf gets muted. So before any finding is allowed near my phone, it goes through a read-only re-verification. Nothing is ever registered or claimed. Three checks decide whether a finding survives:
- Majority NXDOMAIN. The target must return NXDOMAIN from at least 2 of 3 independent resolvers. One flaky or caching resolver can't create an alert.
- Live resource behind an unbound hostname. Some platforms, Azure App Service for example, show the same "not found" page for any hostname that isn't bound to an app, even when the app itself is alive and owned. The re-check queries the provider's own hostname directly. If it serves real content, the finding is marked a false positive and suppressed.
- Azure Traffic Manager. Profile names stay reserved after deletion, so NXDOMAIN doesn't prove the name can be registered. These are always sent as
โ UNVERIFIED, never as confirmed.
Every check is read-only: nothing is ever registered or claimed.
Each alert shows its verdict, so you can tell a strong lead from one that needs investigation:
๐จ Subdomain Takeover โ VULNERABLE โ
CONFIRMED
Host: assets.example.com
Base: example.com
Service: AWS/S3
CNAME: assets.example.com โ assets-example.s3.amazonaws.com
Detail: AWS/S3 fingerprint matched (Vulnerable)
Verify: still errors/unreachable when queried directly โ consistent with an unclaimed resource
Automated re-check found nothing that disproves it โ still confirm manually before reporting.๐จ Subdomain Takeover โ VULNERABLE โ
CONFIRMED
Host: assets.example.com
Base: example.com
Service: AWS/S3
CNAME: assets.example.com โ assets-example.s3.amazonaws.com
Detail: AWS/S3 fingerprint matched (Vulnerable)
Verify: still errors/unreachable when queried directly โ consistent with an unclaimed resource
Automated re-check found nothing that disproves it โ still confirm manually before reporting.โ ๏ธ Even "CONFIRMED" is not a confirmation. The re-check is automated and read-only, so all it can tell you is that nothing disproves the lead. Test every alert manually before you treat it as a takeover or report it. Step 6 shows how.
Step 5: Listening for things that go quiet
Takeover alerts only fire when a host points at something claimable. But decommissioning is exactly when mistakes happen, so I wanted to know when anything disappears. That became the tool's second job: the went-dead digest.
To make it work, the monitor stores every subdomain that has ever resolved in one small JSON file per domain. After each cycle, it compares today against that history:
- Seen resolving today: alive (or "came back" if it was previously dead).
- Known before, but missing from today's search: looked up again directly. Passive sources are flaky, and a host missing from today's results isn't necessarily dead.
- Declared dead only if at least 2 resolvers give a definitive "no address" answer and none resolve it.
Timeouts and SERVFAIL never count, so a network glitch can't cause a flood of false "dead" alerts. An interrupted scan never updates the history.
A host that resolves again after being dead shows up in the digest's back-alive list.
The first scan of each domain is a silent baseline, and alerts start from the second cycle. You get one message per cycle:
๐ subwatch cycle 12: 2 subdomain(s) went dead, 1 came back
โข old-shop.example.com โ dangling CNAME โ x.myshopify.com โ NXDOMAIN on 3/3 resolvers (last alive 2026-11-29)
โข vpn2.example.com โ NXDOMAIN on 3/3 resolvers (last alive 2026-11-29)
โป๏ธ Back alive:
โข beta.example.com
Dead hosts with a leftover CNAME are takeover leads โ check the takeover alerts / verify manually.๐ subwatch cycle 12: 2 subdomain(s) went dead, 1 came back
โข old-shop.example.com โ dangling CNAME โ x.myshopify.com โ NXDOMAIN on 3/3 resolvers (last alive 2026-11-29)
โข vpn2.example.com โ NXDOMAIN on 3/3 resolvers (last alive 2026-11-29)
โป๏ธ Back alive:
โข beta.example.com
Dead hosts with a leftover CNAME are takeover leads โ check the takeover alerts / verify manually.The first line is the most interesting: the subdomain died, but its CNAME still points to a Shopify store that no longer exists.
Step 6: The part no script can do
Everything up to here is automated, which is exactly why this step matters. takeOverWatch gives me leads, never proof. When an alert lands, I treat it as the start of an investigation, not the end of one.
This is my routine for every single alert, whatever its verdict:
- Confirm the scope. Make sure the host is in scope and re-read the program's rules.
- Repeat the DNS check yourself. Resolve the host and follow its CNAME chain to see whether the target is still dangling.
- Look at the response. Request the host and compare what comes back with the provider's known "unclaimed" behavior. Some platforms show the same error page even when the resource is alive and owned.
- Check the current fingerprint notes. Providers change their error pages and some close the loophole entirely, so compare against the latest can-i-take-over-xyz notes.
- Stop before claiming. Never register or claim the resource just to prove a point unless the program explicitly allows it. Document your evidence and report it.
Be most skeptical of UNVERIFIED alerts, especially Azure Traffic Manager ones: a name that stays reserved after deletion can look free when it is not.
Run your own watchman
If you want one of your own, here is how I set mine up.
1. Install
git clone <your-repo-url> takeoverwatch && cd takeoverwatch
pip install requests dnspython tldextract
# Recommended external tools (the monitor works without them, just finds less):
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest
go install -v github.com/projectdiscovery/alterx/cmd/alterx@latest # optional
python3 subtakeover.py --selftest
python3 subwatch.py --selftest # both should print: SELFTEST: ALL PASSgit clone <your-repo-url> takeoverwatch && cd takeoverwatch
pip install requests dnspython tldextract
# Recommended external tools (the monitor works without them, just finds less):
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest
go install -v github.com/projectdiscovery/alterx/cmd/alterx@latest # optional
python3 subtakeover.py --selftest
python3 subwatch.py --selftest # both should print: SELFTEST: ALL PASSAdd your API keys to ~/.config/subfinder/provider-config.yaml. The Chaos key alone is a big win for bug-bounty targets.
2. Create a Telegram bot
- Message @BotFather on Telegram, send
/newbotand copy the token. - Send your new bot any message.
- Get your chat ID:
python3 subwatch.py --bot-token <TOKEN> --get-chat-idpython3 subwatch.py --bot-token <TOKEN> --get-chat-id3. Do a dry run first
export TELEGRAM_BOT_TOKEN="123456:AA..."
export TELEGRAM_CHAT_ID="987654321"
python3 subwatch.py --once --dry-run --verbose --limit 20export TELEGRAM_BOT_TOKEN="123456:AA..."
export TELEGRAM_CHAT_ID="987654321"
python3 subwatch.py --once --dry-run --verbose --limit 20--dry-run prints the alerts to the log instead of sending them, and --limit 20 scans only the first 20 domains.
4. Run it daily with systemd
Keep the secrets in a file only root can read:
sudo tee /etc/subwatch.env >/dev/null <<'EOF'
TELEGRAM_BOT_TOKEN=123456:AA...
TELEGRAM_CHAT_ID=987654321
EOF
sudo chmod 600 /etc/subwatch.envsudo tee /etc/subwatch.env >/dev/null <<'EOF'
TELEGRAM_BOT_TOKEN=123456:AA...
TELEGRAM_CHAT_ID=987654321
EOF
sudo chmod 600 /etc/subwatch.envThen create /etc/systemd/system/subwatch.service:
[Unit]
Description=subwatch subdomain-takeover monitor
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
EnvironmentFile=/etc/subwatch.env
ExecStart=/usr/bin/python3 /opt/takeoverwatch/subwatch.py \
--log /var/log/subwatch.log \
--interval 86400 \
--domain-concurrency 6 \
--min-severity vulnerable \
--subfinder-args "-es securitytrails,virustotal"
Restart=always
RestartSec=15
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now subwatch
journalctl -u subwatch -f[Unit]
Description=subwatch subdomain-takeover monitor
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
EnvironmentFile=/etc/subwatch.env
ExecStart=/usr/bin/python3 /opt/takeoverwatch/subwatch.py \
--log /var/log/subwatch.log \
--interval 86400 \
--domain-concurrency 6 \
--min-severity vulnerable \
--subfinder-args "-es securitytrails,virustotal"
Restart=always
RestartSec=15
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now subwatch
journalctl -u subwatch -fWhy EnvironmentFile and not Environment= lines? Unit files are world-readable, and your bot token shouldn't be.
Prefer cron? Use --once with flock, so a slow run can never overlap the next one:
0 3 * * * cd /opt/takeoverwatch && flock -n /tmp/subwatch.lock python3 subwatch.py --once --log subwatch.log0 3 * * * cd /opt/takeoverwatch && flock -n /tmp/subwatch.lock python3 subwatch.py --once --log subwatch.logWhat running it for real taught me
Running it against the full list taught me a few more lessons:
- Start strict, then widen. In my own run, thousands of findings were generic
potentialdangling CNAMEs, and only a few dozen were fingerprint-confirmedvulnerable. Start with--min-severity vulnerableand lower it once you've built a review routine. - Protect your API quotas. The monitor queries your keyed providers for every domain, every cycle. Free tiers like SecurityTrails (50 calls/month) or VirusTotal (500/day) run out within hours. Exclude them with
--subfinder-args "-es โฆ"and keep them for manual hunting. - Size the cycle to your server. With subfinder, a domain takes up to about 2 minutes. With 3,500 domains, 6 in parallel finishes in roughly 16 hours on a small 4-core VPS. If you only care about a few programs, use your own
--urllist and cycles take minutes. - Let it report on itself. The monitor sends "cycle started" and "cycle done" messages. If they stop arriving, something is wrong.
What it still can't do
No honest story about a tool skips its blind spots. Here is what takeOverWatch doesn't do (yet):
- Hosts with only A records aren't checked for takeover. For example, a subdomain pointing at a released cloud IP, or a dangling NS delegation.
- Domains with wildcard DNS can't be tracked for liveness, because every name resolves there.
- A host that was fixed and later breaks again won't trigger a second takeover alert. Deduplication is permanent per host.
- Fingerprints age. Providers change their error pages and some close the loophole entirely. Check findings against the current can-i-take-over-xyz notes before reporting.
The next morning
Subdomain takeovers come from decommissioning mistakes, and those happen constantly. The difference between finding one and missing it is usually timing, which is the whole reason takeOverWatch exists. A cheap VPS checks every day, so a dead subdomain reaches me while it is still fresh. The tool doesn't do the hunting for me. It makes sure I'm looking at the right place on the right day, and then it is up to me to check.
The lessons I'd pass on:
- Use good passive sources before large brute-force lists, and measure what each source actually adds.
- Screen in bulk, then check carefully.
- Re-check every finding before it reaches a human.
- Watch for changes, not just snapshots. The "went dead" digest is often the earliest signal.
- Verify every alert by hand. An alert is a lead, never proof.
Happy (authorized) hunting! ๐ฏ
โ ๏ธ Reminder: test every alert manually before you report it, and only ever work within a program's scope and rules.
If this was useful, a clap or a follow helps other security folks find it. Questions or ideas for new provider fingerprints? Leave a comment below.