Skip to content
Subdomain takeover Write-up Intermediate

How Recon helped me to to find a Facebook domain takeover

A Facebook-owned domain was vulnerable to subdomain takeover because its DNS record pointed to a service that no longer hosted content. An attacker could claim the domain by registering it on the third-party service, allowing them to serve content under Facebook's name.

Sudhanshu Rajbhar Follow

Published on medium.com

Bounty$500 View original

#### Sudhanshu Rajbhar

Sudhanshu Rajbhar, on medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

Facebook's bug bounty programme, as described in the report, lists acquisitions and partnerships as in scope: the researcher notes that on the programme's whitehat info page everything Facebook owns is in scope apart from a few excluded domains. The target of this write-up is therefore not a single application but the company's wider domain estate, collected so that it could be searched for subdomain takeovers.

The researcher's own framing is that this was a reconnaissance exercise first and a takeover second. The takeover itself was found on www.buckbuild.com, a domain that appeared in the collected set.

Setup

The work was done from a fresh start after the researcher's final exams, with the Facebook hall of fame as a stated goal. No accounts, roles or special access are described: the whole exercise relies on public WHOIS data, public DNS and public web content.

The tools used, as named in the report:

The method follows two articles by @0xpatrik: https://0xpatrik.com/asset-discovery/ for asset discovery and https://0xpatrik.com/takeover-proofs/ for takeover proofs. No tool versions are given.

Finding it

Horizontal domain correlation by registrant email

The starting point is the WHOIS record of facebook.com.

Image for post
whois facebook.com From the original on medium.com

The record shows the registrant email [redacted]. The idea is that other domains registered by the same organisation often carry the same registrant email, so a reverse WHOIS search on that email surfaces sibling domains that would not appear in any subdomain enumeration of facebook.com itself.

Image for post
https://tools.whoisxmlapi.com/reverse-whois-search ([email protected]) From the original on medium.com

Searching the email in the reverse WHOIS tool returned around 2,756 unique domains whose WHOIS scan result contains [redacted].

Horizontal domain correlation by registrant name

The researcher then repeats the lookup with a different common field: instead of the registrant email, the registrant name.

Image for post
https://tools.whoisxmlapi.com/reverse-whois-search (Facebook, Inc) From the original on medium.com

This returned more domains than the email search, around 3,441.

Merging and de-duplicating

The two result sets are saved into one file and de-duplicated:

Bash
sort filename | uniq |tee outputFileName

sort groups identical lines together, uniq drops the adjacent duplicates, and tee writes the result to outputFileName while still showing it on screen. After this step the researcher reports around 4k unique domains that have either Facebook Inc or [redacted] in their WHOIS scan result.

Image for post
Image for post From the original on medium.com

The report notes that more domains can still be found by picking another field that is common across the already collected domains, rather than the registrant email or name.

Resolving the domains

With the domain list assembled, the next step is to keep only the domains that actually resolve:

Bash
cat fb2.txt | ~/tools/filter-resolved |tee live-domains.txt

filter-resolved reads the domains on standard input and outputs only those that resolve; the result is stored in live-domains.txt.

Subdomain enumeration

Subfinder is then run against the live domain list:

Bash
subfinder -dL live-domains.txt -o subdomains.txt

-dL takes a file of domains rather than a single -d, and -o writes the discovered subdomains to subdomains.txt.

The same resolution step is repeated on the subdomain output, so that only resolving subdomains remain.

Screenshots

The last automated step is webscreenshot, which visits the subdomains and captures a screenshot of each. Going through those screenshots, the researcher spotted www.buckbuild.com.

Image for post
Image for post From the original on medium.com

Exploitation

Step 1: confirm the takeover

Following the takeover-proofs article, the researcher uploaded something to the third-party service the subdomain pointed at, to verify whether the takeover was actually successful. The report does not name the service, the DNS record type, or the exact content uploaded. The researcher uploaded something to verify whether the takeover was successful, and reports that it was.

Image for post
Image for post From the original on medium.com

Step 2: proof of concept

The proof of concept is presented as a screenshot under the heading POC time.

Image for post
Image for post From the original on medium.com

Step 3: report and timeline

The finding was reported and handled on the following schedule:

Date Event
July 08 Initial report
July 11 Report triaged
July 12 Fixed
July 17 Bounty awarded, $500
Image for post
Image for post From the original on medium.com

Root cause

The report does not describe the DNS configuration of www.buckbuild.com or the third-party service involved, so the precise mechanism is not stated.

Impact

