Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft Azure proofs #35

Open
PatrikHudak opened this issue Sep 12, 2018 · 148 comments
Open

Microsoft Azure proofs #35

PatrikHudak opened this issue Sep 12, 2018 · 148 comments
Labels
vulnerable Someone has provided proof in the issue ticket that one can hijack subdomains on this service.

Comments

@PatrikHudak
Copy link

PatrikHudak commented Sep 12, 2018

Service name

Microsoft Azure

Proof

There is no general approach for PoC. Microsoft Azure offers multiple services (CloudApp, Azure Websites, etc.) that use different domain names.

General approach in verifying subdomain takeover is to check, whether the Azure domain responds with NXDOMAIN DNS status. This is (to my knowledge) the necessary condition of the domain, however it is not sufficient. In other words, not all Azure domains which are used in some CNAME and respond with NXDOMAIN are vulnerable to subdomain takeover. I personally got a case where Azure portal refused to create a domain even though it responded with NXDOMAIN.

Some H1 reports to prove this point:

As mentioned before, the PoC creation depends on the service in question, however, they generally tend to have similar workflows.

Documentation

These are the domains that are identified as vulnerable. Each of these is used for particular Azure service:

  • *.cloudapp.net
  • *.cloudapp.azure.com
  • *.azurewebsites.net
  • *.blob.core.windows.net
  • *.cloudapp.azure.com
  • *.azure-api.net
  • *.azurehdinsight.net
  • *.azureedge.net
  • *.azurecontainer.io
  • *.database.windows.net
  • *.azuredatalakestore.net
  • *.search.windows.net
  • *.azurecr.io
  • *.redis.cache.windows.net
  • *.azurehdinsight.net
  • *.servicebus.windows.net
  • *.visualstudio.com
@EdOverflow EdOverflow added the vulnerable Someone has provided proof in the issue ticket that one can hijack subdomains on this service. label Sep 13, 2018
@Sechunt3r
Copy link

Hi All,
Hope you are good!

if a Azure Domain not Respond with NXDOMAIN that means it is not Vulnerable.
But if it shows this ;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR,

Then what would be the answer is it vulnerable or not!

Hope you understand my points

Regards
Shivam

@codingo
Copy link
Collaborator

codingo commented Oct 21, 2018

Linked back on the main repository, closing this as @Sechunt3r's comment is already addressed in @PatrikHudak's summary.

@codingo codingo closed this as completed Oct 21, 2018
@ghsec
Copy link

ghsec commented Feb 27, 2019

if subdomain return public IP is possible subdomain takeover?

@sumgr0
Copy link

sumgr0 commented Mar 3, 2019

If the sub-domain points to traffic manager service for Azure, is the takeover possible? When attempting to create a traffic manager profile using the same name as in the CNAME, getting error which mentions "Domain name xyz.trafficmanager.net already exists. Please choose a different DNS prefix".

Has Microsoft patched the service or am I doing something wrong?

Thanks

@PatrikHudak
Copy link
Author

@sumgro Microsoft haven't patched the service and you are doing everything ok.

You are getting a error message because the Traffic Manager profile actually EXIST, so you are unable to claim it. When you make a DNS request to *.trafficmanager.net and get NXDOMAIN there are two possible outcomes:

  1. The Traffic Manager with requested name really don't exist - you can go ahead and register it. In this context it is likely that the Subdomain Takeover is possible.
  2. (From my own testing) Traffic Manager profile can be created, however there is no requirement to assign it any endpoints by default. Traffic Manager (as the name) implies is trying to distribute network traffic using different settings and acts just as a middleman. This means that in order it to work, you need to set up endpoints (a.k.a. FQDN) where the traffic will be forwarded once the user reaches to something.trafficmanager.net. Now to the core of the problem: When there is no endpoint assigned in the profile, you will get the same NXDOMAIN response as you would get with non-existing TM profile. In this case, you won't be able to take in over because the TM profile with the name in CNAME record actually exist, it just seems that the profile does not exist.

It is pretty easy to setup a automation for that using Azure API. You would need to test a creation of particular TM profile and not rely only on DNS request as some external indicator of TM profile existence.

Hope it helps.

@sumgr0
Copy link

sumgr0 commented Mar 3, 2019

Thank you for the revert @PatrikHudak, really appreciate the detailed reply.

