Skip to content
Subdomain takeover Write-up Intermediate

How I made 300 GitHub repos point to my blog using Azure subdomains takeover

Many GitHub repositories referenced azurewebsites.com subdomains that were no longer registered, so the author was able to claim roughly 300 of them in the Azure portal and serve a page that redirected visitors to his own blog. The result was that anyone following those stale links landed on attacker-controlled content.

0xPwN Follow

Published on 0xpwn.wordpress.com

Playing around in Azure portal, I saw that it is pretty easy to register/unregister an azurewebistes.com subdomain while deploying an application. The idea that came into my mind was “how many references to azurewebistes.com are out there which are no longer maintained, and are available for takeover?”

0xPwN (@msd0s7), on 0xpwn.wordpress.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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Azure App Service subdomains were released when the original apps were deleted, but the GitHub repositories kept linking to them, so the names could be re-registered by anyone.

Impact

Visitors following stale links in those repositories could be redirected to the author's blog, though the traffic gained was low because most repositories were old and unpopular.

What the attacker needed

Azure account with paid plan; Stale links in public repos; Subdomains unregistered

The fix

Repository owners should remove or update links to deleted Azure app subdomains, and organisations should monitor for dangling cloud resource names.

How it was found

  1. Search GitHub for pages mentioning azurewebsites.com and capture the responses.
  2. Extract the subdomain URLs from the saved responses with text processing.
  3. Check each subdomain's availability through the Azure portal registration request.
  4. Deploy a static HTML page with a JavaScript redirect to each available subdomain.
  5. Host the redirect script in a Blob container so it can be changed centrally.
  6. Register the subdomains in bulk with a script and observe incoming traffic.

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 write-up has not been written yet. The Original tab links to the source.

When a website is hosted on a cloud service, it gets a unique name under the provider's domain. If the owner deletes the site but other pages still link to that name, anyone can sign up for the same name and put their own content there. This is called subdomain takeover, and here it let the author capture traffic from old links.

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.

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.