An attacker able to claim the dangling resource can serve their own content on a Facebook-owned hostname. The report does not enumerate specific abuse scenarios, and the practical impact depends on what the subdomain is used for and which parties trust it. The report records a $500 bounty and a fix one day after triage.

Fix

Facebook fixed the issue on July 12, one day after triage.

Variants to test

  • Repeat the reverse WHOIS pivot with other common WHOIS fields (registrant organisation, registrant name variants, technical contact) and merge the results, as the report suggests. A positive result is a larger unique domain set than the email or name search alone.
  • Run the same resolve, enumerate, screenshot pipeline against other large organisations with many acquisitions. A positive result is a subdomain worth investigating further.
  • For each candidate, attempt to claim the backing resource on the third-party service and upload a marker file. A positive result is the marker appearing on the subdomain, which is the proof method used here.
  • Revisit screenshot sets that look uniform. The researcher notes that the screenshots initially all looked the same and the finding was only made on a second pass a few days later, so a slow, deliberate review of the same output is itself a variant worth repeating.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

A security researcher wanted to find a bug in Facebook's systems. Facebook runs a bug bounty programme: if you find a security problem and report it responsibly, they pay you. The researcher's goal was to get into Facebook's hall of fame, a public list of people who have reported valid issues.

Instead of poking at the Facebook website itself, the researcher went looking for something less obvious: a domain name that Facebook owns but no longer fully controls. A domain name is the address you type into a browser, like example.com. Companies like Facebook own hundreds or thousands of them, often because they bought other companies over the years. Sometimes one of those domains, or a subdomain of one, still points at a service run by a third party that Facebook stopped using. If that third party lets anyone claim the leftover spot, an outsider can put their own content on a Facebook-owned address. That is called a subdomain takeover.

The researcher found one on www.buckbuild.com, uploaded something to verify the takeover, reported it, and was paid $500. The report's timeline runs from July 08 to July 17.

This article walks through exactly how that was done, explaining every term along the way. You only need to be comfortable using a browser and a computer.

The starting point: what counts as in scope

A bug bounty programme has rules about what you are allowed to test. Facebook's programme page at https://www.facebook.com/whitehat/info/ says that the company's acquisitions and partnerships are also in scope. In plain words: if Facebook owns it, you can test it, apart from a small list of excluded domains.

That matters because it widens the target enormously. Instead of one website, the researcher could look at everything Facebook owns. The plan was to collect as many Facebook-owned domain names as possible, then look for one that had been left pointing at something nobody controlled any more.

The tools used

Before the steps, here is the toolkit, as named in the report:

The method follows two articles by @0xpatrik: https://0xpatrik.com/asset-discovery/ for finding assets, and https://0xpatrik.com/takeover-proofs/ for proving a takeover. The report does not give tool versions.

Step 1: finding Facebook's other domains by email

What WHOIS is

Every domain name has a registration record, a bit like a car's registration document. It says who registered the domain, when, and how to contact them. This record is called WHOIS (pronounced "who is"). Much of it is public, and you can look it up on many websites.

The researcher started by looking up the WHOIS record for facebook.com.

Image for post
whois facebook.com From the original on medium.com

The record shows a registrant email address of [redacted]. That is the contact email Facebook used when registering the domain.

What reverse WHOIS is

Normally you search WHOIS by domain name: you type facebook.com and get its record. Reverse WHOIS flips it: you type a piece of information, such as an email address, and the tool returns every domain whose record contains that same piece of information.

The logic is simple. A large company tends to reuse the same contact details across many registrations. If Facebook used [redacted] for facebook.com, it probably used the same address for other domains it bought. Searching that email backwards surfaces domains that would never show up if you only looked at facebook.com itself. Think of it like searching a library catalogue by publisher rather than by title: you find every book from the same publisher, including ones you did not know existed.

Running the search

The researcher went to https://tools.whoisxmlapi.com/reverse-whois-search and typed the email into the search field.

Image for post
https://tools.whoisxmlapi.com/reverse-whois-search ([email protected]) From the original on medium.com

The result was around 2,756 unique domains whose WHOIS record contains [redacted].

Step 2: finding more domains by company name

A WHOIS record has several fields, not just the email. Another common one is the registrant name, the name of the organisation or person who registered the domain.

The researcher repeated the reverse WHOIS search, this time using the registrant name instead of the email.

Image for post
https://tools.whoisxmlapi.com/reverse-whois-search (Facebook, Inc) From the original on medium.com

This returned more results than the email search: around 3,441 domains.

Why do this? Because the two searches overlap but are not identical. Some domains were registered with the email but a different name field, and some the other way round. Doing both and combining the results catches more than either alone.