I'm fairly new to the subdomain takeover subject. When testing for the subdomain in question, the dig <subdomain.domain.com> confirmed the error NXDOMAIN (thereby bringing a smile) and then the CNAME pointed to xyz.trafficmanager.net.

From your reply, I understand that the profile already exists with the same name as the CNAME, even when the end-point may not have been setup, this results in the error message both when visiting the link and through the dig command. Hence, the takeover for in this situation may not be successful.

Not able to get the pointers on the Azure API for automation, kindly point in the direction to be able to research more on the topic to get an understand for future hunting.

Thanks

@sumgr0
Copy link

sumgr0 commented Mar 21, 2019

I've come across a sub-domain, pointing to an azure web app service. This CNAME itself has 3 levels like xyz.abc.m.azurewebsites.net. It shows the NXDOMAIN error when checking with dig.

However, when I try to create the App on the Azure Portal as xyz.abc.m to takeover, it does not allow periods in the same. Anyone aware of how can such scenario be handled for sub-domain takeover?

Thanks

@nikokosm
Copy link

nikokosm commented Mar 28, 2019

I also faced this. I found a subdomain that resolved to xyz.easteurope.cloudapp.azure.com and could not use the . character. Anyone else got around this?

Edit: turns out you could take over this by registering an Azure VM in the easteurope region ;)

@sumgr0
Copy link

sumgr0 commented Mar 28, 2019

found this in relation to the above, but haven't been able to go through in details to understand:
https://docs.microsoft.com/en-us/azure/app-service/environment/using-an-ase

@AdmiralGaust
Copy link

I found a subdomain pointing to 104.211.97.138. The ip certificate is issued to *.azurewebsites.net and the subdomain does not contain txt record.

Is it vulnerable to subdomain takeover?

@codingo codingo mentioned this issue Sep 5, 2019
@marcelo321
Copy link

marcelo321 commented Dec 26, 2019

I think it is a Edge case too.

;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 2616
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

"Domain name redacted.trafficmanager.net already exists. Please choose a different DNS prefix."

@marcelo321
Copy link

Can anyone confirm if this isn't possible or im just stupid?

when tryin to claim a CNAME with multiple levels like abc.aaa.azurewebsite.net i get

. is an invalid character

this means it is only possible to claim 1 level subdomains like abc.azurewebsite.net?

@hamzaavvan
Copy link

Which azure service gives us mysubdomain.windows.net ?
Any help would be appreciated.

@chiko360
Copy link

how can i claim this *.cloudapp.azure.com ?

@davisfreimanis
Copy link

how can i claim this *.cloudapp.azure.com ?

You can simply create a Virtual Machine in the specific region and then in the left menu select "Configure" and set a desired DNS name label.

The format of the URL will be:
<dnsname>.<region>.cloudapp.azure.com

@stark0de
Copy link

Does anyone know if it is possible to claim *.azurewebsites.us domains?

@adityathebe
Copy link

adityathebe commented May 16, 2020

Is this still vulnerable ? Because Azure requires a unique Custom Domain Verification ID to be put as a TXT record in the DNS.

image

Until the TXT record is configured the following error will show up

image

I have only tried this for Web Apps (.azurewebsites.net)

Repository owner deleted a comment May 20, 2020
@EdOverflow
Copy link
Owner

@EdOverflow EdOverflow added not vulnerable Someone has made it very clear that this service is not vulnerable to subdomain takeovers. and removed vulnerable Someone has provided proof in the issue ticket that one can hijack subdomains on this service. labels May 20, 2020
@EdOverflow EdOverflow reopened this May 20, 2020
@EdOverflow
Copy link
Owner

Never mind, it’s still vulnerable. Just observed one get snatched live. 😂

@EdOverflow EdOverflow removed the not vulnerable Someone has made it very clear that this service is not vulnerable to subdomain takeovers. label May 20, 2020
@mcipekci
Copy link

mcipekci commented Feb 24, 2023 via email

@vitorfhc
Copy link

vitorfhc commented Mar 7, 2023

Azure Cloud Services (classic) is not vulnerable anymore because they don't let me upload a deployment using it. They are enforcing the new version, which, afaik is not vulnerable.

@Hacktus
Copy link

Hacktus commented Mar 7, 2023

*.azurewebsites.net still vulnerable, took over another one by following : https://godiego.co/posts/STO-Azure/#azure-websites

