<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: payloadartist</title>
    <description>The latest articles on DEV Community by payloadartist (@payloadartist).</description>
    <link>https://dev.to/payloadartist</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F160294%2F7e6fa3a5-0fca-4fcc-83ad-9151eab3bc51.jpg</url>
      <title>DEV Community: payloadartist</title>
      <link>https://dev.to/payloadartist</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/payloadartist"/>
    <language>en</language>
    <item>
      <title>Analyzing and Preventing Sub-domain Takeovers: Real Risks? Causes? </title>
      <dc:creator>payloadartist</dc:creator>
      <pubDate>Mon, 13 May 2019 18:09:07 +0000</pubDate>
      <link>https://dev.to/payloadartist/analyzing-and-preventing-sub-domain-takeovers-real-risks-causes-1pg3</link>
      <guid>https://dev.to/payloadartist/analyzing-and-preventing-sub-domain-takeovers-real-risks-causes-1pg3</guid>
      <description>&lt;h1&gt;
  
  
  0x00 - Intro and Cause
&lt;/h1&gt;

&lt;p&gt;Sub-domain takeovers form a common class of vulnerability, in which an unused sub-domain pointing to a retired service is left as it is by developers. Often developers use &lt;em&gt;SaaS and PaaS&lt;/em&gt; services that allow them to reach that service through their own subdomain. But, when they discontinue this service and don't remove DNS records, this can become a major issue, if not handled properly by the service provider (to whom the DNS records are pointing to).&lt;/p&gt;

&lt;h2&gt;
  
  
  0x01 - What are ...? How they affect you?
&lt;/h2&gt;

&lt;p&gt;Subdomain takeover vulnerabilities occur when a subdomain (subdomain.example.com) is pointing to a service (e.g. GitHub pages, Heroku, etc.) that has been removed or deleted. This allows an attacker to set up a page on the service that was being used and point their page to that subdomain. For example, if subdomain.example.com was pointing to a GitHub page and the user decided to delete their GitHub page, an attacker can now create a GitHub page, add a CNAME file containing subdomain.example.com, and claim subdomain.example.com.&lt;/p&gt;

&lt;h3&gt;
  
  
  Spotting them is easy!
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.hackerone.com%2Fsites%2Fdefault%2Ffiles%2Finline-images%2Fimage1_17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.hackerone.com%2Fsites%2Fdefault%2Ffiles%2Finline-images%2Fimage1_17.png" alt="spot them!"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;404 pages can give you a hint&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;404 errors on such sub-domain can be  a hint tha the no longer existing service might actually be an existing threat to your organisation if taken over. &lt;/p&gt;

&lt;p&gt;Not only can this happen with your company's GitHub hosted pages but also with Amazon S3 buckets which are no longer in use but a subdomain is still pointing at it.&lt;/p&gt;

&lt;p&gt;Attackers can thus leverage these stale DNS records, by signing up on these platforms/service and setup their own pages there. &lt;/p&gt;

&lt;p&gt;Which leads to&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Phishing. &lt;/li&gt;
&lt;li&gt;Direct Account Takeovers in certain cases&lt;/li&gt;
&lt;li&gt; Damage of Business Reputation. &lt;/li&gt;
&lt;li&gt;Hijacking old CDNs that still serve CSS, JS to a main application. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  0x02 - Adding More Impact as an Attacker
&lt;/h2&gt;

&lt;p&gt;Apart from regular phishing attacks, there can be certain scenarios in which cookies scoped to all sub-domain or, that specific sub-domain which is vulnerable to a takeover can be smuggled by an attacker via &lt;strong&gt;XSS&lt;/strong&gt; and other client-side attack vectors. &lt;/p&gt;

&lt;h3&gt;
  
  
  Impact - Let's look at a real world case!
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://portswigger.net/daily-swig/dead-windows-live-tiles-regain-new-life-in-subdomain-takeover" rel="noopener noreferrer"&gt;Microsoft Live Tiles Sub-Domain takeover!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Uber, Starbucks and so on, have been victims to this attack, but these cases were responsibly reported via their bug bounty programs &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  0x03 - More Resources
&lt;/h2&gt;

&lt;p&gt;The awesome Ed created a GitHub repository that tracks down services which can be vulnerable to such takeovers. This can be beneficial both for offensive testing and defensive developers who care about such things,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/EdOverflow/can-i-take-over-xyz/blob/master/README.md" rel="noopener noreferrer"&gt;Check out can-i-takeover-xyz here to learn more about subdomain takeovers and which services maybe vulnerable to this.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Found typos/something that I missed? HMU and let's make this write up more complete!&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>devops</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