Step 3: merging the lists and removing duplicates

Now there are two lists of domains, and many names appear in both. The researcher saved everything into one file and removed the duplicates with this command:

Bash
sort filename | uniq |tee outputFileName

Line by line, in plain words:

  • sort filename reads the file called filename and sorts its lines alphabetically. Sorting matters because the next tool only removes duplicates that sit next to each other.
  • | (the pipe) takes the output of the command on its left and feeds it as input to the command on its right. It is like passing a bucket along a line of people.
  • uniq removes repeated lines that are adjacent. Because the list was just sorted, all identical names are now next to each other, so they collapse into one.
  • tee outputFileName writes what it receives both to the screen and to a file called outputFileName. The name comes from a plumbing T-junction that splits a flow in two directions.

After this step the researcher had around 4,000 unique domains that have either Facebook Inc or [redacted] in their WHOIS record.

Image for post
Image for post From the original on medium.com

The report adds a tip: you can find even more by picking another field that is common across the domains you already have, rather than the registrant email or name.

Step 4: keeping only domains that actually exist

A domain name in a WHOIS record does not guarantee that the domain still works. It may have expired, or its DNS may have been removed. DNS, the Domain Name System, is the internet's address book: it translates a name like example.com into the numeric address of a server. If a domain has no working DNS entry, nothing will load when you visit it.

The researcher used filter-resolved to keep only the domains that resolve, meaning the ones whose DNS still points somewhere:

Bash
cat fb2.txt | ~/tools/filter-resolved |tee live-domains.txt

Line by line:

  • cat fb2.txt prints the contents of the file fb2.txt, which holds the domain list.
  • | passes that list to the next command.
  • ~/tools/filter-resolved runs the filter-resolved tool from the tools folder in the user's home directory. It reads domain names and outputs only those that resolve.
  • |tee live-domains.txt writes the surviving domains both to the screen and to a file called live-domains.txt.

Why this step? Because the next stage, finding subdomains, is slow. There is no point spending time on domains that no longer exist.

Step 5: finding subdomains

A subdomain is a name that sits under a main domain. In www.buckbuild.com, the main domain is buckbuild.com and www is the subdomain. Companies use subdomains for different services: mail.example.com for email, shop.example.com for a store, and so on. Each subdomain can point at a completely different server.

The researcher ran subfinder against the list of live domains:

Bash
subfinder -dL live-domains.txt -o subdomains.txt

Line by line:

  • subfinder is the tool being run.
  • -dL live-domains.txt tells it to read a list of domains from the file live-domains.txt. The capital L stands for list; without it, you would give a single domain with -d.
  • -o subdomains.txt tells it to save the results to a file called subdomains.txt.

The researcher then repeated the resolution step on the subdomain output, so that only subdomains that actually resolve remained. Same reason as before: filter out the dead ends early.

Step 6: taking screenshots of everything

The last automated step was webscreenshot, which visits each subdomain and saves a picture of what appears.

Why screenshots? Because reading thousands of names tells you very little, but a glance at a picture can show instantly that something is wrong. A page showing a hosting provider's error message, a default placeholder, or content unrelated to the company is a strong hint that the subdomain is pointing at something nobody is looking after.

While going through the screenshots, the researcher spotted www.buckbuild.com.

Image for post
Image for post From the original on medium.com

Step 7: confirming the takeover

A suspicious screenshot is only a lead. To confirm a real takeover, you need to show that you can actually put your own content on the address.

Following the takeover-proofs article, the researcher uploaded something to the third-party service that the subdomain pointed at. The report does not name the service, the type of DNS record, or the exact content uploaded. The test was simple: if the upload appears when you visit the subdomain, then the subdomain is serving content from a resource that an outsider can claim.

The researcher reports that the takeover was confirmed.

Image for post
Image for post From the original on medium.com

Step 8: the proof of concept

The proof of concept is presented as a screenshot. In bug bounty terms, a proof of concept (often shortened to PoC) is the evidence that a bug is real: not a theory, but a demonstration that produces the claimed result.

Image for post
Image for post From the original on medium.com

Step 9: reporting and the timeline

The finding was reported to Facebook and handled on this schedule:

Date Event
July 08 Initial report
July 11 Report triaged
July 12 Fixed
July 17 Bounty awarded, $500

"Triaged" means the security team reviewed the report and confirmed it was a genuine issue worth acting on. The fix came one day later, and the payment five days after that.

Image for post
Image for post From the original on medium.com

Why this kind of bug happens

