can-i-take-over-xyz icon indicating copy to clipboard operation
can-i-take-over-xyz copied to clipboard

Microsoft Azure proofs

Open PatrikHudak opened this issue 5 years ago • 159 comments

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:

  • https://0xpatrik.com/subdomain-takeover-starbucks/ (HackerOne: https://hackerone.com/reports/325336)
  • https://0xpatrik.com/subdomain-takeover-starbucks-ii/ (HackerOne: https://hackerone.com/reports/388622)

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

PatrikHudak avatar Sep 12 '18 11:09 PatrikHudak

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

Sechunt3r avatar Sep 28 '18 09:09 Sechunt3r

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

codingo avatar Oct 21 '18 09:10 codingo

if subdomain return public IP is possible subdomain takeover?

ghsec avatar Feb 27 '19 06:02 ghsec

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

sumgr0 avatar Mar 03 '19 15:03 sumgr0

@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.

PatrikHudak avatar Mar 03 '19 16:03 PatrikHudak

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 avatar Mar 03 '19 17:03 sumgr0

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

sumgr0 avatar Mar 21 '19 02:03 sumgr0

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 ;)

nikokosm avatar Mar 28 '19 00:03 nikokosm

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

sumgr0 avatar Mar 28 '19 00:03 sumgr0

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?

AdmiralGaust avatar Sep 01 '19 08:09 AdmiralGaust

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 avatar Dec 26 '19 17:12 marcelo321

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?

marcelo321 avatar Dec 27 '19 14:12 marcelo321

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

hamzaavvan avatar Apr 01 '20 10:04 hamzaavvan

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

chiko360 avatar Apr 16 '20 18:04 chiko360

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

davisfreimanis avatar Apr 29 '20 06:04 davisfreimanis

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

stark0de avatar May 11 '20 17:05 stark0de

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)

adityathebe avatar May 16 '20 15:05 adityathebe

https://docs.microsoft.com/en-us/microsoft-365/admin/dns/create-dns-records-for-azure-dns-zones