@brad-ak
Copy link

brad-ak commented Mar 10, 2023

Azure Cloud Services (classic) is not vulnerable anymore because they don't let me upload a deployment using it. They are enforcing the new version, which, afaik is not vulnerable.

I'm seeing the same. When using cloud services (extended support), it will deploy, but will not claim the cname in DNS. It allows for a custom domain, but that gives you a region.cloudapp.azure.com address, instead of a cloudapp.net address.

@Xib3rR4dAr
Copy link

*.azurewebsites.net takeover is still possible, tookover 2 domains. (Vulnerable domain must not have a TXT record containing asuid.{vulnerablesubdomainhere})

@marcelo321
Copy link

I am finding more and more un-exploitable cases, not sure what's going on.

@molitona
Copy link

molitona commented Mar 26, 2023

can southeastasia.cloudapp.azure.com be taken over? i haven't found southeastasia in regions with my azure for students subs when creating a vm ?

@supr4s @akincibor @4c1d8urn-eh @brad-ak @vitorfhc

@digitaloceansnssn
Copy link

I am not getting any successful takeovers on *.{region}.cloudapp.azure.com and *.trafficmanager.net Looks like these takeovers are dying :(

@damaidec
Copy link

damaidec commented May 3, 2023

for *.cloudapp.net will this be possible for subdomain take over ? since Cloud Services (classic) is now deprecated and will retire on August 31, 2024. Currently im trying to make a PoC for cloudapp.net using Cloud Service classic but it seems like there's error on deployment which gave conflict error, status code 409

tried also creating creating Cloud service extended support but looks like its not possible for STO for now

Stanislav Zhelyazkov said
This means that you cannot longer deploy Cloud Services (classic) on new subscriptions/tenants. You can only manage existing deployments of those until August 31st, 2024.

references
https://learn.microsoft.com/en-us/answers/questions/1166622/unable-to-deploy-cloud-services-classic

https://learn.microsoft.com/en-us/answers/questions/1034947/classic-cloud-services-deployment-update-before-mi?orderby=newest

https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-update-azure-service

@pdelteil
Copy link
Contributor

pdelteil commented May 3, 2023

for *.cloudapp.net will this be possible for subdomain take over ? since Cloud Services (classic) is now deprecated and will retire on August 31, 2024. Currently im trying to make a PoC for cloudapp.net using Cloud Service classic but it seems like there's error on deployment which gave conflict error, status code 409

tried also creating creating Cloud service extended support but looks like its not possible for STO for now

Stanislav Zhelyazkov said This means that you cannot longer deploy Cloud Services (classic) on new subscriptions/tenants. You can only manage existing deployments of those until August 31st, 2024.

references https://learn.microsoft.com/en-us/answers/questions/1166622/unable-to-deploy-cloud-services-classic

https://learn.microsoft.com/en-us/answers/questions/1034947/classic-cloud-services-deployment-update-before-mi?orderby=newest

https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-update-azure-service

You are right. In order for this to work is to find an account that had the classic services before the change. So, chances you will find an account with those characteristics are very low.

@xafirk
Copy link

xafirk commented Jul 5, 2023

*.windows.net Is this vulnerable?

@Owatron
Copy link

Owatron commented Jul 14, 2023

Found a subdomain which I feel like its vulnerable to subdomain takeover , It doesnt have a cname record but has A record and TXT record TXT record points *.azurewebsites.net is it vulnerable ? New to subdomain takeover , appreciate the help!

@xcapri
Copy link

xcapri commented Jul 17, 2023

Hey I found a subdomain with cname *.region.cloudapp.azure.com
and when trying to take over I got an error: DNS name label not available. Try using a different label.

So this is not a vuln or a misstep ?

@marcelo321
Copy link

Seems like azure isn't vulnerable anymore, I was one of the hunters who submitted a few reports per week, now almost nothing at all. Azure made changes to prevent insta takeovers

@Wheelsinn001
Copy link

*.windows.net Is this vulnerable?

Were you able to takeover? I am stuck with an enterpriseregistration.windows.net

@randyranderson
Copy link

Hi,
I have various *.cloudapp.net subdomains registered but I cannot seem to deploy a proof.

Does anyone have any up to date instructions on creating PoC code for cloud services?

This method in this article is out of date and the code no longer works
https://godiego.co/posts/STO-Azure/

@4nibhal
Copy link

4nibhal commented Sep 25, 2023

I'm pretty sure Microsoft has fixed this one at least on region.cloudapp.azure.com and azurewebsites.net.
I have tried to make 2 acquisitions, but now there are filters preventing the acquisition.

@EzequielPuig
Copy link

EzequielPuig commented Sep 27, 2023

Definitions.

VULNERABLE -> this subdomain can be taken over the 100% of the times, with no limitations whatsoever, allowing a full Subdomain Takeover or some sort of Subdomain Takeover that contemplates the possibility of a valid vulnerability, affecting somehow the owner of the subdomain.

EDGE CASE -> this subdomain can be taken over, but there are some limitations. These limitations vary significantly depending on the resource/service provider and an indefinite number of external causes. The statistical probability of a Subdomain Takeover decreases significantly, however there is still a possibility through some sort of workaround/bypass/configuration/scenario/etc.

NO LONGER VULNERABLE -> this subdomain was vulnerable in the near/distant past, but it is not anymore, for whatever reason (remediations, etc). You will find tons of information on the internet, that will lead you to absolutely nowhere. So stop wasting your precious time and move on.

NOT VULNERABLE -> this subdomain cannot be taken over, under absolutely no circumstances, with no bypasses, no workarounds, no nothing whatsoever.

NO INFORMATION -> there is no information yet as to whether a Subdomain Takeover is possible or not.

Azure Service Endpoints.

CNAME Record of a Subdomain pointing to:

*.azurewebsites.net | EDGE CASE
*.azure-api.net | EDGE CASE
*.cloudapp.azure.com | EDGE CASE
*.cloudapp.net | NO LONGER VULNERABLE
*.trafficmanager.net | NO LONGER VULNERABLE

for all effects, if a Service Endpoint is not on this list, consider it NO INFORMATION, until further updates.

Relevant Information.

this list is updated frequently.

last update: 03/October/2023

if doubts/comments/suggestions, contact via LinkedIn https://www.linkedin.com/in/ezequielpuig/

@zy9ard3
Copy link

zy9ard3 commented Oct 4, 2023

Changes :

*.azurewebsites.net | EDGE CASE => *.azurewebsites.net | NO LONGER VULNERABLE ( Enforced mandatory TXT verification )

@EzequielPuig
Copy link

@zy9ard3

It's true that on some occasions a mandatory TXT verification is needed to perform the Subdomain Takeover. However, there are still some situations in which this is not the case and the takeover can be done without this verification.

@zy9ard3
Copy link

zy9ard3 commented Oct 4, 2023

@EzequielPuig

However, there are still some situations in which this is not the case and the takeover can be done without this verification

Kindly can you elaborate the scenario please which will be helpful to the community !!!

@mohamed-faris
Copy link

can someone please provide me step by step how to make the takeover
because I didn't know how to use azure

@Owatron
Copy link

Owatron commented Oct 8, 2023

is azurewebsites.net not vulnerable now ? filters are blocking takeover

@4nibhal
Copy link

4nibhal commented Oct 8, 2023

In *azurewebsites.net, there is also a verification of DNS records.
Still try it always, and if you find something different you could share it with the community :D

@mohamed-faris
Copy link

image
what about this

@PH-Apolonio
Copy link

hey guys, is this still vulnerable to subdomain takeover?
Screenshot 2023-10-11 180044

@4nibhal
Copy link

4nibhal commented Oct 14, 2023

@PH-Apolonio hey hey could you climb that?
have you been able to takeover?

@pdelteil
Copy link
Contributor

Guys, traffic manager is not vulnerable since at least 2 years.

@devbertram
Copy link

devbertram commented Oct 31, 2023

Hi everyone. is *.azureedge.net still vulnerable? Tried some approach via CDN Profile and not working.
Screenshot 2023-10-31 230502
Screenshot 2023-10-31 232233

@xMrEhAcKeR
Copy link

Hello Guys, hope you're all good!.
I found *.southafricanorth.cloudapp.azure.com and the server status is showing NXDOMAIN, I wonder if this is sill available to takeover. i spent 2 days trying =_=l

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vulnerable Someone has provided proof in the issue ticket that one can hijack subdomains on this service.
Projects
None yet
Development

No branches or pull requests