A subdomain takeover happens when a subdomain's DNS record still points at a service run by a third party, but the company no longer has an account or resource there. The third party keeps the address available, and anyone who signs up can claim it. The old name then serves the new owner's content.

A useful comparison is a forwarding address. If a company moves office but leaves a mail forwarding order pointing at a mailbox it no longer rents, whoever rents that mailbox next receives the company's post. Here, the "mailbox" is a spot on a third-party service, and the "post" is anyone visiting the subdomain.

What the impact is

Someone who claims the dangling resource can serve their own content on a hostname that belongs to Facebook. The report does not list specific abuse scenarios, and the real impact depends on what the subdomain is used for and who trusts it. The report records a $500 bounty and a fix one day after triage.

How it was fixed

Facebook fixed the issue on July 12, one day after triage. The usual remedy for this class of bug is to remove or repoint the dangling DNS record.

Other ways to try the same approach

  • Repeat the reverse WHOIS search with other common WHOIS fields, such as the registrant organisation or technical contact, and merge the results. A good sign is a larger unique domain set than the email or name search alone.
  • Run the same resolve, enumerate and screenshot pipeline against other large organisations that buy a lot of companies. A good sign is a subdomain worth investigating further.
  • For each candidate, try to claim the backing resource on the third-party service and upload a marker file. A good sign is the marker appearing on the subdomain, which is the proof method used here.
  • Revisit screenshot sets that look uniform. The researcher notes that the screenshots initially all looked the same and the finding was only made on a second pass a few days later, so a slow, deliberate review of the same output is itself worth repeating.

A closing note from the researcher

The researcher admits that after the screenshots were taken, they did not bother to look at them, because they all looked the same. The thought was that other hunters had probably already checked those domains, so there was no point. Two or three days later, they looked again, and that is when the takeover was found. The lesson offered is to believe in yourself: the fact that others are looking at the same thing does not mean your chance of finding something is lower.

Glossary

  • Bug bounty programme: a scheme where an organisation pays people who find and report security problems in its systems.
  • Hall of fame: a public list of researchers who have reported valid issues, used as recognition.
  • In scope: the parts of a company's systems that the programme's rules allow you to test.
  • Domain name: the address you type into a browser, such as example.com.
  • Subdomain: a name that sits under a main domain, such as www in www.example.com.
  • WHOIS: the public registration record of a domain name, showing who registered it and how to contact them.
  • Registrant email: the contact email address in a domain's WHOIS record.
  • Registrant name: the name of the organisation or person who registered a domain, as recorded in WHOIS.
  • Reverse WHOIS: searching WHOIS records by a piece of information, such as an email, to find every domain that contains it.
  • Horizontal domain correlation: finding related domains by looking for shared details across their records, rather than by guessing names.
  • DNS (Domain Name System): the internet's address book, translating names like example.com into the numeric addresses of servers.
  • Resolve: for a domain name, to have a working DNS entry that points somewhere.
  • DNS record: an entry in DNS that says where a name should go.
  • Dangling DNS record: a DNS record that still points at a third-party resource that the owner no longer controls.
  • Subdomain takeover: claiming a dangling resource so that your own content appears on someone else's subdomain.
  • Third-party service: an outside company whose platform hosts something on your behalf, such as a website builder or hosting provider.
  • Screenshot: a saved picture of what a web page looks like.
  • Proof of concept (PoC): evidence that a bug is real, usually a demonstration that produces the claimed result.
  • Triaged: reviewed and confirmed by the security team as a genuine issue.
  • Bounty: the payment a programme gives for a valid report.
  • Command line: a text interface where you type commands instead of clicking buttons.
  • Pipe (|): a command-line symbol that passes the output of one command as input to the next.
  • sort: a command that sorts lines of text alphabetically.
  • uniq: a command that removes adjacent duplicate lines.
  • tee: a command that writes its input both to the screen and to a file.
  • cat: a command that prints the contents of a file.
  • -dL: a subfinder option meaning "read a list of domains from a file".
  • -o: a common command-line option meaning "write output to this file".
  • filter-resolved: a tool that keeps only domain names that resolve.
  • subfinder: a tool that finds subdomains of a domain.
  • webscreenshot: a tool that visits web addresses and saves a screenshot of each.
  • domlink and amass: command-line tools that can perform horizontal domain correlation.
  • viewdns.info: a website offering reverse WHOIS and other DNS lookups, with limited results according to the report.
  • whoisxmlapi reverse WHOIS search: a website for searching WHOIS records backwards by email, name or other fields.

More by Sudhanshu Rajbhar

View all

1 more disclosed report, best first.

More from Meta

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Subdomain takeover

The lesson behind this report.

A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.