One takeover to rule them all
A subdomain of the French electricity company EDF pointed via a CNAME to an expired domain that was available for purchase. By buying that domain, the researcher took control of over 450 subdomains, which could have been used for phishing and other attacks.
Published on 10degres.net
Because of Covid, the first quarantaine in France occured in March 2020. During that time I wrote a Python script to detect Subdomain Takeover.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
EDF is the national French electricity company. During the first Covid lockdown in France, in March 2020, the researcher wrote a Python script to detect subdomain takeover and used it against EDF's estate. One hit stood out: nucleaire.edf.fr was an alias of edf-linkbynet.com, and that domain was available for purchase. Buying it put the researcher in control of the resolution of more than 450 EDF subdomains.
The report assumes the reader already knows what subdomain takeover is and points to the OWASP testing guide, the HackerOne guide and 0xpatrik's basics rather than re-explaining it. The takeover technique used here is the simplest one: buying an expired domain that is still referenced by a CNAME.

Setup
The finding came from the researcher's own Python script, dnspy; buying the domain required a registrar account. dnspy is made of three modules:
- The grabber finds subdomains using external tools such as subfinder, oneforall, github and amass, then creates alterations with altdns or dnsgen.
- The resolver performs DNS queries on all grabbed and generated subdomains using massdns, trying to detect dead hosts and CNAMEs.
- The interpreter reads the resolver output and looks for possible takeovers using a fingerprint file. It is inspired by subjack and adds features such as regexp support and an ignore list.
The whole thing is daemon based and can be launched independently. No account on the target was needed; the researcher was not invited to EDF's private bug bounty program on the French platform YesWeHack.
Finding it
dnspy reported that nucleaire.edf.fr was an alias of edf-linkbynet.com. A quick search on Gandi showed that edf-linkbynet.com was available for purchase for about 12€/year. A CNAME pointing at a domain that anyone can register is exactly the condition for this class of takeover: whoever owns the target of the CNAME controls what the EDF name resolves to.
Exploitation
Step 1: buy the dangling domain
The researcher bought edf-linkbynet.com and configured it on his server to serve a proof-of-concept page. The report does not describe the DNS records or web server configuration used.

Step 2: observe the traffic
A few days later the researcher checked the server logs to see whether anyone had requested the stolen subdomain. The logs showed requests for many different subdomains he had not known about.

Step 3: report it
At that time EDF had a private bug bounty program on YesWeHack, but the researcher was not invited, so he used the dedicated contact form on the company's website. Six weeks and several attempts to get in touch later, the problem was fixed silently.
Root cause
The researcher's guess is a communication failure between technical team leaders: one administrator bought edf-linkbynet.FR while the other configured all the CNAMEs to point at edf-linkbynet.COM. The .COM name was available for purchase, and the researcher bought it. A CNAME to a name outside the organisation's control is trusted by resolvers as long as the record exists.
Impact
More than 450 subdomains were redirected to the researcher's server. In the report's own words, exploited by a malicious user this could have been devastating: social engineering, phishing, cookie manipulation, a fake payment system, damage to company reputation. The researcher notes that a simple thank you would have been appreciated.
Fix
EDF fixed the issue silently; the report does not say what was changed. The obvious remediation, consistent with the root cause described, is to remove or repoint the CNAMEs so that no EDF name depends on a domain the company does not own, and to keep ownership of any domain used as a CNAME target.
Variants to test
- Run a resolver over a large subdomain set and look for CNAMEs whose target is a registrable domain not owned by the organisation. A positive result is a target that is available for registration at a registrar.
- Check both the
.FRand.COM(or other TLD) forms of any internal-looking domain referenced in CNAMEs, since the report's root cause was exactly a mismatch between the two. - Keep the fingerprint-based interpreter running as a daemon; the report shows the tool surfacing several good findings beyond the EDF one.






What happened, in plain words
EDF is the national French electricity company. In March 2020, during the first Covid lockdown in France, the researcher wrote a small program in the Python language to look for a common misconfiguration called subdomain takeover. He ran it against EDF's internet estate and one result stood out.
A name like nucleaire.edf.fr is a subdomain: a name that sits under the main EDF domain, edf.fr. The tool found that nucleaire.edf.fr was not a real server of its own. It was an alias, a pointer, to another domain: edf-linkbynet.com. That second domain was available for purchase at a registrar (a company that sells domain names) for about 12€ a year. The researcher bought it. From that moment, every visitor asking for nucleaire.edf.fr was sent to a server the researcher controlled. In the end, more than 450 EDF subdomains pointed at his machine.

