Florian Walter on LinkedIn: Subdomain Takeover: What is It? How to Exploit? How to Find Them? (2024)

Florian Walter

Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

  • Report this post

๐Ÿ” Subdomain Takeover: A Wrap-upI hope you liked this recent series on subdomain takeovers. If you want to read through this series more compactly, please check out the whole article on my Medium: https://lnkd.in/dNZ79htSI will soon officially introduce a new tool I wrote called SubSnipe, designed to automate some of the work of finding subdomain takeovers in practice.I think this tool has much potential so stay tuned ๐Ÿ˜Ž.#Cybersecurity #SubdomainTakeover #InfoSec #WebSecurity #AppSec #BugHunting #PenetrationTesting

Subdomain Takeover: What is It? How to Exploit? How to Find Them? medium.com

48

1 Comment

Like Comment

Lucas Santos Ferreira

Prรฉ-Vendas | Sales Engineer | Arquiteto de soluรงรตes | Consultor | Technical Account Manager | Cyber Security | DevSecOps | Application Security

1d

  • Report this comment

You rock! Iโ€™m looking forward to see this tool ready.

Like Reply

1Reaction 2Reactions

To view or add a comment, sign in

More Relevant Posts

  • Florian Walter

    Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

    • Report this post

    ๐Ÿ”’ Subdomain Takeover - Part 3: How to Find Them?In my previous posts, I talked about what Subdomain Takeover is and how an attacker can leverage it for further exploitation. In this final part, we talk about how a pentester or bug bounty hunter can find them.๐’๐ญ๐ž๐ฉ ๐Ÿ: ๐…๐ข๐ง๐ ๐’๐ฎ๐›๐๐จ๐ฆ๐š๐ข๐ง๐ฌBefore you can find subdomains to take over, you need to find something firstโ€ฆ Subdomains! There are plenty of ways to find subdomains and I wonโ€™t cover them in this post.So say youโ€™re performing like a Pentest on test.com, and you identified the following subdomains:mail.test.comstatic.test.comcool-app.test.com๐’๐ญ๐ž๐ฉ ๐Ÿ: ๐…๐ข๐ง๐ ๐‚๐๐€๐Œ๐„๐ฌItโ€™s very unlikely we can get our hands on e.g. mail.test.com (unless we hack the page itself or like the DNS server or something). Thus, we check if there are some CNAMEs (=aliases) for all identified subdomains, and run e.g.: ๐’…๐’Š๐’ˆ +๐’”๐’‰๐’๐’“๐’• ๐‘ช๐‘ต๐‘จ๐‘ด๐‘ฌ ๐’Ž๐’‚๐’Š๐’.๐’•๐’†๐’”๐’•.๐’„๐’๐’ŽSay that there were no CNAMEs for mail.test.com and cool-app.test.com. However, we found a CNAME for static.test.com, and itโ€™s an S3 bucket ('static-test.s3.amazonaws[.]com').๐’๐ญ๐ž๐ฉ ๐Ÿ‘: ๐…๐ข๐ง๐ ๐€๐›๐š๐ง๐๐จ๐ง๐ž๐ ๐ƒ๐จ๐ฆ๐š๐ข๐ง๐ฌNext, we need to check if any of the identified CNAMEs have been abandoned, i.e. no longer used. We talked about this in Part 1 of this series, so I wonโ€™t go too much into detail. Basically, we want to find indications that the resource is no longer used.Good indicators for this are for example:- 404 HTTP response status- DNS errors that indicate that the domain is non-existentSay we checked out the identified S3 bucket and found that it doesnโ€™t exist anymore.๐’๐ญ๐ž๐ฉ ๐Ÿ’: ๐‚๐ก๐ž๐œ๐ค ๐ข๐Ÿ ๐“๐š๐ค๐ž๐จ๐ฏ๐ž๐ซ ๐ข๐ฌ ๐๐จ๐ฌ๐ฌ๐ข๐›๐ฅ๐žThis is the hardest partโ€ฆ We can only take over static.test.com if we can register a new S3 bucket and can control its domain name. If we can't, then we won't be able to register 'static-test.s3.amazonaws[.]com'.This isn't a solved problem yet, but a good starting point is this awesome GitHub repo: https://lnkd.in/d2ScVXVf. It contains lots of information on popular domains (e.g. AWS, Azure, etc.), specifies how to fingerprint them, and if they are vulnerable to takeover. ๐’๐ญ๐ž๐ฉ ๐Ÿ“: ๐“๐š๐ค๐ข๐ง๐  ๐Ž๐ฏ๐ž๐ซ ๐ญ๐ก๐ž ๐’๐ฎ๐›๐๐จ๐ฆ๐š๐ข๐งOnce we confirm we can take it over, the final step is taking over the subdomain. This means for example creating a new S3 bucket with the same name as a previously deleted bucket.This step can be very easy with things like S3 buckets or Azure Websites but may be more difficult for things like Azure Cloud Apps which require some setup.#Cybersecurity #SubdomainTakeover #InfoSec #WebSecurity #AppSec #BugHunting #PenetrationTesting

    71

    2 Comments

    Like Comment

    To view or add a comment, sign in

  • Florian Walter

    Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

    • Report this post

    DAST vs Penetration Testing? The debate between DAST and Pentesting has been a hot topic for a while, but it has reached new heights since the release of AI tools like ChatGPT.If you want to know more about my view on their similarities, differences, and strengths, please check out my recent interview with my Veracode colleague Jenn Buckingham: https://lnkd.in/g2Zjcf27

    Understanding the Nuances: DAST vs. Penetration Testing | Veracode veracode.com

    73

    2 Comments

    Like Comment

    To view or add a comment, sign in

  • Florian Walter

    Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

    • Report this post

    ๐Ÿ”’ Subdomain Takeover - Part 2: How to Exploit?In my previous post, I talked about what Subdomain Takeover is. Now, letโ€™s talk about some of the naughty things an attacker can do once they have taken over a subdomain.So the attacker has just taken over 'static.nextaigen.com'. But what now?๐๐ก๐ข๐ฌ๐ก๐ข๐ง๐ The most obvious thing that comes to mind is probably phishing. Considering you now control a subdomain of 'nextaigen.com', why not change it to a phishing page and try to social engineer e.g. customers or employees of NextAIGen?๐„๐ฑ๐ฉ๐ฅ๐จ๐ข๐ญ๐ข๐ง๐  ๐‚๐Ž๐‘๐’ ๐Œ๐ข๐ฌ๐œ๐จ๐ง๐Ÿ๐ข๐ ๐ฎ๐ซ๐š๐ญ๐ข๐จ๐งSay you find another app from NextAIGen which is hosted under 'ai-verse.nextaigen.com'. It is configured to allow CORS requests from all subdomains of '*.nextaigen.com' (I honestly see this all the time!). This by itself is not exploitable and probably wouldnโ€™t even necessarily classify as a "misconfiguration".However, since you now control a subdomain of 'nextaigen.com', you can host content on 'static.nextaigen.com' that sends cross-origin requests to'ai-verse.nextaigen.com' and stores the HTTP responses. You then have to social engineer a user of 'ai-verse.nextaigen.com' to visit 'static.nextaigen.com'. Now, you can then send requests in the user's name to 'ai-verse.nextaigen.com'. The severity of this may differ. But this would often be high or critical if there is any endpoint in 'ai-verse.nextaigen.com' that returns sensitive data, and I also found this scenario leading to account takeover in the past if there is an endpoint that returns e.g. a session token in the response body. ๐๐ฒ๐ฉ๐š๐ฌ๐ฌ๐ข๐ง๐  ๐‚๐’๐ ๐Ÿ๐จ๐ซ ๐—๐’๐’Another example could potentially be bypassing a CSP to get XSS. Say you find XSS but canโ€™t exploit it because of the CSP, but the CSP trusts all scripts from subdomains of '*.nextaigen.com'. You can see whatโ€™s next right? Just host the XSS payload on 'static.nextaigen.com' then.I hope you liked this little introduction to leveraging Subdomain Takeovers. What other exploitation scenarios can you think of?#Cybersecurity #SubdomainTakeover #InfoSec #WebSecurity #AppSec #BugHunting #PenetrationTesting

    59

    4 Comments

    Like Comment

    To view or add a comment, sign in

  • Florian Walter

    Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

    • Report this post

    ๐Ÿ”’ Subdomain Takeover - Part 1: What is it?Say your company is called NextAIGen and you're using an S3 bucket for your app's static files, called 'static-stuff'. Since you don't want the domain name for your bucket to be like 'static-stuff[.]s3[.]amazonaws[.]com' (the purpose of the [] is simply to prevent LinkedIn from obfuscating the domainโ€ฆ), you register a CNAME (=a DNS alias) that says that 'static.nextaigen.com' is an alias for 'static-stuff[.]s3[.]amazonaws[.]com'.Cool, now you can reference files from your bucket using 'static.nextaigen.com'.A few years pass and you have some new fancy apps and have forgotten about all that old stuff that you developed in the past. You already deleted the 'static-stuff' S3 bucket, because why pay money for something you don't need anymore - right?But there's one thing you didn't delete: The CNAME entry that connects 'static.nextaigen.com' with 'static-stuff[.]s3[.]amazonaws[.]comโ€™.Now, an attacker comes along, creates a new S3 bucket, and uses the now free name 'static-stuff'. Do you see where Iโ€™m heading? Since 'static.nextaigen.com' is still an alias for 'static-stuff[.]s3[.]amazonaws[.]com', the attacker has now de facto taken over 'static.nextaigen.com' and can control its content. This is why itโ€™s called Subdomain Takeover!#Cybersecurity #SubdomainTakeover #InfoSec #WebSecurity #AppSec #BugHunting #PenetrationTesting

    123

    10 Comments

    Like Comment

    To view or add a comment, sign in

  • Florian Walter

    Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

    • Report this post

    ๐Ÿ”’ Subdomain Takeover: What is it? How to Exploit? How to Find Them?I will be publishing a series of posts on Subdomain Takeover soon that discusses 3 things:- What is it? - How to Exploit? - How to Find Them?After that, I will be introducing a new tool I wrote called SubSnipe which helps with identifying subdomain takeovers ๐Ÿš€.#Cybersecurity #SubdomainTakeover #InfoSec #WebSecurity #AppSec #BugHunting #PenetrationTesting

    94

    4 Comments

    Like Comment

    To view or add a comment, sign in

  • Florian Walter

    Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

    • Report this post

    ๐ŸŒŸ Secure Code Review Challenge 09 (Broken Access Control) - My SolutionThe problem here is that the app implements authentication but no authorization. Consequently, any logged-in user can edit the profile of any other logged-in user, which is most likely unintended and a serious vulnerability.To remediate this, implement a check ensuring users can only edit their own profile. This can be accomplished e.g. by taking the username from the session (not directly attacker-controlled) instead of the request (directly under the attacker's control).#AppSec #BugHunting #EthicalHacking #Cybersecurity

    81

    1 Comment

    Like Comment

    To view or add a comment, sign in

  • Florian Walter

    Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

    • Report this post

    ๐Ÿ” Secure Code Review Challenge 09: Provide concrete code-level remediation guidance for the vulnerability in the code.Today's vulnerability is omnipresent and I see a variation of it in like 90% of my pentests.(You can also check the below code out on my GitHub: https://lnkd.in/dNNdsJAH)PS: I might respond to your comment from the perspective of a developer under a tight deadline, feeling the pressure to deliver, and attempting to push back on your suggestions.#AppSec #BugHunting #EthicalHacking #Cybersecurity

    • Florian Walter on LinkedIn: Subdomain Takeover: What is It? How to Exploit? How to Find Them? (33)

    245

    65 Comments

    Like Comment

    To view or add a comment, sign in

  • Florian Walter

    Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

    • Report this post

    Where did my posts go, LinkedIn?So like many other content creators, I schedule my posts. In fact, I have them scheduled out till sometime in August, which is perfect because it lets me write whenever I feel inspired and not when I feel like "I should post something now".Anyhow, I had the next code-review challenge scheduled for this morning but unless I'm blind, I can't see it posted anywhere ๐Ÿ˜ƒ. I also can't find it in the list of my scheduled posts. Even more so, I can't see any scheduled posts in my list that go beyond mid-July.So I did some quick googling and this is a thing, and scheduled posts sometimes *poof* disappear.Did this happen to anyone else recently?#WhereIsMyPost

    28

    11 Comments

    Like Comment

    To view or add a comment, sign in

  • Florian Walter

    Sr. Penetration Tester | Dev & AppSec Specialist | Security Researcher | Building, Breaking & Fixing Apps

    • Report this post

    ๐ŸŒŸ Secure Code Review Challenge 08 (Nginx Off By Slash) - My SolutionSo... What's the problem with this innocent-looking Nginx configuration? The answer is path normalization, one of my favorite research topics at the moment (there will be more on that topic coming for you guys ๐Ÿ™‚).Say someone visits 'https://<host>/html../nginx.conf'. Remember that '/html' is an alias for '/usr/share/nginx/html/' which means that Nginx would interpret this as '/usr/share/nginx/html/../nginx.conf'. Thus, an attacker can break out of the designated path and we have a classic LFI vulnerability.๐Ÿ’ก SolutionTo remediate this, we can e.g. change the alias to something like this:location /html/ { root /usr/share/nginx/html;}Now, if an attacker again visits 'https://<host>/html../nginx.conf', Nginx would interpret it as '/usr/share/nginx/html../nginx.conf', which would lead to a 404.If you wanna know more about this topic, please watch this: https://lnkd.in/dcFM7Q9zEdit: Thanks to Danilo S. for pointing this out. My remediation guidance is correct, but my explanation is wrong. I said that if an attacker visited 'https://<host>/html../nginx.conf' after the fix, Nginx would interpret it as '/usr/share/nginx/html../nginx.conf'. But considering that our rule maps to '/html/', the '/html../' wouldn't even trigger our rule anymore (and thus, lead to a 404).#AppSec #BugHunting #EthicalHacking #Cybersecurity #Nginx

    DEF CON 26 - Orange Tsai - Breaking Parser Logic Take Your Path Normalization Off and Pop 0Days Out

    https://www.youtube.com/

    87

    4 Comments

    Like Comment

    To view or add a comment, sign in

Florian Walter on LinkedIn: Subdomain Takeover: What is It? How to Exploit? How to Find Them? (45)

Florian Walter on LinkedIn: Subdomain Takeover: What is It? How to Exploit? How to Find Them? (46)

  • 106 Posts
  • 4 Articles

View Profile

Follow

More from this author

  • AI vs. Human: Who is the better Vulnerability Researcher? ๐Ÿง ๐Ÿค– Florian Walter 1mo
  • Deserialization: What the Heck *Actually* Is a GadgetChain? Florian Walter 3mo
  • How I Became an Ethical Hacker Florian Walter 3mo

Explore topics

  • Sales
  • Marketing
  • Business Administration
  • HR Management
  • Content Management
  • Engineering
  • Soft Skills
  • See All
Florian Walter on LinkedIn: Subdomain Takeover: What is It? How to Exploit? How to Find Them? (2024)
Top Articles
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 5427

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.