Subdomain Takeover for rtncf-rci.ral.r4.fws.gov
A subdomain of fws.gov had a CNAME record pointing to an expired external domain, allowing an attacker to register that domain and control the subdomain. The attacker could then host malicious content on the official-looking subdomain.
U.S. Fish and Wildlife Service
Originally disclosed on Bugcrowd
- Accepted in 3 hours
- Fixed in 17 hours
- Disclosed after 6 days
Summary by U.S. Fish and Wildlife Service
An organizational subdomain pointed to a now defunct external domain previously hosted on behalf of the organization. When the site was no longer needed/funded, a DNS CNAME remained in the public DNS record until this was identified.
Summary by thelicato
Description
You have a subdomain aka rtncf-rci.ral.r4.fws.gov has a CNAME record that points to a .org domain (to be more specific it was pointing to rtncf-rci.ncusfws.org). The nslookup command shows the DNS configuration.
nslookup rtncf-rci.ral.r4.fws.gov 8.8.8.8
The .org domain, on the other hand, was free and an attacker can buy it and take possession of the .gov domain. In fact I bought it (for just 7 dollars) and created a simple HTML PoC with a link to my BugBounty profiles. In fact if you execute the nslookup now you will see that the .gov domain points to the .org domain (the one I bought) which in returns points to my GitHub page (I did not want to spend money on a hosting so I used a free GitHub page).
Risk
A subdomain takeover is pretty risky, especially for gov websites because the user assumes that it is on the correct domain, here is a list of the major risks of subdomain takeover:
- fake website
- malicious code injection
- users tricking
- company impersonation This issue can have really huge impact on the companies reputation someone could post malicious content on the compromised site and then your users will think it's official but it's not.
PoC
Visit https://rtncf-rci.ral.r4.fws.gov
Remediation
Remove the CNAME entry. As soon as you remove the CNAME entry I will delete the GitHub page.
See also
- https://labs.detectify.com/2014/10/21/hostile-subdomain-takeover-using-herokugithubdesk-more/
- https://0xpatrik.com/subdomain-takeover/
- https://medium.com/@ajdumanhug/subdomain-takeover-through-external-services-f0f7ee2b93bd
- http://yassineaboukir.com/blog/neglected-dns-records-exploited-to-takeover-subdomains/
Additional note
As I said before as soon as you remove the CNAME entry I will delete the GitHub page.
Best regards,
thelicato
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a dangling CNAME record pointing to an external domain that was no longer registered by the organisation.
Impact
An attacker could host fake or malicious content on a government subdomain, tricking users and damaging the organisation's reputation.
What the attacker needed
The external domain must be unregistered; Attacker must register the domain
The fix
The CNAME entry should be removed from DNS.
How it was found
- Run nslookup on the subdomain to see its DNS configuration.
- Observe that the subdomain has a CNAME record pointing to an external .org domain.
- Check that the .org domain is available for registration.
- Register the .org domain and set up a simple web page.
- Visit the subdomain to confirm it now serves the attacker's content.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A subdomain is a prefix like 'blog' in blog.example.com. A CNAME record is a DNS setting that says 'this name is an alias for another name'. If the other name is no longer owned by the organisation, anyone can buy it and take over the subdomain.
What is Subdomain takeover?
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.