The report does not explain subdomain takeover from scratch; it links to the OWASP testing guide, the HackerOne guide and 0xpatrik's basics for that. The technique used here is the simplest one: buy an expired domain that other names still point to.
Setup
The only things needed to find the problem were the researcher's own Python script, dnspy, and an account at a domain registrar. dnspy is built from three parts:
- The grabber finds subdomains using external tools such as subfinder, oneforall, github and amass, then creates alterations with altdns or dnsgen.
- The resolver performs DNS queries on all grabbed and generated subdomains using massdns, trying to detect dead hosts and CNAMEs.
- The interpreter reads the resolver output and looks for possible takeovers using a fingerprint file. It is inspired by subjack and adds features such as regexp support and an ignore list.
The whole thing is daemon based and can be launched independently. No account on the target was needed; the researcher was not invited to EDF's private bug bounty program on the French platform YesWeHack.
A few of those words deserve a plain explanation, because the rest of the story depends on them.
A subdomain is a name placed in front of a main domain. If edf.fr is the company's front door, nucleaire.edf.fr is a labelled door inside the same building. Companies create many of them: one per service, per region, per old project.
DNS, the Domain Name System, is the internet's phone book. You type a name, DNS answers with the address of a machine. A CNAME record is a special entry in that phone book that says "this name is not a machine, it is another name, go and look there". It is like a mail forwarding note: letters for the old address are sent to the new one.
A registrar is the shop where domain names are rented, usually per year. When a rental is not renewed, the name expires and anyone can buy it.
A daemon is a program that runs in the background on a machine, without anyone sitting in front of it, doing its job continuously. The researcher's tool could run that way, watching lists of names over time.
A fingerprint file is a list of patterns that identify a particular service or a particular error page, so the tool can recognise what software is behind a name without a human looking at it.
Finding it
dnspy reported that nucleaire.edf.fr was an alias of edf-linkbynet.com. A quick search on Gandi showed that edf-linkbynet.com was available for purchase for about 12€/year. A CNAME pointing at a domain that anyone can register is exactly the condition for this class of takeover: whoever owns the target of the CNAME controls what the EDF name resolves to.
In other words: EDF's phone book entry for nucleaire.edf.fr said "ask edf-linkbynet.com where to go". But nobody was paying for edf-linkbynet.com any more, so the phone book entry for that name was free to claim. The researcher claimed it. The chain of trust that EDF thought it had was now in a stranger's hands, and EDF had no way to notice, because from EDF's side nothing had changed: the CNAME record was still there and still looked correct.
Exploitation
Step 1: buy the dangling domain
The researcher bought edf-linkbynet.com and configured it on his server to serve a proof-of-concept page. The report does not describe the DNS records or web server configuration used.
A proof-of-concept page, usually shortened to PoC, is a harmless page that demonstrates a problem exists. It is not an attack; it is evidence. Here it showed that a visitor arriving on an EDF subdomain was in fact served by the researcher's machine.

The image shows that proof-of-concept page as it appeared to a visitor of the hijacked subdomain.
Step 2: observe the traffic
A few days later the researcher checked the server logs to see whether anyone had requested the stolen subdomain. The logs showed requests for many different subdomains he had not known about.
A server log is the list of visits a web server writes down: which name was asked for, when, and from where. Reading it is like reading the guest book at a party you did not organise. The researcher checked the logs to see whether anyone had requested the stolen subdomain. Instead he saw requests for names he had never heard of, because all of them ended up at the same CNAME and therefore at the same server. That is how the scale of the problem became visible: one bought domain, hundreds of EDF names behind it.