@adityathebe, it appears that this is no longer vulnerable. :(

EdOverflow avatar May 20 '20 18:05 EdOverflow

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

EdOverflow avatar May 20 '20 18:05 EdOverflow

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

😮 How was the TXT verification bypassed ?

EDIT Nevermind

adityathebe avatar May 20 '20 18:05 adityathebe

Any hints of how to bypass the TXT verification?

sumgr0 avatar May 26 '20 14:05 sumgr0

Any hints of how to bypass the TXT verification?

@sumgr0 It's not required.

adityathebe avatar May 26 '20 16:05 adityathebe

@adityathebe Okay...thanks for the quick revert.

sumgr0 avatar May 26 '20 18:05 sumgr0

Hello all i found a subdomain which is pointing to cloudapp.net.But when i tried to takeover i got false any one can help or reply me with this i'll gave you that domain

D1rk9ghT avatar May 28 '20 06:05 D1rk9ghT

when i try to add custom domain it says add verification id in txt record please tell how can i add custom domain without txt record verification @PatrikHudak

D1rk9ghT avatar May 28 '20 06:05 D1rk9ghT

Hello everyone, I was following @PatrikHudak steps in this blog https://0xpatrik.com/subdomain-takeover-starbucks/ to takeover cloudapp.net subdomain but when I deploy my cloud service I get the following error. "The requested VM tier is currently not available in Central India for this subscription. Please try another tier or deploy to a different location." Anyway to bypass it

Update: Was able to takeover by just changing the region to something else.

yashswarup12 avatar May 28 '20 21:05 yashswarup12

Can i takeover abc.xxx.com (not found) subdomain if it is pointing to clientconfig.microsoftonline-p.net?

Lolz246 avatar Jun 02 '20 19:06 Lolz246

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

hey @stark0de Did you found any way to claim *.azurewebsites.us?

Avileox avatar Jun 06 '20 08:06 Avileox

Hey @Lolz246

You found anything regarding that? I've also found a subdomain pointing to clientconfig.microsoftonline-p.net

theinfosecguy avatar Jun 06 '20 20:06 theinfosecguy

Hey! I just found a subdomain pointing to azurefd.net, investigations show that its azures (front door) service, you can do subdomain takeover on this domain type. You can use the backend pool to point to a resource you own.

PR3R00T avatar Jul 24 '20 09:07 PR3R00T

@PatrikHudak I think you should also add .trafficmanager.net is the list of vulnerable services on Azure.

FaizanNehal avatar Aug 13 '20 15:08 FaizanNehal

hey all.

dig on a subdomain responds with a status: NOERROR, and the cname points to *.azurewebsites.net.

is it vulnerable for takeover?

image

Regards, Che

chaitu577 avatar Sep 02 '20 17:09 chaitu577

I've seen the comments of all participants and few are in doubt that Azure takeover is not vulnerable anymore.

But let me assure you the takeover is certainly possible and I've confirmed it on microsoft.com domain, if you don't want to believe my comment then go to this link "http://smpaccountexceptionservice-int.dps.microsoft.com"

Is Azure Takeover still vulnerable?

The above screenshot was taken on Oct 02, 2020, for PoC purposes and can be confirmed below that Azure Takeover is still vulnerable & possible microsoft_PoC

ravkishu avatar Oct 10 '20 06:10 ravkishu

hey all.

dig on a subdomain responds with a status: NOERROR, and the cname points to *.azurewebsites.net.

is it vulnerable for takeover?

image

Regards, Che

You need to try to add the subdomain using the Azure portal under Custom domains

Uploading Screenshot from 2020-10-13 00-17-19.png…

pdelteil avatar Oct 13 '20 03:10 pdelteil

Hey, How can I claim this? - *.azurewebsites.net Provide steps please I am stuck

https://blog.cystack.net/subdomain-takeover-chapter-two-azure-services/

pdelteil avatar Oct 16 '20 17:10 pdelteil

Where are you getting stuck?

Best, Sumit Grover

On 16 Oct 2020, at 23:11, Philippe Delteil wrote:

Hey, How can I claim this? - *.azurewebsites.net Provide steps please I am stuck

https://blog.cystack.net/subdomain-takeover-chapter-two-azure-services/

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/EdOverflow/can-i-take-over-xyz/issues/35#issuecomment-710293926

sumgr0 avatar Oct 16 '20 17:10 sumgr0

Hi everyone!

I've found subdomain that can be taken over and which is registered on *azurewebsites.net. I'm getting this in return when I type dig command:

image

But when I register website on the portal.azure.com -> Custom Domain Names it is still asking me to define TXT or MX, but I'm not allowed to do that. Status of claimed domain is "Unverified" and I don't know what to do next.

image

Next thing is when I'm adding custom domain and when I try to enter CNAME of that domain, I'm getting in return message which says: "The value must have a length of at most 48." because that link of the CNAME is very long.

Can someone give me a hint what to do next in order to claim this subdomain?

Thanks in advance guys!

h4ckdi avatar Nov 03 '20 08:11 h4ckdi

I dont think this is a vulnerbale case anymore. You can see above how I asked for help on the same but didnt get any replies and my case is still the same. I tried a lot but couldnt make it work :(

savirsuda avatar Nov 22 '20 18:11 savirsuda

App services (ending with *.azurewebsites.net) does not seem to be vulnerable anymore with the TXT verification as stated here https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain#get-a-domain-verification-id.

A TXT record is required to verify ownership of the domain. I cannot get it to work. Can anyone confirm this?

Screenshot 2020-12-07 at 16 29 27

davisfreimanis avatar Dec 07 '20 15:12 davisfreimanis

@ravkishu Then can you explain what is correct and what not? You are not helping, we know it's wrong because it doesn't work :)

h4ckdi avatar Dec 07 '20 15:12 h4ckdi

@ravkishu Well I need to create a CNAME and a TXT record on the victims domain (let's say google.com). There is no way that I can verify the ownership of the domain by creating a TXT record.

I would gladly hear from you to understand how this could be bypassed.

davisfreimanis avatar Dec 07 '20 15:12 davisfreimanis

@ravkishu Well I need to create a CNAME and a TXT record on the victims domain (let's say google.com). There is no way that I can verify the ownership of the domain by creating a TXT record.

I would gladly hear from you to understand how this could be bypassed.

https://github.com/EdOverflow/can-i-take-over-xyz/issues/35#issuecomment-634139457

adityathebe avatar Dec 07 '20 16:12 adityathebe

For your reference @savirsuda @davisfreimanis @h4ckdi @adityathebe, I can only provide you a link as a proof of concept http://smpaccountexceptionservice-int.dps.microsoft.com/ or click this link if you're visiting this issue in late 2021

Also, let's take this conversation out of GitHub because I don't want to annoy people with so many messages.

Those who need assistance can WhatsApp me on @ravkishu or drop me a mail on [email protected]

ravkishu avatar Dec 07 '20 16:12 ravkishu

@ravkishu Well I need to create a CNAME and a TXT record on the victims domain (let's say google.com). There is no way that I can verify the ownership of the domain by creating a TXT record. I would gladly hear from you to understand how this could be bypassed.

#35 (comment)

Without the validation, traffic is not routed to the app service. In that case I am presented with a 404 screen as people has posted previously.

davisfreimanis avatar Dec 07 '20 16:12 davisfreimanis

I have verified that Cloud Services (ending with *.cloudapp.net) are still vulnerable and does not require domain validation. Just create a resource with the same name as the dangling domain.

davisfreimanis avatar Dec 08 '20 13:12 davisfreimanis

@ravkishu Well I need to create a CNAME and a TXT record on the victims domain (let's say google.com). There is no way that I can verify the ownership of the domain by creating a TXT record. I would gladly hear from you to understand how this could be bypassed.

#35 (comment)

Without the validation, traffic is not routed to the app service. In that case I am presented with a 404 screen as people has posted previously.

I also stumbled on an *.azurewebsites.net service without the ability to takeover it due to the TXT record verification! was anyone able to bypass it, or does this just confirm that *.azurewebsites.net service is no longer vulnerable?!

xqd-ai avatar Dec 10 '20 23:12 xqd-ai

@ravkishu Well I need to create a CNAME and a TXT record on the victims domain (let's say google.com). There is no way that I can verify the ownership of the domain by creating a TXT record. I would gladly hear from you to understand how this could be bypassed.

#35 (comment)

Without the validation, traffic is not routed to the app service. In that case I am presented with a 404 screen as people has posted previously.

I also stumbled on an *.azurewebsites.net service without the ability to takeover it due to the TXT record verification! was anyone able to bypass it, or does this just confirm that *.azurewebsites.net service is no longer vulnerable?!

Just ignoring TXT validation works fine for me.

bsysop avatar Jan 08 '21 04:01 bsysop

Hey guys, Need your help. One of the subdomains let's say blah.blah.blah.target.com is pointing to blah-blah.azurewebsites.net but in the dig authority section it is pointing to another subdomain of the target but the other subdomain has no name. Is takeover possible for this ? also when navigating to the blah.blah.blah.target.com it says DNS_PROBE_FINISHED_NXDOMAIN ? Thank you

saurabh96216 avatar Jan 14 '21 08:01 saurabh96216

Could you maybe post all of the outputs of your digs? For a clearer picture. @saurabh96216

ethrx avatar Jan 14 '21 10:01 ethrx

I have found something pointing to adverify.beacon.azurefd.net in front door how can i takeover it while making beacon.azurefd.net is not allowed

moein9 avatar Mar 02 '21 17:03 moein9

today I tried to takeover a cname address called * .azurewebsites.net. I got this cname name, but it was necessary to add a custom domain. when i wanted to do this i got a warning and asked me to add TXT records issued by azure to my dns records. Since I was never able to do this, takeover is not possible.

Phoenix1112 avatar Mar 31 '21 11:03 Phoenix1112

today I tried to takeover a cname address called * .azurewebsites.net. I got this cname name, but it was necessary to add a custom domain. when i wanted to do this i got a warning and asked me to add TXT records issued by azure to my dns records. Since I was never able to do this, takeover is not possible.

I was able to do a takeover only a week ago for azurewebsites.net. You aren't doing the takeover correctly. Make sure it is a azure "web app" (costs money to keep online) and then you can add a custom domain.

ethrx avatar Mar 31 '21 14:03 ethrx

today I tried to takeover a cname address called * .azurewebsites.net. I got this cname name, but it was necessary to add a custom domain. when i wanted to do this i got a warning and asked me to add TXT records issued by azure to my dns records. Since I was never able to do this, takeover is not possible.

I was able to do a takeover only a week ago for azurewebsites.net. You aren't doing the takeover correctly. Make sure it is a azure "web app" (costs money to keep online) and then you can add a custom domain.

i know what i'm doing. i did create web app. I wanted to add a domain from custom domain options, but azure gave me a warning telling me to upgrade my plan otherwise I will not be able to add a domain. After upgrading my plan, the add domain button became active and I typed the subdomain name of the target site and clicked the check button. But while doing this, a new warning appeared and gave me some txt information and asked me to add it to the dns records. I turned it off as i could never do this. https was active in the dashboard section. I turned this option off and did the same, but the result was the same.

there is only one thing I have to tell you. example This was the target subdomain address.

awverify.test-bla.target.com

and this example cname

awverify.bla-bla.azurewebsites.net

when i tried to get this address azure did not allow this (awverify.bla-bla)... azure did not allow dot use. so i just tried to get this.(bla-bla)...I just tried to get this address with the hope that I could discover something new. maybe there is a problem with the cname address I want to get.If you think the cname addresses I explained in the example above can be received, we can cooperate.

Phoenix1112 avatar Mar 31 '21 15:03 Phoenix1112

today I tried to takeover a cname address called * .azurewebsites.net. I got this cname name, but it was necessary to add a custom domain. when i wanted to do this i got a warning and asked me to add TXT records issued by azure to my dns records. Since I was never able to do this, takeover is not possible.

I was able to do a takeover only a week ago for azurewebsites.net. You aren't doing the takeover correctly. Make sure it is a azure "web app" (costs money to keep online) and then you can add a custom domain.

i know what i'm doing. i did create web app. I wanted to add a domain from custom domain options, but azure gave me a warning telling me to upgrade my plan otherwise I will not be able to add a domain. After upgrading my plan, the add domain button became active and I typed the subdomain name of the target site and clicked the check button. But while doing this, a new warning appeared and gave me some txt information and asked me to add it to the dns records. I turned it off as i could never do this. https was active in the dashboard section. I turned this option off and did the same, but the result was the same.

there is only one thing I have to tell you. example This was the target subdomain address.

awverify.test-bla.target.com

and this example cname

awverify.bla-bla.azurewebsites.net

when i tried to get this address azure did not allow this (awverify.bla-bla)... azure did not allow dot use. so i just tried to get this.(bla-bla)...I just tried to get this address with the hope that I could discover something new. maybe there is a problem with the cname address I want to get.If you think the cname addresses I explained in the example above can be received, we can cooperate.

I remember having a similar txt option and I just skipped it (possibly just pressing continue or yes?) and it worked fine. If domain verification succeeds then it's fine even if you still get the 404.

Try claiming:

*.bla-bla.azurewebsites.net

and

bla-bla.azurewebsites.net

And send the results.

ethrx avatar Mar 31 '21 18:03 ethrx

@ethrx i did speak with my friend.. he is good for subdomain takeover. he said that subdomains starting with awverify will not be takeover. they are cname s for verify only. they are not real entries. he said that is probably why I was having trouble.

Phoenix1112 avatar Mar 31 '21 19:03 Phoenix1112

Any verify.profilename.azureservice.tld is not vulnerable since they are just entries for verifying domain ownership. For azure edge or with new name front door previews it's cdnverify, for azurewebsites it's awverify etc.

So when you see such entry ignore them, however profilename.azureservice.tld is still vulnerable if pointing NXDOMAIN, only few edge cases for trafficmanager.net when profile owner just disabled it, so you have 50/50 chance to takeover them, all others when having NXDOMAIN results are vulnerable.

mcipekci avatar Apr 01 '21 23:04 mcipekci

An interesting case I'm not use is possible to exploit is domains pointing to xx.usgovcloudapp.net

pdelteil avatar May 16 '21 01:05 pdelteil

@pdelteil when you see "gov" as a part of service, it's not possible to normal user to register these services.

You must be either US government employee or contractor to gain ability to create and use accounts and services from provider.

So none of US government employees or contractors gonna abuse it or they will face legal issues and lose their jobs.

These stuff considered as safe area for that targets.

mcipekci avatar May 16 '21 01:05 mcipekci

@pdelteil when you see "gov" as a part of service, it's not possible to normal user to register these services.

You must be either US government employee or contractor to gain ability to create and use accounts and services from provider.

So none of US government employees or contractors gonna abuse it or they will face legal issues and lose their jobs.

These stuff considered as safe area for that targets.

Hello, thanks for your opinion. I know what gov means. Like I said I don't know if it's possible yet.

pdelteil avatar May 16 '21 01:05 pdelteil

@pdelteil when you see "gov" as a part of service, it's not possible to normal user to register these services. You must be either US government employee or contractor to gain ability to create and use accounts and services from provider. So none of US government employees or contractors gonna abuse it or they will face legal issues and lose their jobs. These stuff considered as safe area for that targets.

Hello, thanks for your opinion. I know what gov means. Like I said I don't know if it's possible yet.

Hello, I didn't want to sound you don't know it. I was just making it clear it's not possible and why it's :)

mcipekci avatar May 16 '21 01:05 mcipekci

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?

Did you get solution for this? @marcelo321

tarunkant avatar May 25 '21 13:05 tarunkant

hi guys, I found that one subdomain whose CNAME is pointing to subdomain.windows.net . This can be vulnrable to subdomain takever?

Shoaib18 avatar Jun 11 '21 04:06 Shoaib18

Hi , guys I found a subdomain .t-msedge.net. Is it vulnerable to subdomain takeover ?

harishsg99 avatar Jul 26 '21 18:07 harishsg99

Are *.cloudapp.net takeovers still possible in 2021? I heard the old azure xplat cli (https://github.com/Azure/azure-xplat-cli) can be used to create classic VMs but i'm still forced to do it using the Resource Manager instead: Image

DreyAnd avatar Aug 03 '21 18:08 DreyAnd

Still possible to takeover domains that point to:

  • NAME.ZONE.cloudapp.azure.com (e.g. dev.centralus.cloudapp.azure.com)
  • NAME.azurewebsites.net (eg. testing.azurewebsites.net)

pdelteil avatar Sep 16 '21 06:09 pdelteil

Hi, I'm new to this, any help is really appreciated, I have a subdomain that is pointing to {{something}}.azurewebsites.net, but when I'm trying to create an app service in azure and register {{something}}.azurewebsites.net, it's giving me following error -

The app name {{something}} is not available

But here everyone is saying that it's possible to takeover these, I'm attaching the ui in actual subdomain when I visit that. Please, someone help me on this. Thanks. 1

OffensiveBugHunter avatar Oct 08 '21 08:10 OffensiveBugHunter

Theres two parts to these types of subdomain takeovers, Firstly the {{something}}.azurewebsites.net registration. This is the creation of the service which in your case has been done by someone.

Secondly once you have created the service you must link the vulnerable subdomain {{something}}.example.com as a "custom domain" In this case, this has not been done.

Unfortunately this case you cannot take over the subdomain. Vulnerable Microsoft takeovers normally return a NXDOMAIN when you do a dns lookup for the subdomain.

PR3R00T avatar Oct 08 '21 08:10 PR3R00T

In my case it's returning NOERROR, And all other informations I've already provided already, so does this mean this subdomain is not possible to takeover? And pardon me for asking, generally *.azurewebsites.net are still vulnerable to subdomain takeovers?

Thanks anyway for clarifying these to me.

OffensiveBugHunter avatar Oct 08 '21 08:10 OffensiveBugHunter

Yeah so a NOERROR means the DNS lookup worked and the host is alive. So in your case this subdomain is not possible to be taken over as its already registered just not assigned the custom domain. But due to the subdomain.example.com is pointing to this registered resource, this is stopping you from taking it over. So I guess the rule of thumb, I believe (anyone correct me if im wrong) and Subdomain DNS record that is pointing to a Microsoft Azure domain like the "azurewebsites.net" that return a NXDOMAIN is able to taken over (with the exception to "*.trafficmanager.net".

PR3R00T avatar Oct 08 '21 08:10 PR3R00T

Thanks for the detailed clarification, it was very much needed for me, hoping to get subdomain takeover next time.

Happy hacking! Cheers!

OffensiveBugHunter avatar Oct 08 '21 09:10 OffensiveBugHunter

@OffensiveBugHunter No problem :) Reach out to me over Twitter @PR3R00T if you need any help :) Good Luck on the hunt!

PR3R00T avatar Oct 08 '21 09:10 PR3R00T

Sure, happy hunting to you as well. @PR3R00T

OffensiveBugHunter avatar Oct 08 '21 09:10 OffensiveBugHunter

hlw bro I have found cname pointing to cabocd.azurefd.net and 2nd cname pointing to abcd.trafficmanager.net this is vulnerable bro

Botami143 avatar Oct 11 '21 09:10 Botami143

*.azure-api.net is not longer vulnerable.

pdelteil avatar Oct 27 '21 05:10 pdelteil

Can anyone guide me how to takeover a domain cnamed like xxxxx.westus.cloudapp.azure.com The region part "westus" got me confused , and the domain return NXDOMAIN result >>unclaimed .

Any help plz ?

abd-4fg avatar Oct 30 '21 22:10 abd-4fg

@abd525 Check out https://cystack.net/research/subdomain-takeover-chapter-two-azure-services - section - Virtual Machine.

PR3R00T avatar Oct 30 '21 22:10 PR3R00T

@pdelteil I recently took over a azure-api.net successfully :)

PreethamBomma avatar Dec 02 '21 10:12 PreethamBomma

How? Describe the steps!

pdelteil avatar Dec 02 '21 18:12 pdelteil

Hello,

dig -t A lockscreenapi.example.com

I found azure CNAME looks below.

lockscreenapi.example.com. 3600 IN   CNAME   lockscreen.azurewebsites.net.
lockscreen.azurewebsites.net. 60 IN   CNAME   hosts.lockscreen.azurewebsites.net

If I create app services with lockscreenapi then I got a domain ownership problem. verification-error-cname

If I create an app service with lockscreen then it's saying not available. Which name I should use for creating app services.

thank you.

s41n1k avatar Dec 14 '21 17:12 s41n1k

@pdelteil I recently took over a azure-api.net successfully :)

How? Describe the steps!

Hi @pdelteil

Login to the portal and search for Api Management and select API Management Services then create API management service and configure accordingly - region, name, etc. It does take about 30-40 mins to be deployed though.

PreethamBomma avatar Jan 04 '22 12:01 PreethamBomma

Thanks, I will give it a try.

pdelteil avatar Jan 04 '22 18:01 pdelteil

cname *.trafficmanager.net are vuln or not ?

phoenix-sec avatar Jan 13 '22 14:01 phoenix-sec

It seems taking over xyz.cloudapp.net subdomains is no longer possible, at least using new deployments, maybe someone who already have the old Azure Cloud Servce (classic) running can change it's url to the dangled DNS name

xqd-ai avatar Jan 22 '22 13:01 xqd-ai

cname *.trafficmanager.net are vuln or not ?

Yup, these are still vulnerable. I was able to take over one today.

itsbriany avatar Jan 25 '22 01:01 itsbriany

cname *.trafficmanager.net are vuln or not ?

Yup, these are still vulnerable. I was able to take over one today.

Hello,

Can you provide more information ?

pdelteil avatar Jan 25 '22 17:01 pdelteil

cname *.trafficmanager.net are vuln or not ?

Yup, these are still vulnerable. I was able to take over one today.

Hello,

Can you provide more information ?

  1. Login to your Azure console

  2. Create a traffic manager profile, and enter the name of the domain you wish to take over. image

  3. Open the traffic manager profile you created, and add an external endpoint with an IP pointing to your VPS. The idea is that all traffic will be load balanced to it.

image

Enjoy your takeover! :)

itsbriany avatar Jan 25 '22 22:01 itsbriany

CNAME to *.azureedge.net is vulnerable? If it is, can you provide how to do this?

Nitczi avatar Feb 13 '22 00:02 Nitczi

how can i claim azurewebsites.net this one

vanssec avatar Feb 15 '22 22:02 vanssec

Hi everyone,

I found a sub domain with this content:

82124335-1deeef80-97be-11ea-8bf2-59840c57c731

I checked its CNAME. It is pointing to *.trafficmanager.net and the status is:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR,

Is it possible to perform subdomain takeover in this case?

pablo2025 avatar Feb 18 '22 05:02 pablo2025

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

Have you found any solution for multi-level domain takeover? Facing the same problem.

muhyuddin avatar Feb 26 '22 14:02 muhyuddin

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

Have you found any solution for multi-level domain takeover? Facing the same problem.

Nope, not yet... Please share if you come across the solution.

Thanks

sumgr0 avatar Feb 26 '22 19:02 sumgr0

now i am working on subdomain with this record image and i had claimed it and make a website with same record but it refused to add a new custom domain as below

image

i think the vuln has been resolved and azure not vulnerable anymore. if anyone could to solve this problem and managed to complete the poc pls tell me.

0xElmalky avatar Mar 29 '22 04:03 0xElmalky

Hello,

It's still vulnerable. Some domains would require domain ownership while others won't.

pdelteil avatar Mar 29 '22 04:03 pdelteil

my bad luck :-)

0xElmalky avatar Mar 29 '22 04:03 0xElmalky

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

Have you found any solution for multi-level domain takeover? Facing the same problem.

Nope, not yet... Please share if you come across the solution.

Thanks

Is this still the case for multilevel [trafficmanager.net] domains?

batmanscode avatar Jun 27 '22 11:06 batmanscode