<?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 Scutum on Medium]]></title>
        <description><![CDATA[Stories by Scutum on Medium]]></description>
        <link>https://medium.com/@crackme-analyst82?source=rss-aecedf868849------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Scutum on Medium</title>
            <link>https://medium.com/@crackme-analyst82?source=rss-aecedf868849------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:59:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@crackme-analyst82/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[testing]]></title>
            <link>https://crackme-analyst82.medium.com/testing-be9421d0fb4?source=rss-aecedf868849------2</link>
            <guid isPermaLink="false">https://medium.com/p/be9421d0fb4</guid>
            <dc:creator><![CDATA[Scutum]]></dc:creator>
            <pubDate>Tue, 07 Sep 2021 21:05:35 GMT</pubDate>
            <atom:updated>2021-09-07T21:05:35.081Z</atom:updated>
            <content:encoded><![CDATA[<p>test</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be9421d0fb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hard-coded Mutex used in Bazar Backdoor sample]]></title>
            <link>https://crackme-analyst82.medium.com/hard-coded-mutex-used-in-bazar-backdoor-sample-eb320ec04e0c?source=rss-aecedf868849------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb320ec04e0c</guid>
            <category><![CDATA[backdoor]]></category>
            <category><![CDATA[bazar]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Scutum]]></dc:creator>
            <pubDate>Sat, 06 Mar 2021 22:43:50 GMT</pubDate>
            <atom:updated>2021-03-06T22:49:56.510Z</atom:updated>
            <content:encoded><![CDATA[<p>Malwares often use Mutex to avoid re-infecting a system more than once. Recently, I was analyzing a Bazar Backdoor sample which is using a hard-coded mutex to prevent re-infection.</p><p>As we know Bazar Backdoor and Loader is now being associated with popular Trickbot malware family. The first instance was discovered in April 2020 and based on the initial infection vector, they are leveraging pandemic situation to target users working remotely. In this blog, I am sharing my findings by reversing a Bazar Backdoor sample:</p><blockquote>Hash: 5974d938bc3bbfc69f68c979a6dc9c412970fc527500735385c33377ab30373a</blockquote><p><a href="https://www.virustotal.com/gui/file/5974d938bc3bbfc69f68c979a6dc9c412970fc527500735385c33377ab30373a/detection">VirusTotal</a></p><p><strong>In a summary, here are few actions this sample performs:</strong></p><ol><li><strong>Four or more anti-debugging techniques used.</strong></li><li><strong><em>kernel32.Sleep</em> used to suspend the state of a system.</strong></li><li><strong>Environment variable set to ‘VERS’.</strong></li><li><strong>Mutex is created with hard-coded value: ‘mn_185445’.</strong></li><li><strong>Checks the language used on the system. Checks for text ‘United States_English’ and ’Russia’.</strong></li></ol><p>The compile time of this PE sample matches to the timeline of the initial discovery of this malware family i.e. April 2020. The output from the PEStudio shows the original compile time of the sample:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*JwWRs7APnfh-MYKEzWIi0w.png" /><figcaption>Compile time of Bazar Backdoor sample (April 2020)</figcaption></figure><p>Just by glancing quickly at the list of API calls, it can be confirmed that the sample is using four or more anti-debugging mechanisms:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*-DTOXH9WfD8LA9U4iDN8fg.png" /><figcaption>Anti-debugging techniques</figcaption></figure><p>As usual, I loaded the sample in x64dbg and starting looking at interesting API calls piggy backed with Breakpoints to see process memory around these API calls. This sample seems to be difficult one as at some point while debugging the code, my malware analysis VM gets suspended abruptly.</p><p>During first few instances, I could not figured out the reason behind it but soon I stumbled upon a code as shown below which implements <em>kernel32.Sleep</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aSHrp7h_qkvpAxGVOKapBw.png" /><figcaption>Sleep function</figcaption></figure><p>You can read more about the function here:</p><p><a href="https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-sleep">Sleep function (synchapi.h) - Win32 apps</a></p><p>I had to patch the code to prevent VM getting suspended. Moving further, it also creates an Environment variable(<em>SetEnvironmentVariableA()</em>) with value ‘<strong>VERS</strong>’. I am suspecting that it might use this value later down the road.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kl7RLV8SuJhwf8h50GXODQ.png" /><figcaption>SetEnvironmentVariableA()</figcaption></figure><p>At some point during debugging, I noticed that the sample is calling an API function named <em>CreateMutexExA()</em>. As you can see in the below screenshot, it assigns the value as ‘<strong>mn_185445</strong>’. I was quite amused to see a mutex used by an advanced sample. To confirm if I get the same value every time, I re-ran the sample in several VMs and it gives the same value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrhrVUvQRTww7UdvaJ4Ukw.png" /><figcaption>CreateMutexExA()</figcaption></figure><p>This can act as an Indicator of Compromise (IOC) since it is constant with this sample. We can also do hunting based on the mutex. This finding was also confirmed by CyberReason:</p><p><a href="https://www.cybereason.com/blog/a-bazar-of-tricks-following-team9s-development-cycles">A Bazar of Tricks: Following Team9&#39;s Development Cycles</a></p><p>On the side note, I found that the sample is also checking which language is being used on the system. It checks for the strings are listed below. It might be targeting victims in very specific areas only.</p><blockquote>Russia</blockquote><blockquote>United States_English</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*c_RsAh7oB3DjnYCYGv089A.png" /><figcaption>Language check</figcaption></figure><h4>Surely a tough one!</h4><p>Debugging this sample certainly seems to be a tough one. I am still trying to get the network based IOCs for this sample. Please feel free to share the findings if you were able to progress further than this point.</p><p>Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb320ec04e0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Obfuscation at all stages — An interesting case of Emotet infection]]></title>
            <link>https://crackme-analyst82.medium.com/obfuscation-at-all-stages-an-interesting-case-of-emotet-infection-5877916b8436?source=rss-aecedf868849------2</link>
            <guid isPermaLink="false">https://medium.com/p/5877916b8436</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[emotet]]></category>
            <category><![CDATA[malicious-code]]></category>
            <category><![CDATA[trojan]]></category>
            <category><![CDATA[takedown]]></category>
            <dc:creator><![CDATA[Scutum]]></dc:creator>
            <pubDate>Sun, 31 Jan 2021 18:19:41 GMT</pubDate>
            <atom:updated>2021-02-01T21:26:10.232Z</atom:updated>
            <content:encoded><![CDATA[<h3>Obfuscation at all stages — An interesting case of Emotet infection</h3><p>I heard a lot of buzz about the recent Emotet infrastructure take down by Europol and few other crime agencies around the globe. Interestingly, at the same time, I was analyzing a WORD document with a malicious macro embedded. At the end of the analysis, I figured out that the macro code was eventually leading to the Emotet infection on the victim.</p><p><a href="https://www.europol.europa.eu/newsroom/news/world%E2%80%99s-most-dangerous-malware-emotet-disrupted-through-global-action">World&#39;s most dangerous malware EMOTET disrupted through global action</a></p><h3>Findings at a glance!</h3><p>I picked a WORD document uploaded on MalwareBazaar and analyzed the embedded macro code. The analysis ended up to a packed Emotet trojan downloaded from one of the 7 URL IOCs.</p><blockquote>Word document’s SHA256: ec889256894e0feb6ed386ae5c414149c62b29f3c4a2e2a1a3411c0a982984e0</blockquote><p>Here is a summary of several stages of infection which leads to Emotet getting downloaded and ran on the victim machine:</p><p>1Microsoft Word document contains a highly obfuscated malicious macro code.</p><p>2Macro code runs a highly obfuscated <em>PowerShell</em> script.</p><p>3Two-layered obfuscated <em>PowerShell</em> script contacts 7 URLs to download a <em>malicious DLL</em>.</p><p>4Downloaded DLL is a packed <em>Emotet</em>.</p><p>5This DLL gets executed using <em>rundll32.exe</em>.</p><h3>Technical details</h3><h4>Macro code debugging</h4><p>By using the default WORD Macro debugging feature, I looked at the macro code and immediately found it suspicious based on its high obfuscation. This macro gets executed when the document is opened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*-ytEL5ZuNklfIqr60hHUeA.png" /><figcaption>Document_open() runs a function B4grokrgjv2ifyzq</figcaption></figure><p>There are tons of <em>GOTO</em> jumps and strings were created using<em> Replace</em> commands. Take a look at how the macro code looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*__D8iICiQs9htt-VZW5f_g.png" /><figcaption>Highly Obfuscated Macro code</figcaption></figure><p>I added several variables to the <em>Watch window</em> to see how their value changes as macro gets executed. I also added breakpoints to important lines of code. Here is a quick glance of all the variables and its values when the macro code hits an interim breakpoint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SZ-FZ0qwvdf-WXHCbF0Xaw.png" /><figcaption>Macro Code variables value</figcaption></figure><p>Just by looking at the variable <em>‘Br7ox619ois74tv’</em>, it looks like the macro is going to open <em>cmd.exe</em> and display a textbox to the victim mentioning that Word faced a problem opening a file and in the background it runs an encrypted PowerShell script in a hidden window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*knnesSCF2ew3PZUMM2213A.png" /><figcaption>Macro shows a textbox to victim and executes PowerShell script as hidden</figcaption></figure><p>The macro code also uses<em> win32_process</em> method which will be used later to execute the downloaded Emotet sample.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*QY9poPXjQmkWFJjSKyit-A.png" /><figcaption>Contents of variable ‘C97hfjxrastoql’</figcaption></figure><h3>Unpowering the PowerShell command</h3><p>The next stage of analysis is to look at the encrypted <em>PowerShell</em> script and reverse it to see what actions it performs. I pulled the <em>PowerShell</em> script from the<em> ProcessHacker</em> tool and it looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-NuCgC9-slNfOgAvRtjlzw.png" /><figcaption>Highly Obfuscated PowerShell script</figcaption></figure><p>Using <em>PowerShell</em> debugging feature <em>Script Block Logging, </em>I looked at the contents of <strong>event ID 4104</strong> from Windows Event Viewer. What I found was another layer of obfuscation used to slow down the analyst. The content of this version looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m-xEduU1yMc5ihixaCIqJw.png" /><figcaption>Contents of Event ID 4104</figcaption></figure><p>Going further, I used PowerShell ISE to debug this version since it will be tedious and time consuming to run through the whole script manually. First, I removed some obvious noise from the scripts like dots, commas, etc. Once this noise was removed, I placed several breakpoints using PowerShell ISE:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y1NZMDd2gRFL-WuDUq9lnA.png" /><figcaption>Script in PowerShell ISE</figcaption></figure><h4>Extracting the IOCs</h4><p>Once the script is loaded in PowerShell ISE, I placed breakpoints at each and every line and started to observe the values of the variables. This is the point where I was one step closer to the IOCs. Take a look at the variable named <em>‘$U5tym2l’</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*Mki4c_YSe7lh_wCkE7iEmQ.png" /><figcaption>Indicators of Compromise (IOCs)</figcaption></figure><p>If you look at the <strong><em>foreach()</em></strong> function used in the script. It tries to contact all the above URLs to download a file. I checked all of them on VirusTotal and few came up as a known malicious domains. Others we not!</p><h4>IOCs:</h4><blockquote>hxxp://covisiononeness(.)org/new/F9v/</blockquote><blockquote>hxxp://www.oshiscafe(.)com/wp-admin/5Dm/</blockquote><blockquote>hxxp://lionrockbatteries(.)com/wp-snapshots/C/</blockquote><blockquote>hxxp://www.schuckfeder(.)net/reference/ubpV/</blockquote><blockquote>hxxp://cirteklink.com/F0xAutoConfig/1Zb4/</blockquote><blockquote>hxxp://nimbledesign(.)miami/wp-admin/C/</blockquote><blockquote>hxxp://xunhong(.)net/sys-cache/D0/</blockquote><h4>Let’s do a SYN!</h4><p>I contacted each of these IOCs using a genuine looking browser request. Most of them were not reachable. However, when I visited <em>hxxp://xunhong(.)net/sys-cache/D0/</em></p><p>I was able to download a DLL file with name <strong><em>dfx.dll</em></strong>. This is indeed the <strong>packed Emotet trojan</strong> which gets delivered to the victim.</p><blockquote>SHA256: 01e14d7d7d88ef53d4f9443170bff682dc9c72f13451c18c9032a5e440975e98</blockquote><p><a href="https://www.virustotal.com/gui/file/01e14d7d7d88ef53d4f9443170bff682dc9c72f13451c18c9032a5e440975e98/detection">VirusTotal</a></p><p>I was observing the execution of the <em>PowerShell</em> script on <em>WireShark</em> as well and it did confirm the communication to the above URLs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-EMJblC9aXzg1XqstV3hTg.png" /><figcaption>WireShark capture for malicious PowerShell script</figcaption></figure><h4>Analysing the DLL</h4><p>The DLL which was downloaded is the packed version of the Emotet trojan. This means there are still actors out there using Emotet for their campaigns. Once this DLL is downloaded, it is ran using the <strong><em>rundll32.exe</em></strong> file since DLLs cannot run by itself. Take a look at the <em>PowerShell</em> script calling rundll32.exe to execute the Emotet sample downloaded using <em>DownloadFile</em> function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Hj7RVOuKVrC9Ho_VM0vMw.png" /><figcaption>Rundll32.exe called to execute downloaded DLL</figcaption></figure><p>Using <em>PEStudio</em>, I looked at the static values of the DLL header. The compilation time shows it was compiled on 20th Jan 2021 which is very recent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*zcJUsJAHLkC0ijx6c0VQhA.png" /><figcaption>Compilation time of Emotet</figcaption></figure><p>The Sections and the list of imports of this DLL indicates it is a packed sample. Use of libraries like <em>LoadLibraryA</em> and existence of <em>text7</em> and <em>text6</em> sections with 0 entropy probably indicates it is going to unpack itself in these areas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Ra-Nd33N8SCNIaJlAvt_g.png" /><figcaption>Sections of malicious DLL</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/1*Gd3zeC0DluOpcZW_LmSfxg.png" /><figcaption>Imports of malicious DLL</figcaption></figure><h3>Conclusion</h3><p>The efforts to analyze a macro code from a Word document lead to several stages of infection which ultimately executes a Emotet trojan on a victim machine. Regardless of the takedown of the Emotet infrastructure, the attackers are still using it for their campaigns. One of 7 URL IOCs is actively hosting the malware.</p><p>I hope you liked this piece of analysis and feel free to provide feedback and suggestions! Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5877916b8436" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sunburst malware — Actual code behind the report]]></title>
            <link>https://crackme-analyst82.medium.com/sunburst-malware-actual-code-behind-the-report-d1043003020e?source=rss-aecedf868849------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1043003020e</guid>
            <category><![CDATA[sunburst]]></category>
            <category><![CDATA[cozybear]]></category>
            <category><![CDATA[fireeye]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Scutum]]></dc:creator>
            <pubDate>Mon, 21 Dec 2020 22:35:52 GMT</pubDate>
            <atom:updated>2020-12-21T22:38:17.824Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sunburst malware — Uncozying the code</h3><p>Hi all, I hope you all are doing well in this uncertain times of Covid as well as the recent developments we saw in infosec community. As you probably know, an espionage campaign was discovered by FireEye after their set of Red Team tools were accessed. It was a supply chain attack where attackers were able to insert their malicious code in SolarWinds Orion software update back in March 2020 and it was digitally signed by SolarWinds. You can find the actual findings here:</p><p><a href="https://www.fireeye.com/blog/threat-research/2020/12/evasive-attacker-leverages-solarwinds-supply-chain-compromises-with-sunburst-backdoor.html">Highly Evasive Attacker Leverages SolarWinds Supply Chain to Compromise Multiple Global Victims With SUNBURST Backdoor</a></p><blockquote>In this blog, I will go through some research findings FireEye mentioned in the above blog and try to find the relevant code in the sample of Sunburst malware used in this attack.</blockquote><p>As mentioned in the report, the malicious code resides in the DLL named “<em>SolarWinds.Orion.Core.BusinessLayer.dll</em>”.</p><blockquote><strong><em>SolarWinds.Orion.Core.BusinessLayer.dll</em></strong><em><br></em><strong><em>MD5:</em></strong> b91ce2fa41029f6955bff20079468448</blockquote><p>I was able to grab a copy of this malicious DLL. So let’s put on my malware analyst’s hat and begin with some recon steps. As usual, I opened the file in DLL in PEStudio to look at its attributes. The DLL is indeed signed by SolarWinds and the compilation time is in March 2020:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*VXyh9mciq5q2isc4JefMfA.png" /><figcaption>PEStudio view of malicious DLL</figcaption></figure><p>The code looks like its programmed in Microsoft .NET. During one of the malware courses I did, I learned about DnSpy debugger. You can also download it from here:</p><p><a href="https://github.com/dnSpy/dnSpy">GitHub - dnSpy/dnSpy: .NET debugger and assembly editor</a></p><p>Loading the malicious DLL in DnSpy shows tons of code from the original genuine DLL. There are lot of functions, classes and objects. On a first glance, it looks like part of a normal software development package. FireEye mentioned that the backdoor code resides in the location:</p><blockquote>SolarWinds.Orion.Core.BusinessLayer.BackgroundInventory.InventoryManager.RefreshInternal</blockquote><p>Take a look at the screenshot below which shows the code defined there:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-s3YuxcfFk36GcCObQ9fIw.png" /><figcaption>RefreshInternal() starting a new Thread</figcaption></figure><p>The method <em>RefreshInternal()</em> is starting a new Thread by loading the code in the method named <em>Initialize()</em>. This thread runs in background and probably one of the ways to hide the activity. Let’s jump directly to <em>Initialize()</em> method to see what it is doing!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iaEPgEyF7hZ-EWSqknpgiw.png" /><figcaption>Code inside Intialize()</figcaption></figure><p>Woho! Looks like there are many IF conditions in the Initialize() method. Our goal here will be to see how this malicious backdoor reveals the actual commands for exploitation, CnC and other stages of attack. Therefore, we will go through each and every important IF condition to see how it can help us to understand the sample.</p><p>The first IF condition is getting the name of the current process running and hashing it. Once it computes its hash, it is being compared with a constant value:</p><blockquote>Process name hash to be compared with constant hash: <strong>17291806236368054941UL</strong></blockquote><p>The function GetHash() implements a version of <strong>Fowler–Noll–Vo hash function. </strong>FireEye already reversed it and the condition is basically checking the process name to “<em>solarwinds.businesslayerhost</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*PLTfFSTBcX-EH0JAMfedMQ.png" /><figcaption>Constants used in the GetHash() function (Fowler–Noll–Vo hash function)</figcaption></figure><p>If this condition is TRUE, then only the next code executes. The next instruction is very interesting. This is the code which makes the sample inactive for about 12 to 14 days after the system runs the malicious DLL for the first time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*rkC5rH2dZxRCYVf5tXXWYw.png" /><figcaption>Logic to remain inactive for 12 to 14 days</figcaption></figure><p>So basically what this code is doing is first it gets the lastWriteTime of the file containing the code. The windows method <em>Assembly.GetExecutingAssembly()</em> does the job. The code first grabs the file write time using this, then generates a random number between 288 and 336 (<em>i.e. basically 12 to 14 days, 288/24 hours = 12 days and 336/24 hours = 14 days</em>). It adds a random number between this range and appended it to lastWriteTime and then compares it to current date and time. If the result is more than 0, it means the file was written 12 to 14 days before today. Therefore, this allows the malicious code to remain inactive for days.</p><p>You can find the details here windows methods here:</p><blockquote><a href="https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getexecutingassembly?view=net-5.0">https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getexecutingassembly?view=net-5.</a>0<br><a href="https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-5.0">https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-5.0</a><br><a href="https://docs.microsoft.com/en-us/dotnet/api/system.datetime.compareto?view=net-5.0">https://docs.microsoft.com/en-us/dotnet/api/system.datetime.compareto?view=net-5.0</a></blockquote><p>Moving forward with the code, the other IF conditions looks like it doing something related to configuration, setting appId and all. The next interesting and perhaps the jewel of this whole backdoor lies in the function <em>Update()</em>. its the second last line of code for<em> Initialize(). </em>Let’s dissect it as well:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8VKtmRc7Gu9YYN1JM4ZbA.png" /><figcaption>Update() method</figcaption></figure><p>Scanning through the code in <em>Update()</em> function, the sample checks connectivity to the domain <strong>api.solarwinds.com</strong> and few other operations. I came across another very interesting IF statement which seems to be checking list of processes running on a system. It is performing this step using the function <em>TrackProcesses()</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cBfEFXf9nwCJx9Cq7t4kXw.png" /></figure><p><strong><em>TrackProcesses()</em></strong><em> </em>checks output of three other functions:</p><ul><li><strong><em>SearchAssemblies()</em></strong> — This function checks a list of hashes defined in array <em>assemblyTimeStamps</em>. FireEye listed the original values of these hashes on their Github page. Basically the sample is scanning for malware analysis and reversing tools such as <em>x64-dbg, apimonitor-x64, pe-sieve64</em> and many more.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*ezqAr_gCNPgiZ3srkjREFQ.png" /><figcaption>assemblyTimeStamps list of hashes</figcaption></figure><ul><li><strong><em>SearchServices()</em> —</strong> I am finding difficulty to analyze what this is checking. However, this certainly seems to be related to below function.</li><li><strong><em>SearchConfigurations()</em>- </strong>This function runs a command to get all information from class <em>Win32_SystemDriver</em>. Once it gets holds of it, it specifically tries to access a property called as <em>PathName</em>.</li></ul><blockquote><strong><em>Command it runs:</em></strong> Select * From Win32_SystemDriver</blockquote><blockquote><strong><em>Property:</em></strong> PathName</blockquote><p>This probably means it is running the same hash function on all the processes listed in <em>Win32_SystemDriver</em> function and checks them against a hardcoded list of hashes in array named <em>configTimeStamps</em>. These values seems to be related to system monitoring softwares like lragentmf.sys(LogRhythm System Monitor), hexisfsmonitor.sys, groundling32.sys (Dell SecureWorks Red Cloak) and few more.</p><blockquote>In conclusion, <em>TrackProcesses()</em> is the method which implements all anti-reversing, anti-monitoring and protection services for the malware.</blockquote><p>Once this checks are passed and if these services and processes are not running, the sample continues to execute. I scanned the code further and found one line of code where it defines a string <em>hostName</em>. It checks a condition and based on its output it executes either of these methods:</p><ul><li>GetCurrentString()</li><li>GetPreviousString()</li></ul><p>Both these methods ultimately executed another method called as <em>GetStatus()</em>. This is the most interesting part of the code since now we will be able to see the actual network IOCs as mentioned in the FireEye report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*UGpmt7lAWyPvUJu-qC6bPA.png" /><figcaption>Domains strings is called</figcaption></figure><blockquote><strong><em>domain2 :</em></strong> appsync-api</blockquote><blockquote><strong><em>domain3:</em></strong> eu-west-1, eu-west-2, eu-west-1, eu-east-2</blockquote><blockquote><strong><em>domain1:</em></strong> avsvmcloud(.)com</blockquote><p>The <strong>domain1(avsvmcloud(.)com)</strong> is the command and control server for this Sunburst malware and it was seized by Microsoft recently. You can find more details here:</p><p><a href="https://www.zdnet.com/article/microsoft-and-industry-partners-seize-key-domain-used-in-solarwinds-hack/">Microsoft and industry partners seize key domain used in SolarWinds hack | ZDNet</a></p><p>Up to this point, it seems like we were able to locate the complete path of the sample execution right from checking the hash of process name and up to contacting the command and control server. Now, I can further continue my analysis and see what it does next i.e. downloading additional payloads, changes to the victim host, etc.</p><p>I hope you find the above information useful to understand the code behind the behavior of this malware sample as described in FireEye report. Kudos to all the researchers who were able to publish this in such a short amount of time. And lastly, thank you for taking the time to go through this report. As always, please let me know your suggestions and comments!</p><p>Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1043003020e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware of the future? Not really]]></title>
            <link>https://crackme-analyst82.medium.com/malware-of-the-future-not-really-2a03d63c8968?source=rss-aecedf868849------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a03d63c8968</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[reversing]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Scutum]]></dc:creator>
            <pubDate>Tue, 08 Dec 2020 22:46:49 GMT</pubDate>
            <atom:updated>2020-12-08T22:46:49.688Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi all,</p><p>Here I am back with another blog on my journey of malware reversing. This time I wanted to go for something which is not known enough. Meaning, I ran a YARA rule on one of the popular virus database out there.</p><p>Basically I ran a YARA rule to look for PE files which has its compilation time beyond today. Malware sometimes use this to evade detections. So here is the YARA rule I used. Although it is not that efficient rule, the results I got is pretty good.</p><p><a href="https://www.dropbox.com/s/v1pp6lvcq6t2p1p/scutum_yara_rule.yar?dl=0">scutum_yara_rule.yar</a></p><p>Using this rule, I was able to find all the PE files with compilation time further than today. I fetched top 100 files and most of them have VirusTotal detections of being malicious. So today’s blog will be all about analyzing one of those files. I picked the very first file, here is the file hash:</p><blockquote>0fb4b2cba1dc44cb9abaafe8afe9406d100dbc4ce10e328b3948f7ef2f14598b</blockquote><p><a href="https://www.virustotal.com/gui/file/0fb4b2cba1dc44cb9abaafe8afe9406d100dbc4ce10e328b3948f7ef2f14598b/detection">VirusTotal</a></p><h3>Static analysis</h3><p>As a basic step of malware analysis, I examined the file through several static tools. I was able to confirm that the timestamp of the PE file is indeed of future which is 6th December 2029.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*e44gVy99Uhd008vS49CAzA.png" /></figure><p>Using PEStudio, I realized that the malware might be packed since I see a section in the PE with name ‘<strong><em>aspack</em></strong>’. ASPack is a well known file packer similar to UPX. PEStudio mention it is a self-modifying file. This probably means the file might be unpacking code and changing its section on-the-fly during runtime. But this is an assumption I am making based on what I see using static tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhawEs2Y2ciX5LBRrC2eIQ.png" /></figure><p>The tool PEid shows its compiled using Borland Delpi 6.0–7.0 (Delphi). So I can guess the file was written in Delphi language. I was able to see GUI objects using Resource Tuner tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*dTijhSRSP5tHWFCF1S6vUw.png" /><figcaption>PEid tool on FireEye Flare VM</figcaption></figure><p>Looking for strings using PEStudio shows some important information about what could be the filename of the executable which will actually run on the machine. It also shows that the file could be creating/editing AUTORUN.INF to make itself run every time the system starts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*lN_9DQU0eYXXo30OqYY_fA.png" /><figcaption>Strings of the executable in PEStudio</figcaption></figure><h3>Dynamic analysis</h3><p>Using x32dbg, I tried to analyze the various windows API functions the file was calling. Since we are leaning towards the fact that this malware is self modifying, I was able to confirm the fact since it is calling<em> VirtualAlloc()</em>, <em>VirtualFree()</em> and <em>LocalAlloc()</em>. I am assuming that it might be allocating some space during runtime and unpacks the code. Once it is unpacked it will change a specific part of its own space and pass the execution back to the new code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*Rd6YFrljlsarDe3caNpdfw.png" /></figure><p>There are other interesting API calls like <em>WriteFile()</em>, <em>GetModuleFileNameA()</em>, <em>GetProcAddress()</em>, etc. I put the breakpoint on each of them to see what the file is upto.</p><p>Breakpoint on <em>WriteFile()</em> reveals what I guessed using the static analysis. It created a file <strong>AUTORUN.INF</strong> file in C drive. By looking at the command, it seems to be running a malicious file named <strong>AutoRun.exe</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*QUysHhenQyEharRS8rAY7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*HAukjq_ifGVsdc1mVGK4-w.png" /></figure><p>The API function <em>GetModuleHandleA()</em> was called. Looking at the parameter for the handle, it shows that <strong>0(zero)</strong> was passed to it. According to Microsoft documentation, passing <strong>0(zero) </strong>to this API function will result in <em>GetModuleHandle() </em>returning a handle to the file used to create the calling process (.exe file). So it means, in our case the file is trying to get a handle to itself.</p><p><a href="https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandlea">GetModuleHandleA function (libloaderapi.h) - Win32 apps</a></p><p>Continuing with the analysis, the API<em> CreateThread()</em> is also being used. By carefully looking at the parameters being passed to the API, I see the value of <em>dwCreationFlags</em> being set as <strong>0x00000004 (CREATE_SUSPENDED)</strong>. Therefore, it seems to be creating a thread in a suspended state. This is interesting!</p><p><a href="https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread">CreateThread function (processthreadsapi.h) - Win32 apps</a></p><p>My goal here is to see how can I extract the unpacked version of this file. So basically to looked at the unpacked code which is currently seems to be packed using ASPack. I looked at the return values of EAX when the call to <em>VirtualAlloc()</em> is being returned. I do see there is blank memory space being assigned after <em>VirtualAlloc()</em>. This probably means the new unpacked code will be copied here and later injected in the process itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qrllUdsBvoGcFrPUq5f8GA.png" /></figure><h3>Wops!</h3><p>During analyzing the stack values and other parameters immediately after VirtualAlloc, the sample shows an error on the screen with this text:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*vmnXjS0kjamLuLOEWttcgg.png" /></figure><p>I pressed OK and continued the debugging. Interestingly, the sample created a process named <strong>HelpMe.exe</strong>(as confirmed from out static analysis for strings). A thread was created under the same process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*kS_D-zIsNoVE7QyHKxsjvg.png" /></figure><p>I tried to dump the file using ProcessHacker to see if this is the new executable with unpacked code. Using PEStudio, I see nothing has been changed on the executable(including the sections of it are intact).</p><h3>Assumptions and next steps!</h3><p>I tried debugging the <em>VirtualAlloc()</em> several times but I am not able to see the unpacked version of the executable yet. At this point I can make following assumptions:</p><ul><li>Malware is aware that it is running in a VM and won’t unpack its real code.</li><li>The thread which is created has the same code as before. This can indicate the malware is VM aware. However, I am not able to find any anti-debugging API being used by the sample.</li><li>I will continue debugging the sample to see if I can get the unpacked version of this file.</li></ul><p>Thank you again for taking your time to rea this blog! For any suggestions/comments, please don’t hesitate to DM me!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a03d63c8968" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reversing Ardamax keylogger]]></title>
            <link>https://crackme-analyst82.medium.com/reversing-ardamax-keylogger-4dff07ab127d?source=rss-aecedf868849------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dff07ab127d</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[keylogger]]></category>
            <category><![CDATA[infosecurity]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Scutum]]></dc:creator>
            <pubDate>Mon, 16 Nov 2020 22:35:54 GMT</pubDate>
            <atom:updated>2020-11-16T22:57:47.371Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi all,</p><p>Thank you for visiting this page. This is part of my personal project to try to reverse malicious programs in an effort to develop my malware analysis skills. In this blog, I will explain my findings when I tried to analyze a popular commercial keylogger named Ardamax.</p><p><a href="https://www.ardamax.com/keylogger/">Ardamax Keylogger - best invisible remote keylogger</a></p><blockquote>Hash of original keylogger:<br>8C870EEC48BC4EA1ACA1F0C63C8A82AAADAF837F197708A7F0321238DA8B6B75</blockquote><p>Of the bat, Virustotal recognize it as a known trojan sample.</p><h3>Dissecting it!</h3><p>By wearing the hat of a malware analyst, I loaded the sample in x32dbg tool to get a glimpse of what all Windows API functions it is using. Below is the screenshot of the functions it was loading:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*TJhEjeD-kLfO3lp_Qyw_og.png" /><figcaption>Windows API functions listed by x32dbg</figcaption></figure><p>I was expecting Windows API calls like <em>SetWindowsHookExA, GetKeyBoardState, GetAsyncKeyState</em>, etc. However, based on the list I see, it looked like the sample is hiding the usual functions in further execution. From the list, I see the sample is using API <em>GetProcAddress</em> which is basically used to get the address of the exported function from a DLL. So I am assuming the sample might be loading a DLL when it runs.</p><p><a href="https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress">GetProcAddress function (libloaderapi.h) - Win32 apps</a></p><p>My next step is now to run the program up to a breakpoint on API <em>GetProcAddress</em>. As shown below, the sample loaded a function named ‘<em>sfx_main</em>’ from the DDL whose address is in EAX:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*Lfk1uKSXYOnHhrWh35HPGw.png" /></figure><p>As you can see, the highlighted part 1 in the screenshot shows the handle argument being passed to API <em>GetProcAddress</em> and the highlighted part 2 shows the dump from EAX.I dumped this memory section and fixed its Import Address Table (IAT) using Scylla plugin. Luckily, everything worked without any errors. Somehow, in the past I was not able to fix IAT that easily. Lucky me!</p><p>I tried to load the extracted DLL in IDA. I see hundreds of other APIs which I did not see in the original executable. I was able to find all the weird and obvious functions a keylogger can use in the list. You can find the list of all functions in this file:</p><p><a href="https://www.dropbox.com/s/r43wsw47e8w8uy1/Ardamax-stage2-api_functions.txt?dl=0">Ardamax-stage2-api_functions.txt</a></p><h3>Let it load buddy!</h3><p>Performing some behavior analysis on the original executable reveals that it creates another process name ‘<em>DPBJ.exe</em>’ and is executed as a service. This probably indicates the stealthiness of the keylogger. I ran the sample several times to see if the file name changes every time, however it remains same at each fresh execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*CxPSjZqFV3_Cx8coR2ZM5A.png" /><figcaption>Another executable runs with process name ‘DPBJ.exe’</figcaption></figure><p>Using the <em>procmon</em> tool, I observed an interesting operation being performed by the executable. I saw three registry value set events by the process. Looking closely at the folder location, the process is trying to set some value in the folder named ‘<em>ASProtect</em>’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OK4Rjngc6QSjdfKRosKZjg.png" /><figcaption>Registry Set event in folder named ‘ASProtect’</figcaption></figure><p>Conducting some OSINT, I found that <strong>ASProtect</strong> is an EXE packing tool. Ahan! I think I might have found the tool which was used to pack this executable. Or the other logic could be that the author has used this tool to protect the application from copy right issues. However, based on the profile of the sample, I think it was used just to protect the executable from analysis, disassemblers and debuggers. Lastly, I was observing network traffic on Wireshark while running the sample. Nothing interesting stands out on wire. My assumption is its creates traffic when the sample is properly configured on how it can send logs and the stolen data back to the actor.</p><p>Thank you for reading. Hope you find it interesting. Please let me know if you have any questions!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dff07ab127d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Emotet trojan -My first malware analysis report]]></title>
            <link>https://crackme-analyst82.medium.com/emotet-trojan-my-first-malware-analysis-report-a7b89c976b53?source=rss-aecedf868849------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7b89c976b53</guid>
            <dc:creator><![CDATA[Scutum]]></dc:creator>
            <pubDate>Thu, 29 Oct 2020 21:12:41 GMT</pubDate>
            <atom:updated>2020-10-29T21:12:41.468Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, thank you for taking time to view this post.</p><p>I will be performing malware analysis on Emotet trojan sample downloaded from malware-traffic-analysis.net. You can find the link here:</p><p><a href="https://www.malware-traffic-analysis.net/2018/11/30/index.html">Malware-Traffic-Analysis.net - 2018-11-26 thru 2018-11-30 - Five examples of Emotet infections</a></p><h3>The wild word!</h3><p>The blog post mentioned above contains a word file which was found to be downloading a variant of Emotet trojan.</p><blockquote><strong><em>DOC file SHA256: </em></strong><em>671A6530C871B816E2DA116C4269EA21A7F8DC65B639D5121D55E0CC3503CD60</em></blockquote><p>I inspected the embedded macro code in the word document using the OLE tools (oledump.py). There are 3 files which were found and as expected, they were obfuscated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*K9BAUtcBgtu-c8eGCO2Y6A.png" /></figure><p>Using the default Microsoft Word debugging feature, I spent some time debugging the VBA to see what actions it do when the user allows the macro to run.</p><p>Here how the obfuscated VBA code looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wmHfiB15ZD2WLFMNVwMegw.png" /></figure><p>Looking at one of the variables in the VBA code, it was very clear that it was running a command prompt with ‘/c’ which means the command prompt will terminate after executing the commands. Here is the glance of the initial bytes of commands ran by the macro code:</p><blockquote>c:\ndYYqnDnEWUoR\CXVKvMr\LoBtBBBi\..\..\..\windows\system32\cmd.exe /c %ProgramData:~0,1%%ProgramData:~9,2% /V:ON/C”set c8UG=;’hTZ’=kBj$}}{hctac}};kaerb;’jmv’=zfU$”</blockquote><p>The macro code undergoes several iterations and ends up contacting five URLs as mentioned below. Wireshark was used to retrieve these URLs.</p><p><strong>URLs contacted:</strong></p><blockquote>hxxp://sandbox.leadseven(.)com/HAb<br>hxxp://iantdbrasil(.)com(.)br/m9Fg<br>hxxp://greatvacationgiveaways(.)com/aMLy<br>hxxp://progettopersianas(.)com(.)br/QlltYOUC<br>hxxp://2d73(.)ru/cc6rkI</blockquote><p>The malware-traffic-analysis.net mentioned that the Emotet was being downloaded by this word file. So I am assuming that the Emotet was being downloaded from one or all of the above URLs. Please note that I did not try to go to the URL and retrieve the sample.</p><blockquote><strong>Emotet sample SHA256: </strong>671A6530C871B816E2DA116C4269EA21A7F8DC65B639D5121D55E0CC3503CD60</blockquote><h3>Reversing it!</h3><p>Using the popular reversing tools (OllyDbg, x64dbg and IDA), I analyzed the PE executable in a VM. Right of the bat, I see the sample is using several anti-debugging and anti-VM techniques. Here is the list of Windows API functions called by the sample:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*JUOYZxz55BnBL9oz38-_yQ.png" /></figure><p>From the list, here are some of the API calls which I think is being used by sample to detect VMs:</p><blockquote>GetPhysicalCursorPos — API to get the co-ordinates of the cursor. This can be used to detect the movement of the mouse cursor while the instructions are executing.</blockquote><blockquote>GetLastActivePopup — API gets the pop-up window owned by the specified window was most recently active. I think malware is probably scanning for debugging tools.</blockquote><blockquote>CountClipboardFormats — API gives the count of data formats on clipboard. I think malware is checking to see if there is any data on clipboard.</blockquote><h3>What’s next?</h3><p>Since this is the very beginning of my malware analysis reports, the next thing is to go deep in the code and see how I can patch/bypass the current anti-reversing techniques implemented in the sample.</p><p>Once that is achieved I might be able to see how the malware behaves in a VM and see what other artifacts it leaves on the victim system.</p><p>Please let me know your suggestions about this write-up and I will be happy to improve it!</p><p>Thanks again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7b89c976b53" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>