The screenshot shows those server logs, with requests for many different subdomains arriving at the researcher's machine.
Step 3: report it
At that time EDF had a private bug bounty program on YesWeHack, but the researcher was not invited, so he used the dedicated contact form on the company's website. Six weeks and several attempts to get in touch later, the problem was fixed silently.
A bug bounty program is a scheme where a company invites security researchers to report flaws and pays for valid ones. A private program is one where only invited researchers may take part. Since the researcher could not use that channel, he used the ordinary contact form on the company's website, which is the public route anyone has. The fix happened silently, and the researcher notes that a simple thank you would have been appreciated.
Root cause
The researcher's guess is a communication failure between technical team leaders: one administrator bought edf-linkbynet.FR while the other configured all the CNAMEs to point at edf-linkbynet.COM. The .COM name was available for purchase, and the researcher bought it. A CNAME to a name outside the organisation's control is trusted by resolvers as long as the record exists.
The detail that matters is the ending of the name. .FR and .COM are two different endings, called top-level domains, and they are two completely separate names. edf-linkbynet.fr and edf-linkbynet.com look almost identical to a human eye, but to the internet they are as different as two streets with the same name in two different cities. One team paid for the French version; the other team wrote the American version into the DNS records. The American version was available for purchase, and the researcher simply rented it.
A resolver is the part of the internet that turns a name into an address, usually run by your internet provider or by a public service. It follows the CNAME chain without asking whether the final name belongs to the same organisation. As long as the record exists, the resolver trusts it. That is why nothing on EDF's side looked broken.
Impact
More than 450 subdomains were redirected to the researcher's server. In the report's own words, exploited by a malicious user this could have been devastating: social engineering, phishing, cookie manipulation, a fake payment system, damage to company reputation. The researcher notes that a simple thank you would have been appreciated.
Each of those risks is worth spelling out for a reader new to the field.
Social engineering is manipulating people rather than machines: convincing someone to hand over information or perform an action. Phishing is its most common form: a fake page that looks like the real one, asking for a password or a card number. A cookie is a small piece of data a website stores in your browser so it can recognise you on the next page, for example to keep you logged in. If an attacker controls the name your browser is talking to, the browser may hand over cookies that belong to that name. A fake payment system is a checkout page that collects card details and keeps them. Reputation damage follows when customers learn that a name bearing the company's logo led them somewhere hostile.
None of this happened here: the researcher served a harmless page and reported the problem. The point is what could have happened in other hands.
Fix
The obvious remediation, consistent with the root cause described, is to remove or repoint the CNAMEs so that no EDF name depends on a domain the company does not own, and to keep ownership of any domain used as a CNAME target.
In everyday terms: either stop forwarding the old address to a house nobody in the family owns, or buy that house and keep paying for it. What must not happen is leaving a forwarding note in place for a property that anyone can rent.
Variants to test
- Run a resolver over a large subdomain set and look for CNAMEs whose target is a registrable domain not owned by the organisation. A positive result is a target that is available for registration at a registrar.
- Check both the
.FRand.COM(or other TLD) forms of any internal-looking domain referenced in CNAMEs, since the report's root cause was exactly a mismatch between the two. - Keep the fingerprint-based interpreter running as a daemon; the report shows the tool surfacing several good findings beyond the EDF one.
The first point means: take a big list of names, ask DNS what each one points to, and keep the ones that point outside the company. Then check at a registrar whether the target is free. If it is, the same story can repeat.
The second point is the lesson of this specific case: when a name looks internal, check every ending it might have been registered under, because a single letter difference is enough to break the chain.
The third point is about persistence. New subdomains appear all the time, and old ones are forgotten. A tool that keeps running in the background and rechecks fresh lists catches what a one-off scan misses. The screenshots below show other findings the tool produced.






Glossary
- Subdomain: a name placed in front of a main domain, such as
nucleaire.edf.frunderedf.fr. - Subdomain takeover: a situation where a name points to a resource that someone outside the organisation can claim, so that outsider gains control of what the name resolves to.
- DNS (Domain Name System): the internet's phone book, turning names into machine addresses.
- CNAME record: a DNS entry saying that one name is an alias of another name, so the lookup continues at the second name.
- Resolver: the service that performs DNS lookups on your behalf and follows CNAME chains.
- Registrar: a company that rents domain names, usually per year.
- Domain expiry: the moment a rented domain name is no longer paid for and becomes available for anyone to register.
- Top-level domain (TLD): the ending of a domain name, such as
.FRor.COM; two endings mean two separate names. - Daemon: a program that runs in the background without a person operating it.
- Fingerprint file: a list of patterns used by a tool to recognise a service or an error page automatically.
- Proof of concept (PoC): a harmless demonstration showing that a problem exists.
- Server log: the record a web server keeps of the requests it receives.
- Bug bounty program: a scheme where a company invites researchers to report flaws, sometimes for a reward.
- Private bug bounty program: a bug bounty program open only to invited researchers.
- YesWeHack: the French bug bounty platform where EDF ran its private program at the time.
- Social engineering: manipulating people, rather than machines, into giving away information or performing an action.
- Phishing: a fake page or message that impersonates a trusted party to steal credentials or payment details.
- Cookie: a small piece of data stored by a website in your browser so it can recognise you across pages.
- dnspy: the researcher's Python tool, made of a grabber, a resolver and an interpreter, used to detect subdomain takeover.
- subfinder, oneforall, amass, github: external sources and tools the grabber uses to find subdomains.
- altdns, dnsgen: tools that generate alterations of known names to guess new subdomains.
- massdns: the tool the resolver uses to perform DNS queries at scale.
- subjack: an earlier subdomain takeover tool that inspired the interpreter.
- Regexp: a pattern language for matching text, used here to recognise service responses.
- Ignore list: a list of names or patterns the tool is told to skip.