<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Secaholic]]></title><description><![CDATA[Just a Blog about Computer Science, Security, and Life]]></description><link>https://secaholic.com</link><image><url>https://substackcdn.com/image/fetch/$s_!yRyE!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe99bdb62-c9c8-4079-a08f-94a680720652_399x399.jpeg</url><title>Secaholic</title><link>https://secaholic.com</link></image><generator>Substack</generator><lastBuildDate>Fri, 01 May 2026 11:51:20 GMT</lastBuildDate><atom:link href="https://secaholic.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Trung Nguyen]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[secaholic@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[secaholic@substack.com]]></itunes:email><itunes:name><![CDATA[Trung Nguyen]]></itunes:name></itunes:owner><itunes:author><![CDATA[Trung Nguyen]]></itunes:author><googleplay:owner><![CDATA[secaholic@substack.com]]></googleplay:owner><googleplay:email><![CDATA[secaholic@substack.com]]></googleplay:email><googleplay:author><![CDATA[Trung Nguyen]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Deal with challenge exceptions in Linkedin API]]></title><description><![CDATA[Calls from IP addresses that never logged in with the given account before will be blocked and required a verification.]]></description><link>https://secaholic.com/p/deal-with-challenge-exceptions-in-linkedin-api-4ca9de963757</link><guid isPermaLink="false">https://secaholic.com/p/deal-with-challenge-exceptions-in-linkedin-api-4ca9de963757</guid><dc:creator><![CDATA[Trung Nguyen]]></dc:creator><pubDate>Thu, 13 Feb 2020 10:52:35 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/aa660796-e149-4191-b4ed-33b8f77c9e24_800x400.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!O9aO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!O9aO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png 424w, https://substackcdn.com/image/fetch/$s_!O9aO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png 848w, https://substackcdn.com/image/fetch/$s_!O9aO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png 1272w, https://substackcdn.com/image/fetch/$s_!O9aO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!O9aO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!O9aO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png 424w, https://substackcdn.com/image/fetch/$s_!O9aO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png 848w, https://substackcdn.com/image/fetch/$s_!O9aO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png 1272w, https://substackcdn.com/image/fetch/$s_!O9aO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ed5ac6-568c-4149-a624-9f46f00aa0b3_800x400.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>Recently, I have to use Linkedin API to crawl companies in their ecosystem. The official API (v3)requires OAuth for authenticating and forces you to request to them before you can use the full version (public and private APIs). Luckily, I found that Linkedin offers Voyager API for searching and listing companies unofficially. It allows you to use your email and password for authenticating instead of OAuth tokens.</p><p>However, Linkedin seems to restrict calling to their APIs by checking the IP addresses. According to my observations, calls from IP addresses that never logged in with the given account before will be blocked and required a verification called the challenge exception. The only way to deal with this problem is logging in manually before calling API. However, in a non-UI environment like Linux-based production servers, you don&#8217;t have browsers and you&#8217;ll need a script to do that.</p><p>I have written such a script, you can find at my Github repository below</p><p><strong><a href="https://github.com/everping/Linkedin-Authentication-Challenge" title="https://github.com/everping/Linkedin-Authentication-Challenge">everping/Linkedin-Authentication-Challenge</a></strong><a href="https://github.com/everping/Linkedin-Authentication-Challenge" title="https://github.com/everping/Linkedin-Authentication-Challenge"><br></a><em><a href="https://github.com/everping/Linkedin-Authentication-Challenge" title="https://github.com/everping/Linkedin-Authentication-Challenge">When using Linkedin API for the first time in a production server, you may get Challenge Exceptions. That's because you&#8230;</a></em><a href="https://github.com/everping/Linkedin-Authentication-Challenge" title="https://github.com/everping/Linkedin-Authentication-Challenge">github.com</a></p>]]></content:encoded></item><item><title><![CDATA[Subdomain takeover — Chapter two: Azure Services]]></title><description><![CDATA[As I described in the chapter one, we can control the content of a sub-domain d by controlling the content of its CNAME record]]></description><link>https://secaholic.com/p/subdomain-takeover-chapter-two-azure-services-834f86eac2a7</link><guid isPermaLink="false">https://secaholic.com/p/subdomain-takeover-chapter-two-azure-services-834f86eac2a7</guid><dc:creator><![CDATA[Trung Nguyen]]></dc:creator><pubDate>Mon, 12 Aug 2019 04:56:56 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/559dcd6d-ab7b-4ddd-b496-270e5ac1c509_800x457.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4zDn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4zDn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png 424w, https://substackcdn.com/image/fetch/$s_!4zDn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png 848w, https://substackcdn.com/image/fetch/$s_!4zDn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png 1272w, https://substackcdn.com/image/fetch/$s_!4zDn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4zDn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/26d251b5-4f54-4d85-b129-efff622514b5_800x457.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4zDn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png 424w, https://substackcdn.com/image/fetch/$s_!4zDn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png 848w, https://substackcdn.com/image/fetch/$s_!4zDn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png 1272w, https://substackcdn.com/image/fetch/$s_!4zDn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26d251b5-4f54-4d85-b129-efff622514b5_800x457.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p><em><a href="https://blog.cystack.net/subdomain-takeover-chapter-two-azure-services/">Read this article at my company&#8217;s blog</a></em></p><p>As I described in the <a href="https://blog.cystack.net/subdomain-takeover/">chapter one</a>, we can control the content of a sub-domain <code>d</code> by controlling the content of domain <code>d1</code> that <code>d</code> point to through its CNAME record.</p><p><a href="https://azure.microsoft.com/en-us/">Azure</a>, a popular cloud service offer many services that can create such a <code>d1</code>. In this article, I will go details about services of Azure that can be vulnerable and how I exploited in the wild, including: Traffic Manager Profile, Web App, Virtual Machine</p><h3>Traffic Manager&nbsp;Profile</h3><blockquote><p><em><a href="https://docs.microsoft.com/en-us/azure/traffic-manager/traffic-manager-overview">Traffic Manager profiles</a> use traffic-routing methods to control the distribution of traffic to your cloud services or website endpoints.</em></p></blockquote><p><strong>My targets:</strong> Microsoft, Deloitte, HP</p><p>Normally, we can detect that a domain is using Traffic Manager if its CNAME record is <code>xxx.trafficmanager.net</code> like the following case.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QYML!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QYML!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png 424w, https://substackcdn.com/image/fetch/$s_!QYML!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png 848w, https://substackcdn.com/image/fetch/$s_!QYML!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png 1272w, https://substackcdn.com/image/fetch/$s_!QYML!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QYML!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QYML!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png 424w, https://substackcdn.com/image/fetch/$s_!QYML!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png 848w, https://substackcdn.com/image/fetch/$s_!QYML!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png 1272w, https://substackcdn.com/image/fetch/$s_!QYML!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbfca17f-524a-406e-8776-7cd31788b1ff_800x418.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>The next step is checking whether the CNAME domain is available to register or not by using Azure API or using Azure portal.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_-Xa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_-Xa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png 424w, https://substackcdn.com/image/fetch/$s_!_-Xa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png 848w, https://substackcdn.com/image/fetch/$s_!_-Xa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png 1272w, https://substackcdn.com/image/fetch/$s_!_-Xa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_-Xa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_-Xa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png 424w, https://substackcdn.com/image/fetch/$s_!_-Xa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png 848w, https://substackcdn.com/image/fetch/$s_!_-Xa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png 1272w, https://substackcdn.com/image/fetch/$s_!_-Xa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b17254c-ad59-43a8-a985-e8debd98a5cd_800x391.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>If it is available, just create then in endpoint setting, select type <strong>External</strong> endpoint and enter your controlled IP address as the target. The final step is to create a PoC page in your server to make the PoC works.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AF-M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AF-M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png 424w, https://substackcdn.com/image/fetch/$s_!AF-M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png 848w, https://substackcdn.com/image/fetch/$s_!AF-M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png 1272w, https://substackcdn.com/image/fetch/$s_!AF-M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AF-M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AF-M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png 424w, https://substackcdn.com/image/fetch/$s_!AF-M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png 848w, https://substackcdn.com/image/fetch/$s_!AF-M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png 1272w, https://substackcdn.com/image/fetch/$s_!AF-M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9398ae63-bf8c-4b31-9bd2-3098bf8fe09b_800x103.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Web App&nbsp;Service</h3><blockquote><p><em><a href="https://docs.microsoft.com/en-us/azure/app-service/">Azure App Service</a> enables you to build and host web apps, mobile back ends, and RESTful APIs in the programming language of your choice without managing infrastructure</em></p></blockquote><p><strong>My targets: </strong>Deloitte, US gov</p><p>In this case, the original domain points to <code>xxx.azurewebsites.net</code></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Osgj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Osgj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png 424w, https://substackcdn.com/image/fetch/$s_!Osgj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png 848w, https://substackcdn.com/image/fetch/$s_!Osgj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png 1272w, https://substackcdn.com/image/fetch/$s_!Osgj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Osgj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b263ea60-eccf-43f6-9374-541c958aef1c_800x352.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Osgj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png 424w, https://substackcdn.com/image/fetch/$s_!Osgj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png 848w, https://substackcdn.com/image/fetch/$s_!Osgj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png 1272w, https://substackcdn.com/image/fetch/$s_!Osgj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb263ea60-eccf-43f6-9374-541c958aef1c_800x352.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Similar to the Traffic Manager Profile, we have to check check the destination domain&#8217;s availability and if it&#8217;s available, create your own app. Then push whatever you want to it to prove that you can control the domain.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!atv7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!atv7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png 424w, https://substackcdn.com/image/fetch/$s_!atv7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png 848w, https://substackcdn.com/image/fetch/$s_!atv7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png 1272w, https://substackcdn.com/image/fetch/$s_!atv7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!atv7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c011353-9a75-40f0-848e-0000b414b438_800x391.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!atv7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png 424w, https://substackcdn.com/image/fetch/$s_!atv7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png 848w, https://substackcdn.com/image/fetch/$s_!atv7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png 1272w, https://substackcdn.com/image/fetch/$s_!atv7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c011353-9a75-40f0-848e-0000b414b438_800x391.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xxZU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xxZU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png 424w, https://substackcdn.com/image/fetch/$s_!xxZU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png 848w, https://substackcdn.com/image/fetch/$s_!xxZU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png 1272w, https://substackcdn.com/image/fetch/$s_!xxZU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xxZU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xxZU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png 424w, https://substackcdn.com/image/fetch/$s_!xxZU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png 848w, https://substackcdn.com/image/fetch/$s_!xxZU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png 1272w, https://substackcdn.com/image/fetch/$s_!xxZU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed67c1d7-545f-42ad-9bc9-133acd575118_800x313.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oJ52!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oJ52!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png 424w, https://substackcdn.com/image/fetch/$s_!oJ52!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png 848w, https://substackcdn.com/image/fetch/$s_!oJ52!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png 1272w, https://substackcdn.com/image/fetch/$s_!oJ52!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oJ52!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oJ52!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png 424w, https://substackcdn.com/image/fetch/$s_!oJ52!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png 848w, https://substackcdn.com/image/fetch/$s_!oJ52!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png 1272w, https://substackcdn.com/image/fetch/$s_!oJ52!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3bd5cce-621a-4590-9ad5-91100c7ae552_800x352.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Note: </strong>I have reported that bug to the US Cert and they fixed afterwards.</p><h3>Virtual Machine</h3><blockquote><p><em><a href="https://docs.microsoft.com/en-us/azure/virtual-machines/linux/">Azure Linux Virtual Machines</a> provides on-demand, high-scale, secure, virtualized infrastructure using Red Hat, Ubuntu, or the Linux distribution of your choice</em></p></blockquote><p><strong>My targets: </strong>BBC</p><p>Compare to those cases, the destination domain in this case includes the region name, its form is <code>xxx.region_name.cloudapp.azure.com</code></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qvoy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qvoy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png 424w, https://substackcdn.com/image/fetch/$s_!Qvoy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png 848w, https://substackcdn.com/image/fetch/$s_!Qvoy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png 1272w, https://substackcdn.com/image/fetch/$s_!Qvoy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qvoy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d065359-1be3-46ba-b2de-39280a207750_800x434.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Qvoy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png 424w, https://substackcdn.com/image/fetch/$s_!Qvoy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png 848w, https://substackcdn.com/image/fetch/$s_!Qvoy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png 1272w, https://substackcdn.com/image/fetch/$s_!Qvoy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d065359-1be3-46ba-b2de-39280a207750_800x434.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Steps to exploit</p><ol><li><p>Create a Virtual Machine, Ubuntu server for example. You must select the correct region with the region in that CNAME. In this case, it is <code>North Europe</code></p></li><li><p>In Overview setting, change DNS name to <a href="http://discussions-stage.northeurope.cloudapp.azure.com/"><code>discussions-stage.northeurope.cloudapp.azure.com</code></a></p></li><li><p>Install a webserver (Apache, Nginx) in the VM just created and create a virtual host for it to serve requests to <a href="http://discussions.stage.api.bbc.com/"><code>discussions.stage.api.bbc.com</code></a></p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V07v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V07v!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png 424w, https://substackcdn.com/image/fetch/$s_!V07v!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png 848w, https://substackcdn.com/image/fetch/$s_!V07v!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png 1272w, https://substackcdn.com/image/fetch/$s_!V07v!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V07v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!V07v!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png 424w, https://substackcdn.com/image/fetch/$s_!V07v!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png 848w, https://substackcdn.com/image/fetch/$s_!V07v!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png 1272w, https://substackcdn.com/image/fetch/$s_!V07v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6568babb-b312-4829-a2d6-8c776a9ef742_800x391.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!91M7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!91M7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png 424w, https://substackcdn.com/image/fetch/$s_!91M7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png 848w, https://substackcdn.com/image/fetch/$s_!91M7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png 1272w, https://substackcdn.com/image/fetch/$s_!91M7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!91M7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!91M7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png 424w, https://substackcdn.com/image/fetch/$s_!91M7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png 848w, https://substackcdn.com/image/fetch/$s_!91M7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png 1272w, https://substackcdn.com/image/fetch/$s_!91M7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F065b703d-88a0-449d-83a2-cb463ae9b4cb_800x107.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Fun facts</h3><ul><li><p><strong>Roughly 40 domains</strong> of Microsoft affected by this issue. Their security team responded quite slowly and did not reward for the finding since it is out of scope. However, they gave me a sincere thanks and acknowledged me in MS Hall of Fame (2 times for 2 reports)</p></li><li><p>BBC gave me a T-shirt and acknowledged me their Hall of Fame</p></li><li><p>About <strong>140 domains </strong>of<strong> </strong><a href="https://www2.deloitte.com/us/en.html">Deloitte</a>, one of the world&#8217;s largest auditing companies, are vulnerable. Reporting bugs to them is probably one of the <strong>worst experiences</strong> of my career. When I found issues in their domains, I tried to find their security contact but got nothing; I also sent emails to the addresses I saw on their official websites but got no responses after 1 week. Finally, I used Linkedin and texted to some people that I think they work there, one of them replied me that she forwarded my message to the security team. Sadly, she just quit her job there for a short time. The security team then contacted me and asked me for details. What happened after that was that they said they received the information and ended the conversation. I&#8217;m also not sure if those problems have been fixed. Honestly, I have no intention of reporting the vulnerability to this company anymore.</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Subdomain takeover — Chapter one: Methodology]]></title><description><![CDATA[Subdomain takeover is a high severity vulnerability that can be exploited to take control of a domain and pointing it to an address managed]]></description><link>https://secaholic.com/p/subdomain-takeover-chapter-one-methodology-dd6d86b0941b</link><guid isPermaLink="false">https://secaholic.com/p/subdomain-takeover-chapter-one-methodology-dd6d86b0941b</guid><dc:creator><![CDATA[Trung Nguyen]]></dc:creator><pubDate>Mon, 12 Aug 2019 04:52:13 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/a15550cc-8855-499e-a59d-f613967bd859_800x457.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!q-D8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!q-D8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png 424w, https://substackcdn.com/image/fetch/$s_!q-D8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png 848w, https://substackcdn.com/image/fetch/$s_!q-D8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png 1272w, https://substackcdn.com/image/fetch/$s_!q-D8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!q-D8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!q-D8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png 424w, https://substackcdn.com/image/fetch/$s_!q-D8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png 848w, https://substackcdn.com/image/fetch/$s_!q-D8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png 1272w, https://substackcdn.com/image/fetch/$s_!q-D8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11417e8-dad1-4ff8-9cd9-dccb89affe31_800x457.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p><em><a href="https://blog.cystack.net/subdomain-takeover/">Read this article at my company&#8217;s blog</a></em></p><p>Subdomain takeover is a high severity vulnerability that can be exploited to take control of a domain and pointing it to an address managed by attackers. Attacks on this vulnerability are often used for the purpose of creating phishing sites, spreading malwares. However, subdomain <em>takeover </em>is not a new vulnerability, it may be published from the year of 2014.</p><p>On the last weekend of October, I spent some time coding exploits to find major websites that could be affected by the vulnerability. The results were very unexpected, I found more than 200 domains affected by the vulnerability just in 2 days. These domains belongs to big technology, finance companies and major newspapers. I suppose that I should share my discoveries with subdomain takeover, so this series will show my perspective, how do I find out vulnerable websites and how to exploit them, on a case by case basis.</p><h3>Domains and IP addresses</h3><p>To begin with, let&#8217;s talk about a typical example. You own a domain <a href="http://example.com/"><code>example.com</code></a> and a server with the IP address <code>1.2.3.4</code>. Now you would like to point your domain to this IP address?</p><p>Normally, your <strong>DNS providers </strong>offer several ways to do this, including:</p><ul><li><p>Using <strong>A </strong>or <strong>AAAA </strong>records</p></li><li><p>Using <strong>CNAME </strong>records</p></li><li><p>Using extra records like <strong>ALIAS </strong>or <strong>URL </strong>records</p></li></ul><p>We will look into the details in each of these ways</p><h4>Using A or AAAA&nbsp;records</h4><p>This is the most common way, almost everyone who works with domain names has ever used this method. We will have to enter a host and a value as the domain name and the IP respectively.</p><p><strong>Notes:</strong></p><ul><li><p><code>@</code> used to point a root domain (<a href="http://example.com/">example.com</a>) to the IP address</p></li><li><p><code>xxx</code> used to point a sub-domain (<a href="http://xxx.example.com/">xxx.example.com</a>) to the IP address</p></li><li><p><strong>A</strong> records are for <strong>IPv4</strong>, while <strong>AAAA </strong>records are for <strong>IPv6</strong></p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JnH0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JnH0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png 424w, https://substackcdn.com/image/fetch/$s_!JnH0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png 848w, https://substackcdn.com/image/fetch/$s_!JnH0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png 1272w, https://substackcdn.com/image/fetch/$s_!JnH0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JnH0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JnH0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png 424w, https://substackcdn.com/image/fetch/$s_!JnH0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png 848w, https://substackcdn.com/image/fetch/$s_!JnH0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png 1272w, https://substackcdn.com/image/fetch/$s_!JnH0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5148361-ddf9-4915-bebf-15ca44875b7b_800x195.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>Using CNAME&nbsp;records</h4><p><strong>A/AAAA</strong> records is a direct solution for the domain name resolution. However, in some cases this method will cause annoyance, for example:</p><ul><li><p>You own 100 subdomains (<a href="http://x1.example.com/"><code>x1.example.com</code></a>&nbsp;, <a href="http://x2.example.com/"><code>x2.example.com</code></a>&nbsp;... <a href="http://x100.example.com/"><code>x100.example.com</code></a>) and all of them are pointed to the IP <code>1.2.3.4</code>. One day, you changed the host and the IP is changed to <code>5.6.7.8</code>. Would you update the A record for 100 sub-domains?</p></li><li><p>You are using a 3rd party service to create a landing page for your advertising campaign. This partner created a site with domain <a href="http://yourcompany.ads.com/"><code>yourcompany.ads.com</code></a>. However, you wouldn't like to use this domain, simply because it is unfamiliar to your customers. How to point your own domain <a href="http://landing.example.com/"><code>landing.example.com</code></a> to <a href="http://yourcompany.ads.com/"><code>yourcompany.ads.com</code></a>?</p></li></ul><p>You can use CNAME records for these cases. CNAME is the most well known way to &#8220;symlink&#8221; one DNS record to another. It works by answering queries asking for the Source with a simple referral (by domain name) to the Target, which may be anywhere else on the internet.</p><p>For example 1, we will need to point subdomain <a href="http://x100.example.com/"><code>x100.example.com</code></a> to the destination IP by using the A record, then point 99 other sub-domains to <a href="http://x100.example.com/"><code>x100.example.com</code></a> by using the CNAME record. Later, if the destination IP is changed, we will just need to update the A record of <a href="http://x100.example.com/"><code>x100.example.com</code></a>.</p><p>For example 2, we will need to point the CNAME of <a href="http://landing.example.com/"><code>landing.example.com</code></a> to <a href="http://yourcompany.ads.com/"><code>yourcompany.ads.com</code></a>.</p><p>The biggest problem with CNAME is that it cannot be used for a root domain, but only sub-domains.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Gsyk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gsyk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png 424w, https://substackcdn.com/image/fetch/$s_!Gsyk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png 848w, https://substackcdn.com/image/fetch/$s_!Gsyk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png 1272w, https://substackcdn.com/image/fetch/$s_!Gsyk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gsyk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Gsyk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png 424w, https://substackcdn.com/image/fetch/$s_!Gsyk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png 848w, https://substackcdn.com/image/fetch/$s_!Gsyk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png 1272w, https://substackcdn.com/image/fetch/$s_!Gsyk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F234e6cd0-0fcf-40d4-b621-11da2b227eff_800x187.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>Using ALIAS and URL Redirect&nbsp;Records</h4><p>These are records not in the <a href="https://www.ietf.org/rfc/rfc1035.txt">DNS RFC</a>, so they are only supported by certain DNS providers. <strong>ALIAS </strong>is a pseudo-record that works like a <strong>CNAME </strong>but can be used for both the root domain and sub-domains. The <strong>URL Redirect record</strong> is used to redirect a domain to another URL/domain name.</p><h3>Subdomain takeover&nbsp;attack</h3><p>The goal of this attack is to point a victim&#8217;s domain to an attacker&#8217;s address. This is closely related to the domain resolutions I have described above. In the case of using A/AAAA records for the resolution, it&#8217;s not worth mentioning but the remaining cases have weaknesses.</p><p>Let&#8217;s look at a scenario as follows:</p><ul><li><p>You own <a href="http://x.example.com/"><code>x.example.com</code></a></p></li><li><p><a href="http://x.example.com/"><code>x.example.com</code></a> points to <a href="http://another.domain.com/"><code>another.domain.com</code></a> by using a CNAME record</p></li></ul><p>In order to control the content of <a href="http://x.example.com/"><code>http://x.example.com</code></a>, we have to control the content of <a href="http://another.domain.com/"><code>http://another.domain.com</code></a>. This is possibile, if:</p><ul><li><p><a href="http://another.domain.com/"><code>another.domain.com</code></a> is an expired domain -&gt; Buy this domain</p></li><li><p><a href="http://domain.com/"><code>domain.com</code></a> belongs to an Internet service and it allows to create a sub-domain like <a href="http://another.domain.com/"><code>another.domain.com</code></a> if that name is available. You can find out many serives having that feature such as Github, Heroku, Amazon S3, Shopify, etc.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gUg0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gUg0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png 424w, https://substackcdn.com/image/fetch/$s_!gUg0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png 848w, https://substackcdn.com/image/fetch/$s_!gUg0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png 1272w, https://substackcdn.com/image/fetch/$s_!gUg0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gUg0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gUg0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png 424w, https://substackcdn.com/image/fetch/$s_!gUg0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png 848w, https://substackcdn.com/image/fetch/$s_!gUg0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png 1272w, https://substackcdn.com/image/fetch/$s_!gUg0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55cd8e81-ef08-4609-b87f-fdbf5bddf3b9_799x289.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>I did not think this attack was effective until I proceeded to find the subdomains of many big firms and checked the feasibility of the attack. As I said at the beginning, the results are verysurprising. One of them are <a href="http://microsoft.com/">microsoft.com</a>, but subdomain takeover vulnerability is considered as out-of-scope of their bug bounty programs so I was only acknowledged in their Hall of Fame.</p><p>The method I used was:</p><ul><li><p>Find all subdomains from a domain by using <a href="https://github.com/everping/substack">SubStack</a></p></li><li><p>Check the exploitable signature of sub-domains found. I have used signs published <a href="https://github.com/EdOverflow/can-i-take-over-xyz">here </a>as well as my own techniques.</p></li></ul><p>In the next article, I will present more specific cases that I have successfully exploited.</p>]]></content:encoded></item><item><title><![CDATA[A python script get Alexa top sites]]></title><description><![CDATA[If you want to get top visited websites, Alexa is a reliable source. But, sadly, they only free the first 50 websites, and if you want to&#8230;]]></description><link>https://secaholic.com/p/a-python-script-get-alexa-top-sites-4652768dfa96</link><guid isPermaLink="false">https://secaholic.com/p/a-python-script-get-alexa-top-sites-4652768dfa96</guid><dc:creator><![CDATA[Trung Nguyen]]></dc:creator><pubDate>Fri, 09 Feb 2018 08:39:27 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/bc48317e-e857-44f8-94d1-ccbf8a4937d8_800x534.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TZln!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TZln!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TZln!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TZln!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TZln!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TZln!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TZln!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TZln!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TZln!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TZln!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F384b5635-b8f5-478c-9493-31c273af8dda_800x534.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>If you want to get top visited websites, <a href="https://www.alexa.com/topsites">Alexa</a> is a reliable source. But, sadly, they only free the first 50 websites, and if you want to get more, you have to pay a fee.</p><p>One of the ways to obtain that list is to use <a href="https://aws.amazon.com/alexa-top-sites/">AWS service </a>with price $0.0025 per URL. Everything seems easy when you are willing to pay, however, their sample code is only available ruby, php, java that I do not like them. I have rewritten a small script in Python to do this, you can check it bellow.</p><p>Anw, the process of creating AWS authorization headers is extremely complex.</p><p><a href="https://github.com/everping/aws-alexa-top-sites">My source code</a></p>]]></content:encoded></item><item><title><![CDATA[Using Remote Asset Bundle in Unity3D framework really safe?]]></title><description><![CDATA[Introdution]]></description><link>https://secaholic.com/p/using-remote-asset-bundle-in-unity3d-framework-really-safe-8cd2d67d55f1</link><guid isPermaLink="false">https://secaholic.com/p/using-remote-asset-bundle-in-unity3d-framework-really-safe-8cd2d67d55f1</guid><dc:creator><![CDATA[Trung Nguyen]]></dc:creator><pubDate>Fri, 03 Mar 2017 12:12:12 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/6465b28f-ef34-48c6-b76d-9bdecde004d9_614x1040.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Introdution</h3><p>If you are a mobile application developer, you may be interested in exposing sensitive information from your application because of decompilation a mobile app such as Android app is not too difficult.</p><p>A friend of mine recently developed an Android application using Unity framework, it can hide code by downloading the required modules from a trusted-server at the runtime.</p><p>I really doubt this method, so I try to reverse this app to obtain the hidden code. And in this article, I will describe my work process.</p><p>You can download the APK file <a href="https://github.com/everping/remote-asset-bundle-unity/raw/master/app.apk">here</a>. Notice this file is not the original version, it was modified to fit the article.</p><h3>Analysis</h3><h4>Running</h4><p>When running the application on an Android Emulator, you will see results like bellow.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EEWf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EEWf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png 424w, https://substackcdn.com/image/fetch/$s_!EEWf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png 848w, https://substackcdn.com/image/fetch/$s_!EEWf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png 1272w, https://substackcdn.com/image/fetch/$s_!EEWf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EEWf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EEWf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png 424w, https://substackcdn.com/image/fetch/$s_!EEWf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png 848w, https://substackcdn.com/image/fetch/$s_!EEWf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png 1272w, https://substackcdn.com/image/fetch/$s_!EEWf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f04960f-5fd3-4739-961b-7857ae2a16c1_614x1040.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><h4>Static Testing</h4><p>In Unity Framework, the main code is written by C# language and compiled to a <em>dll</em> file. It&#8217;s compressed in the the binary file. After extract the apk file, we can see it at: <em>/assets/bin/Data/Managed/Assembly-CSharp.dll</em></p><p>We easily decompile a dll written in C# by using decompilers such as dnspy, ilspy or dotpeek&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VZ-Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VZ-Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png 424w, https://substackcdn.com/image/fetch/$s_!VZ-Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png 848w, https://substackcdn.com/image/fetch/$s_!VZ-Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png 1272w, https://substackcdn.com/image/fetch/$s_!VZ-Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VZ-Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VZ-Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png 424w, https://substackcdn.com/image/fetch/$s_!VZ-Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png 848w, https://substackcdn.com/image/fetch/$s_!VZ-Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png 1272w, https://substackcdn.com/image/fetch/$s_!VZ-Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b13534d-3b30-4dbe-b4eb-f419f1ac96b0_800x664.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption"><em>Assembly-CSharp.dll after decompilation</em></figcaption></figure></div><p>At line 39, the app loads Component <em>ExtendModuleActivity</em></p><p>At line 40 and 41, displaying the content of the Component above to screen. It is <em>&#8220;Find me if you can!&#8221; </em>string that we have seen when runing the app.</p><p>So, where is <em>ExtendModuleActivity</em>? I haven&#8217;t seen it in the decompiled code. I assume that the decompiler is not effective and it does not show the source code completely</p><h4>Dynamic Testing</h4><p>I suspect the app downloaded required modules via HTTP, so I do some configs to force this app goes through a HTTP Proxy (such as ZAP, BurpSuite&nbsp;&#8230;) to know what it actually does. Note that you make sure your proxy can sniff the HTTPS Request by trusting Proxy&#8217;s Certificate in Android Client.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yctF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yctF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png 424w, https://substackcdn.com/image/fetch/$s_!yctF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png 848w, https://substackcdn.com/image/fetch/$s_!yctF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png 1272w, https://substackcdn.com/image/fetch/$s_!yctF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yctF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yctF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png 424w, https://substackcdn.com/image/fetch/$s_!yctF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png 848w, https://substackcdn.com/image/fetch/$s_!yctF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png 1272w, https://substackcdn.com/image/fetch/$s_!yctF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8b88dd5-5f9c-4707-b17e-8c4d51b01384_614x1040.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Setup Proxy</figcaption></figure></div><p>Then open the app and observe at the proxy</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ngbr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ngbr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png 424w, https://substackcdn.com/image/fetch/$s_!Ngbr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png 848w, https://substackcdn.com/image/fetch/$s_!Ngbr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png 1272w, https://substackcdn.com/image/fetch/$s_!Ngbr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ngbr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ngbr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png 424w, https://substackcdn.com/image/fetch/$s_!Ngbr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png 848w, https://substackcdn.com/image/fetch/$s_!Ngbr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png 1272w, https://substackcdn.com/image/fetch/$s_!Ngbr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e2a31eb-e3ed-4272-9f5c-ef7ac477944a_800x433.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This app downloaded two resource from a remote server:</p><ul><li><p><a href="https://raw.githubusercontent.com/everping/remote-asset-bundle-unity/master/assets/ping">https://raw.githubusercontent.com/everping/remote-asset-bundle-unity/master/assets/ping</a></p></li><li><p><a href="https://raw.githubusercontent.com/everping/remote-asset-bundle-unity/master/assets/bundle">https://raw.githubusercontent.com/everping/remote-asset-bundle-unity/master/assets/bundle</a></p></li></ul><p>The first resource is a text file that contains the content that appears on the screen, and bundle seems to contain ExtendModuleActivity that we are looking for.</p><p>In Unity Framework:</p><blockquote><p>An AssetBundle is a collection of assets and/or scenes from a project saved in a compact file with the purpose of being loaded separately to the built executable application.</p></blockquote><blockquote><p>AssetBundles can contain scripts as TextAssets but as such they will not be actual executable code.</p></blockquote><h4>Extract the&nbsp;Bundle</h4><p>I found a pretty good tool to extract bundles called <a href="https://github.com/DerPopo/UABE">Unity Assets Bundle Extractor</a></p><p>Load our bundle to UABE and view its information</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FIfa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FIfa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png 424w, https://substackcdn.com/image/fetch/$s_!FIfa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png 848w, https://substackcdn.com/image/fetch/$s_!FIfa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png 1272w, https://substackcdn.com/image/fetch/$s_!FIfa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FIfa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FIfa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png 424w, https://substackcdn.com/image/fetch/$s_!FIfa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png 848w, https://substackcdn.com/image/fetch/$s_!FIfa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png 1272w, https://substackcdn.com/image/fetch/$s_!FIfa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c0510c2-fea4-4d2a-8da1-cbc19782e966_697x588.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Then Export Raw to obtain the bytecode. Using an editor / hex editor, we can realize that it is PE File (beginning with MZ), but was inserted into the previous another section. We just remove this section to restore PE header file.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ObuA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ObuA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png 424w, https://substackcdn.com/image/fetch/$s_!ObuA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png 848w, https://substackcdn.com/image/fetch/$s_!ObuA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png 1272w, https://substackcdn.com/image/fetch/$s_!ObuA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ObuA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ObuA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png 424w, https://substackcdn.com/image/fetch/$s_!ObuA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png 848w, https://substackcdn.com/image/fetch/$s_!ObuA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png 1272w, https://substackcdn.com/image/fetch/$s_!ObuA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbc6da8d-c5e1-4a9f-8b16-141d4f62d909_800x124.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The rest is decompiling the new file, and this is what we are looking for&nbsp;:)</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oCq6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oCq6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png 424w, https://substackcdn.com/image/fetch/$s_!oCq6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png 848w, https://substackcdn.com/image/fetch/$s_!oCq6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png 1272w, https://substackcdn.com/image/fetch/$s_!oCq6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oCq6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de448db8-0376-4f92-ad01-64dbf10d236e_800x433.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oCq6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png 424w, https://substackcdn.com/image/fetch/$s_!oCq6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png 848w, https://substackcdn.com/image/fetch/$s_!oCq6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png 1272w, https://substackcdn.com/image/fetch/$s_!oCq6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde448db8-0376-4f92-ad01-64dbf10d236e_800x433.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Conclusion</h3><p>As you can see, securing applications is not an easy task. Using Remote Asset Bundle is not a perfect way to hide your source code in Unity Framework, and in addition it is appropriate only when your application requires an internet connection. This article does not go into how to prevent attacks, I just hope it can be to raise awareness about some risks in your application. Good luck!</p><p>P/s: Maybe I will implement this technique into a CTF challenge in the future.</p>]]></content:encoded></item><item><title><![CDATA[Client Side Template Injection — Kipalog.com]]></title><link>https://secaholic.com/p/client-side-template-injection-kipalog-com-c37583642760</link><guid isPermaLink="false">https://secaholic.com/p/client-side-template-injection-kipalog-com-c37583642760</guid><dc:creator><![CDATA[Trung Nguyen]]></dc:creator><pubDate>Sat, 18 Feb 2017 02:40:49 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/df272612-1106-463a-89e9-8a7a95e59f26_800x507.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-6gd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-6gd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png 424w, https://substackcdn.com/image/fetch/$s_!-6gd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png 848w, https://substackcdn.com/image/fetch/$s_!-6gd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png 1272w, https://substackcdn.com/image/fetch/$s_!-6gd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-6gd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-6gd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png 424w, https://substackcdn.com/image/fetch/$s_!-6gd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png 848w, https://substackcdn.com/image/fetch/$s_!-6gd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png 1272w, https://substackcdn.com/image/fetch/$s_!-6gd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F495cb925-c7ed-4a4c-9a06-fd508f878ad8_800x507.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><div id="youtube2-1Y-ao5FYQOM" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;1Y-ao5FYQOM&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/1Y-ao5FYQOM?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div></figure></div>]]></content:encoded></item><item><title><![CDATA[Dirty Cow — CVE-2016-5195]]></title><description><![CDATA[V&#7873; Dirty Cow]]></description><link>https://secaholic.com/p/phan-tich-loi-dirty-cow-cve-2016-5195-4cdead55ad7d</link><guid isPermaLink="false">https://secaholic.com/p/phan-tich-loi-dirty-cow-cve-2016-5195-4cdead55ad7d</guid><dc:creator><![CDATA[Trung Nguyen]]></dc:creator><pubDate>Sat, 29 Oct 2016 07:22:12 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/8d95e183-fef8-4df0-9bb6-9ad9520dae22_522x310.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>V&#7873; Dirty&nbsp;Cow</h3><p>G&#7847;n &#273;&#226;y t&#244;i c&#243; th&#7845;y nhi&#7873;u th&#244;ng tin v&#7873; l&#7895; h&#7893;ng n&#224;y, &#273;&#432;&#7907;c &#273;&#225;nh gi&#225; l&#224; <em>Serious</em>, cho ph&#233;p leo thang &#273;&#7863;c quy&#7873;n, &#7843;nh h&#432;&#7903;ng &#273;&#7871;n nhi&#7873;u distro Linux&#8230; T&#244;i c&#361;ng kh&#244;ng hi&#7875;u sao m&#7897;t l&#7895; h&#7893;ng sau khi &#273;&#432;&#7907;c c&#244;ng b&#7889; th&#236; c&#243; logo, website ri&#234;ng, Twitter, Facebook Page th&#7853;m ch&#237; l&#224; c&#243; c&#7843; m&#7897;t c&#225;i <a href="http://www.zazzle.com/collections/dirty_cow_collection-119587962650451153">shop b&#225;n &#273;&#7891; l&#432;u ni&#7879;m&nbsp;</a>:| V&#236; t&#242; m&#242; n&#234;n c&#361;ng mu&#7889;n t&#236;m hi&#7875;u c&#417; ch&#7871; ho&#7841;t &#273;&#7897;ng c&#7911;a vuln n&#224;y, d&#249; t&#244;i kh&#244;ng ph&#7843;i ng&#432;&#7901;i chuy&#234;n research OS Kernel.</p><p>Dirty COW &#273;&#432;&#7907;c g&#225;n m&#227; l&#7895;i CVE-2016-5195, l&#224; m&#7897;t c&#225;i bug Linux Kernel Race condition cho ph&#233;p leo thang &#273;&#7863;c quy&#7873;n th&#244;ng qua Local Exploit (ngh&#297;a l&#224; k&#7867; t&#7845;n c&#244;ng ph&#7843;i v&#224;o &#273;&#432;&#7907;c server n&#7841;n nh&#226;n tr&#432;&#7899;c v&#7899;i quy&#7873;n Normal r&#7891;i d&#249;ng l&#7895;i n&#224;y &#273;&#7875; n&#226;ng l&#234;n quy&#7873;n root). Dirty COW &#7843;nh h&#432;&#7903;ng &#273;&#7871;n nhi&#7873;u phi&#234;n b&#7843;n Kernel(2.6.22&#8211;3.9) v&#224; h&#7847;u h&#7871;t c&#225;c distro Linux th&#244;ng d&#7909;ng, nh&#432;ng c&#225;ch khai th&#225;c th&#236; r&#7845;t &#273;&#417;n gi&#7843;n v&#224; hi&#7879;u qu&#7843;.</p><p>Ng&#432;&#7901;i ph&#225;t hi&#7879;n ra l&#7895;i n&#224;y, Phil Oester, c&#244;ng b&#7889; sau khi m&#7897;t server anh n&#224;y qu&#7843;n l&#253; b&#7883; t&#7845;n c&#244;ng b&#7857;ng ch&#237;nh Dirty COW. C&#243; ngh&#297;a l&#224; m&#227; khai th&#225;c hi&#7879;n c&#243; &#273;&#227; b&#7883; d&#249;ng &#273;&#7875; t&#7845;n c&#244;ng th&#7921;c t&#7871; t&#7915; r&#7845;t l&#226;u r&#7891;i. Cha &#273;&#7867; Linux, Linus Torvalds c&#361;ng &#273;&#7873; c&#7853;p trong b&#7843;n v&#225; l&#7895;i r&#7857;ng anh &#273;&#227; m&#432;&#7901;ng t&#432;&#7907;ng l&#7895;i n&#224;y c&#243; th&#7875; x&#7843;y ra, v&#224; &#273;&#227; &#273;&#432;a ra b&#7843;n v&#225; v&#224;o n&#259;m 2005 nh&#432;ng n&#243; &#273;&#227; kh&#244;ng th&#7921;c s&#7921; ph&#225;t huy t&#225;c d&#7909;ng.</p><p>Trong b&#224;i vi&#7871;t n&#224;y, t&#244;i s&#7869; c&#7889; g&#7855;ng gi&#7843;i th&#237;ch chi ti&#7871;t c&#225;ch l&#7895;i n&#224;y ho&#7841;t &#273;&#7897;ng. V&#224; n&#7871;u c&#243; g&#236; sai s&#243;t, hy v&#7885;ng ai &#273;&#243; c&#243; th&#7875; g&#243;p &#253; th&#234;m.</p><h3><strong>Chi ti&#7871;t&nbsp;l&#7895;i</strong></h3><p>M&#7897;t c&#225;ch ph&#226;n t&#237;ch bug hi&#7879;u qu&#7843; l&#224; d&#7921;a v&#224;o m&#227; khai th&#225;c &#273;&#227; c&#243;. D&#432;&#7899;i &#273;&#226;y l&#224; &#273;o&#7841;n m&#227; &#273;&#432;&#7907;c cung c&#7845;p t&#7915; repository github &#8220;ch&#237;nh th&#7913;c&#8221; c&#7911;a Dirty COW.</p><p><strong><a href="https://github.com/dirtycow/dirtycow.github.io/blob/master/dirtyc0w.c" title="https://github.com/dirtycow/dirtycow.github.io/blob/master/dirtyc0w.c">dirtycow/dirtycow.github.io</a></strong><a href="https://github.com/dirtycow/dirtycow.github.io/blob/master/dirtyc0w.c" title="https://github.com/dirtycow/dirtycow.github.io/blob/master/dirtyc0w.c"><br></a><em><a href="https://github.com/dirtycow/dirtycow.github.io/blob/master/dirtyc0w.c" title="https://github.com/dirtycow/dirtycow.github.io/blob/master/dirtyc0w.c">dirtycow.github.io - Dirty COW</a></em><a href="https://github.com/dirtycow/dirtycow.github.io/blob/master/dirtyc0w.c" title="https://github.com/dirtycow/dirtycow.github.io/blob/master/dirtyc0w.c">github.com</a></p><p>M&#227; khai th&#225;c n&#224;y cho ph&#233;p s&#7917;a n&#7897;i dung m&#7897;t file &#273;&#227; &#273;&#432;&#7907;c set permision <strong>Read Only</strong>, ho&#7841;t &#273;&#7897;ng &#273;&#432;&#7907;c tr&#234;n h&#7847;u h&#7871;t c&#225;c distro Linux tr&#7915; Red Hat Enterprise Linux 5 v&#224; 6 (l&#253; do s&#7869; gi&#7843;i th&#237;ch &#7903; d&#432;&#7899;i). C&#225;ch d&#249;ng th&#236; c&#243; th&#7875; th&#7845;y d&#7877; hi&#7875;u th&#7871; n&#224;y:</p><pre><code>$ sudo -s</code></pre><pre><code># echo this is not a test &gt; foo</code></pre><pre><code># chmod 0404 foo</code></pre><pre><code>$ ls -lah 
foo-r &#8212; &#8212; -r &#8212; 1 root root 19 Oct 20 15:23 foo</code></pre><pre><code>$ cat foo
this is not a test</code></pre><pre><code>$ ./dirtyc0w foo m00000000000000000</code></pre><pre><code>$ cat foo
m00000000000000000</code></pre><p>Theo lu&#7891;ng x&#7917; l&#253; c&#7911;a ch&#432;&#417;ng tr&#236;nh, ch&#250;ng ta c&#243; th&#7875; chia nh&#7887; c&#225;c c&#244;ng vi&#7879;c m&#224; n&#243; th&#7921;c hi&#7879;n nh&#432; sau.</p><h4><strong>1. Load file v&#224; map v&#224;o Virtual Address&nbsp;Space</strong></h4><p>T&#7841;i d&#242;ng 87, ch&#432;&#417;ng tr&#236;nh m&#7903; file input v&#224; &#273;&#7885;c v&#7899;i ch&#7871; &#273;&#7897; Read Only. Ti&#7871;p &#273;&#7871;n l&#7845;y th&#244;ng tin file ghi v&#224;o bi&#7871;n con tr&#7887; <em>st </em>v&#224; l&#432;u l&#7841;i t&#234;n file v&#224;o bi&#7871;n <em>name. </em>M&#7885;i th&#7913; kh&#225; r&#245; r&#224;ng.</p><pre><code>87: f=open(argv[1],O_RDONLY); 
88: fstat(f,&amp;st); 
89: name=argv[1];</code></pre><p>&#7902; d&#242;ng 101, n&#7897;i dung file &#273;&#432;&#7907;c map v&#224;o Virtual Address Space b&#7857;ng h&#224;m <em>mmap()</em></p><pre><code>101: map=mmap(NULL,st.st_size,PROT_READ,MAP_PRIVATE,f,0);</code></pre><p><em>mmap()</em> kh&#244;ng copy n&#7897;i dung file &#273;&#432;&#7907;c v&#224;o RAM, m&#224; &#225;nh x&#7841; n&#7897;i dung n&#224;y v&#224;o v&#249;ng nh&#7899; &#7843;o c&#7911;a ti&#7871;n tr&#236;nh &#273;ang ch&#7841;y.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fJmb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fJmb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png 424w, https://substackcdn.com/image/fetch/$s_!fJmb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png 848w, https://substackcdn.com/image/fetch/$s_!fJmb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png 1272w, https://substackcdn.com/image/fetch/$s_!fJmb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fJmb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/02c39920-0364-493b-8518-ae31ecc317b2_522x310.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fJmb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png 424w, https://substackcdn.com/image/fetch/$s_!fJmb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png 848w, https://substackcdn.com/image/fetch/$s_!fJmb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png 1272w, https://substackcdn.com/image/fetch/$s_!fJmb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02c39920-0364-493b-8518-ae31ecc317b2_522x310.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Ho&#7841;t &#273;&#7897;ng c&#7911;a&nbsp;mmap()</figcaption></figure></div><p>H&#227;y xem qua &#273;&#7863;c t&#7843; h&#224;m:</p><pre><code>void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);</code></pre><p>Tham s&#7889; <em>addr</em> trong tr&#432;&#7901;ng h&#7907;p n&#224;y l&#224; NULL, ngh&#297;a l&#224; kernel t&#7921; quy&#7871;t &#273;&#7883;nh &#273;&#7883;a ch&#7881; l&#432;u tr&#7919;, &#273;&#7897; d&#224;i v&#249;ng nh&#7899; <em>length</em> b&#7857;ng &#273;&#7897; l&#7899;n c&#7911;a file <em>st.st_size, </em>ch&#7871; &#273;&#7897; truy c&#7853;p <em>prot </em>v&#7851;n<em> </em>&#273;&#432;&#7907;c &#273;&#7875; l&#224; Read Only <em>PROT_READ </em>v&#236; th&#7871; v&#249;ng mapping n&#224;y ch&#7881; c&#243; th&#7875; &#273;&#432;&#7907;c &#273;&#7885;c, f<em>d </em>v&#224; <em>offset </em>t&#432;&#417;ng &#7913;ng v&#7899;i file input v&#224; v&#7883; tr&#237; b&#7855;t &#273;&#7847;u load file. V&#224; tham s&#7889;quan tr&#7885;ng nh&#7845;t &#7903; &#273;&#226;y, <em>flags</em> &#273;&#432;&#7907;c g&#225;n b&#7857;ng <em>MAP_PRIVATE.</em></p><p>Theo nh&#432; t&#224;i li&#7879;u c&#7911;a linux:</p><blockquote><p><strong>MAP_PRIVATE: </strong>Create a private copy-on-write mapping</p></blockquote><p><em><strong><a href="https://en.wikipedia.org/wiki/Copy-on-write">Copy-on-write</a> </strong></em>l&#224; m&#7897;t kh&#225;i ni&#7879;m quan tr&#7885;ng c&#7911;a h&#7879; &#273;i&#7873;u h&#224;nh, t&#432; t&#432;&#7903;ng c&#7911;a n&#243; l&#224; n&#7871;u m&#7897;t ti&#7871;n tr&#236;nh &#273;&#7885;c m&#7897;t t&#224;i nguy&#234;n d&#7841;ng copy-on-write th&#236; s&#7869; v&#7851;n nh&#432; &#273;&#7885;c t&#224;i nguy&#234;n th&#432;&#7901;ng, nh&#432;ng n&#7871;u th&#7921;c hi&#7879;n thao t&#225;c ghi/s&#7917;a th&#236; h&#7879; &#273;i&#7873;u h&#224;nh s&#7869; t&#7841;o m&#7897;t b&#7843;n sao c&#7911;a t&#224;i nguy&#234;n &#273;&#243; v&#224; c&#7853;p nh&#7853;t c&#225;c n&#7897;i dung m&#7899;i v&#224;o &#273;&#226;y, b&#7843;n g&#7889;c kh&#244;ng b&#7883; thay &#273;&#7893;i.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!enDB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!enDB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png 424w, https://substackcdn.com/image/fetch/$s_!enDB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png 848w, https://substackcdn.com/image/fetch/$s_!enDB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png 1272w, https://substackcdn.com/image/fetch/$s_!enDB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!enDB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!enDB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png 424w, https://substackcdn.com/image/fetch/$s_!enDB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png 848w, https://substackcdn.com/image/fetch/$s_!enDB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png 1272w, https://substackcdn.com/image/fetch/$s_!enDB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff30957c3-245c-4639-ac4d-4029b8bd237f_765x399.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Ho&#7841;t &#273;&#7897;ng copy-on-write</figcaption></figure></div><p>V&#7899;i c&#7901; <strong>MAP_PRIVATE</strong>, b&#7843;n mapping &#273;&#432;&#7907;c x&#7917; l&#253; ri&#234;ng v&#7899;i ti&#7871;n tr&#236;nh s&#7903; h&#7919;u n&#243;. C&#225;c thay &#273;&#7893;i v&#7873; n&#7897;i dung tr&#234;n mapping kh&#244;ng &#7843;nh h&#432;&#7903;ng &#273;&#7871;n b&#7843;n g&#7889;c v&#224; c&#361;ng kh&#244;ng ch&#7883;u s&#7921; t&#225;c &#273;&#7897;ng c&#7911;a b&#7845;t k&#7923; ti&#7871;n tr&#236;nh n&#224;o kh&#225;c. C&#7909; th&#7875; h&#417;n, n&#7871;u ch&#250;ng ta s&#7917;a n&#7897;i dung file input sau khi &#273;&#227; map v&#224;o Virtual Address Space th&#236; file g&#7889;c kh&#244;ng b&#7883; thay &#273;&#7893;i.</p><p>C&#7909;m <strong>Copy-on-write </strong>c&#361;ng ch&#237;nh l&#224; d&#7841;ng &#273;&#7847;y &#273;&#7911; c&#7911;a t&#7915; <strong>COW </strong>trong c&#225;i t&#234;n <strong>Dirty COW</strong></p><h4><strong>2. Race Condition</strong></h4><p>Nh&#432; &#273;&#227; n&#243;i &#7903; ph&#7847;n &#273;&#7847;u, Dirty COW l&#224; m&#7897;t l&#7895;i <a href="https://en.wikipedia.org/wiki/Race_condition">Race Condition</a>, v&#224; l&#7895;i n&#224;y &#273;&#432;&#7907;c t&#7841;o ra b&#7903;i 2 d&#242;ng l&#7879;nh sau:</p><pre><code>106: pthread_create(&amp;pth1,NULL,madviseThread,argv[1]); 
107: pthread_create(&amp;pth2,NULL,procselfmemThread,argv[2]);</code></pre><p>V&#7873; c&#417; b&#7843;n th&#236; Race Condition x&#7843;y ra khi m&#224; c&#243; nhi&#7873;u h&#417;n m&#7897;t lu&#7891;ng th&#7921;c thi c&#249;ng &#273;&#7885;c/ghi v&#224;o t&#224;i nguy&#234;n d&#249;ng chung d&#7851;n &#273;&#7871;n xung &#273;&#7897;t v&#224; nh&#7919;ng t&#236;nh hu&#7889;ng kh&#244;ng &#273;o&#225;n &#273;&#432;&#7907;c tr&#432;&#7899;c. Trong tr&#432;&#7901;ng h&#7907;p c&#7911;a <em>Dirty COW, </em>c&#225;c lu&#7891;ng th&#7921;c thi n&#224;y l&#224; 2 thread <em>madviseThread </em>v&#224; <em>procselfmemThread</em>, c&#242;n t&#224;i nguy&#234;n d&#249;ng chung l&#224; b&#7843;n <em>mapping </em>c&#7911;a file input. Ta s&#7869; &#273;i c&#7909; th&#7875; v&#224;o t&#7915;ng thread.</p><p><strong>1. madviseThread()</strong></p><p>Ch&#250; &#253; v&#224;o d&#242;ng 45, &#273;&#226;y l&#224; l&#7879;nh quan tr&#7885;ng nh&#7845;t c&#7911;a thread n&#224;y. C&#242;n v&#242;ng l&#7863;p for ch&#7881; gi&#250;p cho Race &#273;&#432;&#7907;c di&#7877;n ra.</p><pre><code>45: c+=madvise(map,100,MADV_DONTNEED);</code></pre><p><em>madvise </em>l&#224; m&#7897;t system call, n&#243; &#273;&#432;a ra ch&#7881; th&#7883; cho kernel bi&#7871;t ph&#7843;i l&#224;m g&#236; v&#7899;i kh&#244;ng gian nh&#7899; b&#7855;t &#273;&#7847;u t&#7915; <em>addr </em>v&#224; c&#243; &#273;&#7897; d&#224;i <em>length</em></p><pre><code>int madvise(void *addr, size_t length, int advice);</code></pre><p>&#7902; &#273;&#226;y, ch&#7881; th&#7883; l&#224; <em>MADV_DONTNEED</em>, n&#243; y&#234;u c&#7847;u kernel <strong>kh&#244;ng </strong>s&#7917; d&#7909;ng kh&#244;ng gian nh&#7899; n&#224;y n&#7919;a v&#224; c&#243; th&#7875; gi&#7843;i ph&#243;ng t&#224;i nguy&#234;n li&#234;n k&#7871;t &#273;&#7871;n file input. L&#250;c n&#224;y v&#249;ng nh&#7899; tr&#234;n tr&#7903; th&#224;nh <em><strong><a href="https://en.wikipedia.org/wiki/Dirty_bit">dirty</a></strong></em>, &#273;&#226;y l&#224; t&#7915; &#273;&#7847;u ti&#234;n trong t&#234;n <strong>Dirty COW</strong>. V&#7899;i v&#249;ng nh&#7899; dirty, l&#7841;i c&#243; th&#234;m ch&#7881; th&#7883; <em>MADV_DONTNEED </em>(do th&#7921;c hi&#7879;n v&#242;ng l&#7863;p), d&#7919; li&#7879;u ghi v&#224;o s&#7869; b&#7883; <em>&#8220; thrown away&#8221;</em>, c&#242;n d&#7919; li&#7879;u &#273;&#7885;c ra v&#7851;n s&#7869; &#273;&#432;&#7907;c l&#7845;y t&#7915; file g&#7889;c.</p><p>T&#243;m l&#7841;i, m&#7909;c &#273;&#237;ch thread n&#224;y l&#224; ng&#259;n c&#7843;n vi&#7879;c s&#7917; d&#7909;ng v&#249;ng mapping.</p><p><strong>2. procselfmemThread()</strong></p><pre><code>61:     int f=open("/proc/self/mem",O_RDWR); 
62:     int i,c=0; 
63:     for(i=0;i&lt;100000000;i++) {
64: /*
65: You have to reset the file pointer to the memory position.
66: */ 
67:         lseek(f,(uintptr_t) map,SEEK_SET);      
68:         c+=write(f,str,strlen(str)); 
69: }</code></pre><p>Ch&#250;ng ta &#273;&#227; bi&#7871;t l&#224; kh&#244;ng th&#7875; ghi v&#224;o file input &#273;&#432;&#7907;c, do n&#243; &#273;&#432;&#7907;c set permission <strong>Read Only</strong>. V&#236; th&#7871;, ng&#432;&#7901;i vi&#7871;t m&#227; khai th&#225;c n&#224;y th&#7921;c hi&#7879;n m&#7897;t trick l&#224; ghi v&#224;o v&#249;ng kh&#244;ng gian nh&#7899; &#273;&#227; &#273;&#432;&#7907;c map, thay v&#236; file g&#7889;c. C&#225;ch th&#7921;c hi&#7879;n l&#224; th&#244;ng qua <em><strong>/proc/self/mem.</strong></em></p><p>Trong c&#225;c h&#7879; &#273;i&#7873;u h&#224;nh *nix th&#236; <em><a href="https://en.wikipedia.org/wiki/Everything_is_a_file">Everything is a file</a></em> v&#224; memory c&#361;ng kh&#244;ng ngo&#7841;i l&#7879;, v&#249;ng nh&#7899; c&#7911;a m&#7895;i ti&#7871;n tr&#236;nh c&#243; th&#7875; truy c&#7853;p th&#244;ng qua file <em>/proc/&lt;pid&gt;/mem</em>. &#7902; &#273;&#226;y, POC process truy c&#7853;p ch&#237;nh v&#249;ng nh&#7899; c&#7911;a m&#236;nh n&#234;n <em>pid = self</em>.</p><p>V&#224; &#273;o&#7841;n m&#227; ph&#237;a tr&#234;n th&#7921;c hi&#7879;n vi&#7879;c ghi v&#224;o v&#249;ng mapping m&#7897;t c&#225;ch li&#234;n t&#7909;c (b&#7857;ng v&#242;ng l&#7863;p) d&#7919; li&#7879;u m&#224; user truy&#7873;n v&#224;o.</p><p>Ph&#432;&#417;ng ph&#225;p ghi v&#224;o mem n&#224;y ho&#7841;t &#273;&#7897;ng t&#7889;t tr&#234;n ph&#7847;n l&#7899;n distro Linux tr&#7915; Red Hat Enterprise Linux 5 v&#224; 6, v&#236; m&#7845;y distro n&#224;y kh&#244;ng cho ph&#233;p ghi v&#224;o <em>/proc/self/mem</em>. &#272;&#7845;y l&#224; l&#253; do t&#7841;i sao m&#227; khai th&#225;c n&#224;y kh&#244;ng ho&#7841;t &#273;&#7897;ng &#273;&#432;&#7907;c tr&#234;n nh&#7919;ng distro &#273;&#7845;y. &#7902; nh&#7919;ng tr&#432;&#7901;ng h&#7907;p n&#224;y th&#236; c&#243; m&#7897;t c&#225;ch kh&#225;c thay th&#7871; l&#224; d&#249;ng <a href="https://github.com/dirtycow/dirtycow.github.io/blob/master/pokemon.c"><code>ptrace()</code> system call</a>.</p><p>&#272;&#7871;n &#273;&#226;y th&#236; ch&#250;ng ta c&#243; th&#7875; h&#236;nh dung ra &#273;&#432;&#7907;c l&#224; c&#243; 1 thread li&#234;n t&#7909;c free v&#249;ng mapping, c&#242;n thread c&#242;n l&#7841;i th&#236; li&#234;n t&#7909;c ghi v&#224;o &#273;&#7845;y.</p><p>N&#7871;u m&#7885;i chuy&#7879;n t&#7889;t &#273;&#7865;p th&#236; s&#7869; nh&#432; th&#7871; n&#224;y:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Um77!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Um77!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png 424w, https://substackcdn.com/image/fetch/$s_!Um77!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png 848w, https://substackcdn.com/image/fetch/$s_!Um77!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png 1272w, https://substackcdn.com/image/fetch/$s_!Um77!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Um77!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Um77!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png 424w, https://substackcdn.com/image/fetch/$s_!Um77!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png 848w, https://substackcdn.com/image/fetch/$s_!Um77!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png 1272w, https://substackcdn.com/image/fetch/$s_!Um77!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb71bf428-4144-4c57-9fd2-7fec28f94ea6_515x330.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Tuy nhi&#234;n th&#7921;c t&#7871; l&#7841;i x&#7843;y ra kh&#244;ng nh&#432; mong &#273;&#7907;i (c&#361;ng l&#224; v&#236; Race):</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pur-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pur-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png 424w, https://substackcdn.com/image/fetch/$s_!pur-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png 848w, https://substackcdn.com/image/fetch/$s_!pur-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png 1272w, https://substackcdn.com/image/fetch/$s_!pur-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pur-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pur-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png 424w, https://substackcdn.com/image/fetch/$s_!pur-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png 848w, https://substackcdn.com/image/fetch/$s_!pur-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png 1272w, https://substackcdn.com/image/fetch/$s_!pur-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f2fbc9d-e30f-4bcc-926a-cb070614ea7d_515x347.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Ch&#250; &#253; m&#7897;t ch&#250;t, ch&#250;ng ta th&#7845;y l&#224; n&#7871;u 2 thread tr&#234;n ho&#7841;t &#273;&#7897;ng &#273;&#7897;c l&#7853;p ho&#7863;c c&#243; th&#7913; t&#7921; th&#236; n&#243; v&#7851;n c&#243; th&#7875; coi l&#224; b&#236;nh th&#432;&#7901;ng ho&#7863;c ch&#7881; sai m&#7897;t ch&#250;t v&#7873; logic. Tuy nhi&#234;n c&#225;i v&#7845;n &#273;&#7873; sai &#7903; &#273;&#226;y l&#224; <strong>procselfmemThread() </strong>&#273;ang c&#7889; t&#236;nh ghi v&#224;o m&#7897;t v&#249;ng mapping &#273;&#432;&#7907;c &#273;&#7883;nh ngh&#297;a l&#224; Read Only (d&#242;ng 101) c&#7897;ng th&#234;m vi&#7879;c v&#249;ng n&#224;y &#273;&#227; b&#7883; clear b&#7903;i <em>madvise() </em>tr&#432;&#7899;c &#273;&#243;. &#272;i&#7873;u n&#224;y d&#7851;n &#273;&#7871;n 1 c&#225;i <strong>fault </strong>m&#224; Linus Torvalds &#273;&#227; nh&#7853;n ra t&#7915; 11 n&#259;m tr&#432;&#7899;c, n&#243; cho ph&#233;p break COW &#273;&#7875; ghi tr&#7921;c ti&#7871;p n&#7897;i dung v&#224;o file g&#7889;c. Anh n&#224;y c&#361;ng &#273;&#227; <a href="https://github.com/torvalds/linux/commit/4ceb5db9757aaeadcf8fbbf97d76bd42aa4df0d6">fix l&#7895;i n&#224;y</a> t&#7841;i th&#7901;i &#273;i&#7875;m &#7845;y, tuy nhi&#234;n kh&#244;ng th&#7853;t s&#7921; th&#224;nh c&#244;ng.</p><h3>V&#225; l&#7895;i</h3><p>Tr&#234;n Linux repo, ch&#250;ng ta c&#243; th&#7875; th&#7845;y c&#225;ch Linus Torvalds v&#225; l&#7895;i n&#224;y. M&#7897;t c&#7901; m&#7899;i l&#224; FOLL_COW &#273;&#432;&#7907;c &#273;&#432;a v&#224;o &#273;&#7875; &#273;&#7843;m b&#7843;o qu&#225; tr&#236;nh COW &#273;&#227; ho&#224;n t&#7845;t tr&#432;&#7899;c khi 1 thread kh&#225;c xen v&#224;o.</p><pre><code>+/*
+ * FOLL_FORCE can write to even unwritable pte&#8217;s, but only
+ * after we&#8217;ve gone through a COW cycle and they are dirty.
+ */
+static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
+{
+    return pte_write(pte) ||
+    ((flags &amp; FOLL_FORCE) &amp;&amp; (flags &amp; FOLL_COW) &amp;&amp; pte_dirty(pte));
+}
+</code></pre><h3>K&#7871;t</h3><p><strong>Dirty Cow</strong> l&#224; m&#7897;t l&#7895;i nghi&#234;m tr&#7885;ng, d&#249; n&#243; ch&#7881; thu&#7897;c lo&#7841;i Local Exploit nh&#432;ng th&#7901;i gian t&#7891;n t&#7841;i tr&#432;&#7899;c khi c&#244;ng b&#7889; c&#361;ng &#273;&#7911; l&#226;u &#273;&#7875; ai &#273;&#243; l&#224;m g&#236; bi&#7871;n m&#7885;i th&#7913; tr&#7903; n&#234;n nguy hi&#7875;m h&#417;n. Nhi&#7873;u thi&#7871;t b&#7883; android c&#361;ng &#273;&#227; &#273;&#432;&#7907;c x&#225;c nh&#7853;n c&#243; &#7843;nh h&#432;&#7903;ng. V&#236; th&#7871;, h&#227;y c&#7853;p nh&#7853;t h&#7879; &#273;i&#7873;u h&#224;nh c&#7911;a c&#225;c b&#7841;n s&#7899;m nh&#7845;t c&#243; th&#7875; v&#224; &#273;&#7863;c bi&#7879;t l&#224; v&#7899;i c&#225;c Honey pot hay Vuln Server c&#7911;a c&#225;c cu&#7897;c thi CTF. Th&#244;ng tin th&#234;m c&#243; th&#7875; t&#236;m th&#7845;y &#7903; <a href="https://dirtycow.ninja/">trang ch&#7911; Dirty Cow</a>.</p><h3>T&#224;i li&#7879;u tham&nbsp;kh&#7843;o</h3><p><em>[1] <a href="https://dirtycow.ninja/">https://dirtycow.ninja/</a></em></p><p><em>[2] <a href="https://github.com/dirtycow/dirtycow.github.io">https://github.com/dirtycow/dirtycow.github.io</a></em></p><p><em>[3] <a href="http://man7.org/linux/man-pages/man2/mmap.2.html">http://man7.org/linux/man-pages/man2/mmap.2.html</a></em></p><p><em>[4] <a href="http://man7.org/linux/man-pages/man2/madvise.2.html">http://man7.org/linux/man-pages/man2/madvise.2.html</a></em></p><p><em>[5] <a href="https://github.com/torvalds/linux/blob/5924bbecd0267d87c24110cbe2041b5075173a25/mm/madvise.c#L452">https://github.com/torvalds/linux/blob/5924bbecd0267d87c24110cbe2041b5075173a25/mm/madvise.c#L452</a></em></p><p><em>[6] <a href="https://en.wikipedia.org/wiki/Copy-on-write">https://en.wikipedia.org/wiki/Copy-on-write</a></em></p><p><em>[7] <a href="https://en.wikipedia.org/wiki/Dirty_bit">https://en.wikipedia.org/wiki/Dirty_bit</a></em></p><p><em>[8] <a href="https://sandstorm.io/news/2016-10-25-cve-2016-5195-dirtycow-mitigated">https://sandstorm.io/news/2016-10-25-cve-2016-5195-dirtycow-mitigated</a></em></p><p><em>[9] <a href="https://github.com/torvalds/linux/commit/4ceb5db9757aaeadcf8fbbf97d76bd42aa4df0d6">https://github.com/torvalds/linux/commit/4ceb5db9757aaeadcf8fbbf97d76bd42aa4df0d6</a></em></p><p><em>[10] <a href="http://www.v3.co.uk/v3-uk/news/2474845/linux-users-urged-to-protect-against-dirty-cow-security-flaw">http://www.v3.co.uk/v3-uk/news/2474845/linux-users-urged-to-protect-against-dirty-cow-security-flaw</a></em></p><p><em>[11] <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619</a></em></p><p><em>[12] <a href="https://www.youtube.com/watch?v=kEsshExn7aE">https://www.youtube.com/watch?v=kEsshExn7aE</a></em></p>]]></content:encoded></item><item><title><![CDATA[How does HTTPS actually work?]]></title><description><![CDATA[What is HTTPS?]]></description><link>https://secaholic.com/p/how-does-https-actually-work-768e7ce89ea2</link><guid isPermaLink="false">https://secaholic.com/p/how-does-https-actually-work-768e7ce89ea2</guid><dc:creator><![CDATA[Trung Nguyen]]></dc:creator><pubDate>Thu, 13 Oct 2016 07:52:21 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/c11a67ce-6238-4fa6-b5e2-6b96285bdcf2_432x35.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>What is&nbsp;HTTPS?</h3><p>We&#8217;ve heard a lot about HTTPS, and we use it every day. If you access a website from your browser and you see a little green padlock and the letters &#8220;https&#8221; in your address bar then congratulations, you are accessing this safely via HTTPS.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JRIS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JRIS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JRIS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JRIS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JRIS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JRIS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JRIS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JRIS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JRIS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JRIS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d35dfad-94fd-4a9f-ac38-f4b668623274_432x35.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption">Green padlock and the letters &#8220;https&#8221; in address&nbsp;bar</figcaption></figure></div><p>HTTPS is a combination of HTTP Protocol and an SSL/TLS encryption layer. When the server uses HTTPS, unless they make any mistake during setup, a 3rd party will not intercept and decrypt the data sent between client and server.</p><p>In this post, I will explain to you in detail how HTTPS works and the importance of the SSL handshake. I also referred to <a href="http://robertheaton.com/2014/03/27/how-does-https-actually-work/">Rob Heaton&#8217;s blog</a>, this is really an informative article to read.</p><p>I assume you know about HTTP Protocol before reading this post. If not, you should read <a href="https://www.ietf.org/rfc/rfc2616.txt">RFC2616</a> before.</p><p>About SSL / TLS, it is a cryptographic protocol that provides communications security over a computer network. SSL standing for <em>Secure Socket Layer </em>was invented by <strong>Netscape</strong>. According to Wikipedia, version 1.0 was never publicly released; version 2.0 released in February 1995 &#8220;contained a number of security flaws which ultimately led to the design of SSL version 3.0&#8221;. SSL version 3.0 of 1996 represented a complete redesign of the protocol.</p><p>Soon after, the Internet Engineering Task Force (IETF) began to develop a standard protocol that provided the same functionality. They used SSL 3.0 as the basis for that work, which became the TLS (<em>Transport Layer Security</em>) protocol.</p><p>The SSL/TLS layer has 2 main purposes:</p><ul><li><p>To verify that you are talking directly to the server that you think you are talking to</p></li><li><p>To ensure that only the server can read what you send it and only you can read what it sends back</p></li></ul><h3>How an SSL connection is established?</h3><p>After establishing TCP Handshake and before sending/receiving a HTTP Request, HTTPS also sets up a &#8220;negotiation&#8221; between the client and server via SSL/TLS protocol called SSL/TLS Handshake, which differentiates it from HTTP. The goals here are:</p><ul><li><p>To ensure that client is talking to the right server</p></li><li><p>For the parties to have an agreed-upon &#8220;cipher suite&#8221; including which encryption algorithm they will use to exchange data</p></li><li><p>For the parties to have agreed-upon keys necessary for this algorithm</p></li></ul><p>To make it clearer, I use <em>openssl</em> to connect to <em>google.com</em></p><blockquote><p><em>openssl s_client -tls1_2 -connect google.com:443</em></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!f-zs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!f-zs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png 424w, https://substackcdn.com/image/fetch/$s_!f-zs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png 848w, https://substackcdn.com/image/fetch/$s_!f-zs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png 1272w, https://substackcdn.com/image/fetch/$s_!f-zs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!f-zs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!f-zs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png 424w, https://substackcdn.com/image/fetch/$s_!f-zs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png 848w, https://substackcdn.com/image/fetch/$s_!f-zs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png 1272w, https://substackcdn.com/image/fetch/$s_!f-zs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3ca7de2-d80a-43b1-ac63-08ad27feb701_726x408.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Connect to google.com with&nbsp;openssl</figcaption></figure></div><p>And use Wireshark to capture and filter it</p><blockquote><p><em>ssl.handshake</em></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_O7z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_O7z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png 424w, https://substackcdn.com/image/fetch/$s_!_O7z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png 848w, https://substackcdn.com/image/fetch/$s_!_O7z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png 1272w, https://substackcdn.com/image/fetch/$s_!_O7z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_O7z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_O7z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png 424w, https://substackcdn.com/image/fetch/$s_!_O7z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png 848w, https://substackcdn.com/image/fetch/$s_!_O7z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png 1272w, https://substackcdn.com/image/fetch/$s_!_O7z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ab149c-e196-44a1-9422-3dbdc35c09c4_800x67.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">SSL Handshake</figcaption></figure></div><p>The screenshot above shows all frames during the handshake, it can be divided into 3 main phases</p><p><strong>1. Hello</strong></p><p>This phase includes frames no. 142 and no. 144&nbsp;.</p><p>First of all, Client send Server a message called <strong>Client Hello </strong>which contains following information:</p><ul><li><p><strong>SSL/TLS version </strong>that Client wants to use in the handshake</p></li><li><p>Some <strong>random bytes </strong>generated by Client that, afterwards, will be used to generate a master key for encryption.</p></li><li><p>A <strong>list of encryption algorithms</strong> called cipher_suites that Client supports.</p></li><li><p>A <strong>list of compression algorithms</strong> that Client supports.</p></li><li><p>And a list of <strong>Extensions</strong>. These extensions are not required, but if the server understands, they will be used.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jX1G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jX1G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png 424w, https://substackcdn.com/image/fetch/$s_!jX1G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png 848w, https://substackcdn.com/image/fetch/$s_!jX1G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png 1272w, https://substackcdn.com/image/fetch/$s_!jX1G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jX1G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/daf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jX1G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png 424w, https://substackcdn.com/image/fetch/$s_!jX1G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png 848w, https://substackcdn.com/image/fetch/$s_!jX1G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png 1272w, https://substackcdn.com/image/fetch/$s_!jX1G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaf70826-6343-4373-b4bb-6d08b49f3a99_426x371.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Client Hello</figcaption></figure></div><p>The server responds with a <strong>Server Hello</strong>, which contains similar information required by the client, including:</p><ul><li><p>Some <strong>random bytes </strong>generated by the server that, afterwards, will be used to generate a master key for encryption</p></li><li><p>The <strong>cipher suite</strong> selected by the server (from the previous list sent by the client) that will be used for authentication, encryption and verification of the messages</p></li><li><p>The <strong>compression algorithm</strong> selected by the server (again from the previous list sent by the client) that will be used for compressing each message</p></li><li><p>If a extension is accepted by the server, it will notify Client in the <strong>Extension </strong>tag</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!E3A7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!E3A7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png 424w, https://substackcdn.com/image/fetch/$s_!E3A7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png 848w, https://substackcdn.com/image/fetch/$s_!E3A7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png 1272w, https://substackcdn.com/image/fetch/$s_!E3A7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!E3A7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!E3A7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png 424w, https://substackcdn.com/image/fetch/$s_!E3A7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png 848w, https://substackcdn.com/image/fetch/$s_!E3A7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png 1272w, https://substackcdn.com/image/fetch/$s_!E3A7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c17be3c-501a-4aca-bc03-7b5960d01e70_499x290.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Server Hello</figcaption></figure></div><p><strong>2. Certificate Exchange</strong></p><p>When the client and server have finished greeting, the server must prove to the client that it is the one Client wants to talk to. This can be done using <em>SSL Certificate</em>.</p><p>An SSL certificate contains various pieces of data, including the name of the owner, the property (eg. domain) it is attached to, the certificate&#8217;s public key, the digital signature and the certificate&#8217;s expiry date.</p><p>The client can implicitly trusts the certificate, or check if it is verified and trusted by one of several Certificate Authorities (CAs). Please be noted that for some particular applications, the server, in turn, can require a certificate to verify the client&#8217;s identity.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zcs9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zcs9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png 424w, https://substackcdn.com/image/fetch/$s_!zcs9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png 848w, https://substackcdn.com/image/fetch/$s_!zcs9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png 1272w, https://substackcdn.com/image/fetch/$s_!zcs9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zcs9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zcs9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png 424w, https://substackcdn.com/image/fetch/$s_!zcs9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png 848w, https://substackcdn.com/image/fetch/$s_!zcs9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png 1272w, https://substackcdn.com/image/fetch/$s_!zcs9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34969758-0bb1-4b5b-a24f-abf45671fce4_800x230.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">SSL Certificate</figcaption></figure></div><p><strong>3. Key Exchange</strong></p><p>This is the most exciting phase of the handshake. The purpose of this phase is for both parties to agree on a private key. This key is encrypted by asymmetric algorithm (e.g RSA, Diffie Hellman) with the server&#8217;s public/private keys. Then it will be used in another symmetric algorithm to encrypt data sent between the client and the server. Both symmetric and asymmetric algorithms have already been agreed on during the <strong>Hello </strong>phase.</p><p>In detail:</p><ul><li><p>Client generates some random bytes called <em>PreMaster Secret, </em>encrypts this using asymmetric algorithm with public keys (found on its SSL Certificate) and sends to the server.</p></li><li><p>Server decrypts ciphertext by private keys and gets <em>PreMaster Secret</em></p></li><li><p>Both client and server use <em>PreMaster Secret </em>to generate <em>Master Secret </em>and <em>Session Key</em>. <em>Master Secret</em> is a shared key to encrypt data sent between the client and server. This process is called <strong>Client Key Exchange.</strong></p></li></ul><p>In case Client does not have enough data to generate <em>PreMaster</em>, Server must take the additional step called <em>Server Key Exchange </em>before sending the missing data to the client.</p><p>When two parties have a agreed on a shared key, Client notifies Server that it&#8217;s time to encrypt communication by sending a <strong>Change Cipher Spec Message</strong>. This is the final message can be read as plain text before encryption.</p><p>Finally Client and Server each sends <strong>Encrypted Handshake Message</strong> to test. Handshake process ends.</p><h3>Cipher Suites</h3><p>In Hello Phase, we can see that Client and Server agree on a <strong>Cipher Suite</strong>. So, what is this?</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!J_Gf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!J_Gf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png 424w, https://substackcdn.com/image/fetch/$s_!J_Gf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png 848w, https://substackcdn.com/image/fetch/$s_!J_Gf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png 1272w, https://substackcdn.com/image/fetch/$s_!J_Gf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!J_Gf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!J_Gf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png 424w, https://substackcdn.com/image/fetch/$s_!J_Gf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png 848w, https://substackcdn.com/image/fetch/$s_!J_Gf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png 1272w, https://substackcdn.com/image/fetch/$s_!J_Gf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff051adb8-dd46-470c-ae82-4639a884b4f3_673x314.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Cipher Suite</figcaption></figure></div><p><strong>Cipher Suite</strong> is a list of algorithms which Client and Server use during the handshake and data transmission. There are 4 algorithms:</p><ul><li><p><strong>Key Exchange algorithm: </strong>The asymmetric encryption algorithm to encrypt and decrypt shared key. E.g RSA, DH, ECDH, ECDHE</p></li><li><p><strong>Authentication algorithm:</strong> The encryption algorithm to authenticate server or client. E.g RSA, DSA, ECDSA</p></li><li><p><strong>Bulk cipher algorithm:</strong> The symmetric encryption algorithm to encrypt and decrypt data sent between Client and Server. E.g AES, 3DES, CAMELLIA</p></li><li><p><strong>Message Authentication Code algorithm:</strong> The hash algorithm. E.g SHA, MD5.</p></li></ul><p><strong>Example:</strong> We have Cipher Suite <em>TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256</em></p><p>Where:</p><ul><li><p>TLS is the protocol</p></li><li><p>ECDHE is Key Exchange algorithm</p></li><li><p>ECDSA is Authentication algorithm</p></li><li><p>AES_128_GCM is Bulk cipher algorithm</p></li><li><p>SHA256 is Message Authentication Code algorithm</p></li></ul>]]></content:encoded></item></channel></rss>