{"id":86560,"date":"2018-07-25T19:10:33","date_gmt":"2018-07-25T13:40:33","guid":{"rendered":"https:\/\/blogs_admin.quickheal.com\/?p=86560"},"modified":"2018-07-25T19:10:33","modified_gmt":"2018-07-25T13:40:33","slug":"evolution-4-year-old-threat-emotet-infamous-trojan-complex-threat-distributer","status":"publish","type":"post","link":"https:\/\/www.quickheal.com\/blogs\/evolution-4-year-old-threat-emotet-infamous-trojan-complex-threat-distributer\/","title":{"rendered":"The evolution of a 4-year-old-threat Emotet: From an infamous Trojan to a complex threat distributer"},"content":{"rendered":"<p>Emotet malware campaign has been existing for a long time. It comes frequently in intervals with different techniques and variants to deliver malware on a victim. Attackers are smart and they use complex techniques to avoid detection. At the start of 2017, we had seen the emotet campaign spreading through email attached PDF and JS file. This time, it is spreading through MS Office Word documents with a heavily obfuscated macro inside it.<\/p>\n<p><strong><b>Attack chain<\/b><\/strong><\/p>\n<figure id=\"attachment_2591\" aria-describedby=\"caption-attachment-2591\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2591\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/emoteChain-1024x536.jpg\" alt=\"Attack Chain\" width=\"768\" height=\"402\" \/><figcaption id=\"caption-attachment-2591\" class=\"wp-caption-text\">Fig.1 Attack Chain<\/figcaption><\/figure>\n<p>The spreading mechanism of this campaign is a phishing email. It uses subject lines like \u2018Invoice\u2019, \u2018Delivery details\u2019, \u2018Shipment details\u2019, \u2018Payment details\u2019 and so on to trick the victim into opening the email. Such emails have compromise or phishing sites that will download a Word document. Another way is directly attaching a document inside the email or sometimes attaching a compressed file having a document file.<\/p>\n<figure id=\"attachment_2598\" aria-describedby=\"caption-attachment-2598\" style=\"width: 683px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2598\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/mail2.png\" alt=\"\" width=\"683\" height=\"430\" \/><figcaption id=\"caption-attachment-2598\" class=\"wp-caption-text\">Fig.2 Phishing Mail<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p><strong><b>Detail analysis of Macro<\/b><\/strong><\/p>\n<p>A malicious office document embedded with macro, on clicking on Enable Editing a macro code will be activated. We have taken one sample. it&#8217;s having two heavily obfuscated macros inside, such as &#8220;prMzoHTQ&#8221; &amp; &#8220;zdXXRhCd&#8221;, a code has Sub AutoOpen() function is executing the macros.<\/p>\n<figure id=\"attachment_2599\" aria-describedby=\"caption-attachment-2599\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2599\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/vbe1-1024x443.png\" alt=\"\" width=\"768\" height=\"332\" \/><figcaption id=\"caption-attachment-2599\" class=\"wp-caption-text\">Fig.3 Macro Workflow<\/figcaption><\/figure>\n<p>In first macro &#8220;zdXXRhCd&#8221; one function FAUzvR() which accepts a string as an argument. In the phase of deobfuscation, we found that there were used junk code to do complications in reverse the code, On Error Resume Next, it means there is junk code if it exists ignore it. Shell is using to execute the code, next to the shell there is vbkeyP which means the letter &#8220;P&#8221;. Values MIqCuXCZPMl, SOznt, and 4 others are parameters are passed to function FAUzvR() as shown in the figure, These are declared as a function in the second macro. The motivation of the second macro is combining strings and return a value to functions FAUzvR() to the first macro. function FAUzvR() create a WScript Shell object, execute the functions with vbkeyP in order to get below output.<br \/>\n&#8220;PowersHeLL -e KABuAEUAVwAtAG8AYgBKAEUAYwBUACAAIABT&#8230;&#8230;&#8221;<\/p>\n<p>We get final PowerShell command as shown in below figure.<\/p>\n<figure id=\"attachment_2592\" aria-describedby=\"caption-attachment-2592\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2592\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/capture1-1024x404.png\" alt=\"\" width=\"768\" height=\"303\" \/><figcaption id=\"caption-attachment-2592\" class=\"wp-caption-text\">Fig.4 PowerShell command<\/figcaption><\/figure>\n<p>While looking at command, we found that PowerShell with encoded base64 string. After decoding the base64 string, we get below output-<\/p>\n<figure id=\"attachment_2593\" aria-describedby=\"caption-attachment-2593\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2593 size-large\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/capture2-1024x177.png\" alt=\"Fig.5 After base64 decode.\" width=\"768\" height=\"133\" \/><figcaption id=\"caption-attachment-2593\" class=\"wp-caption-text\">Fig.5 After base64 decode.<\/figcaption><\/figure>\n<p>Then it is showing a Powershell script. Its contents compressed Base64 string with Powershell parameters. Here in script use IO.StreamReader initializes a new instance of StreamReader class for the specified file, with specified character encoding. IO.compression.compressionMode is set the compression mode to Decompression. Deflate stream object will be stream decompressed bytes from MemoryStream. [SySTem.tExt.encodIng]::ASCII It set to ASCII encoding. REadtOEND() reads the entire stream and returns the ASCII string contained in it.<\/p>\n<p>For deobfuscation of the script we need to first decode the string with base64, then us decompression will get output in below figure-<\/p>\n<figure id=\"attachment_2594\" aria-describedby=\"caption-attachment-2594\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2594\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/capture3-1024x138.png\" alt=\"\" width=\"768\" height=\"104\" \/><figcaption id=\"caption-attachment-2594\" class=\"wp-caption-text\">Fig.6 De-obfuscation Powershell stage2<\/figcaption><\/figure>\n<p>We finally get a deobfuscated script. It has a list of malicious URLs. The script downloads malware from URLs and generates random file names by picking in bet 1 to 994915, then kept at %temp% location as a .exe extension. Then the malware will be executed using Start-Process.<\/p>\n<p>We have come across with different obfuscation ways as shown in below figures.<\/p>\n<figure id=\"attachment_2595\" aria-describedby=\"caption-attachment-2595\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2595\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/capture8-1024x102.png\" alt=\"\" width=\"768\" height=\"77\" \/><figcaption id=\"caption-attachment-2595\" class=\"wp-caption-text\">Fig.7 Obfuscated pattern1<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_2596\" aria-describedby=\"caption-attachment-2596\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2596\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/capture9-1024x190.png\" alt=\"\" width=\"768\" height=\"143\" \/><figcaption id=\"caption-attachment-2596\" class=\"wp-caption-text\">Fig.8 Obfuscated pattern2<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_2597\" aria-describedby=\"caption-attachment-2597\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2597\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/capture10-1024x152.png\" alt=\"\" width=\"768\" height=\"114\" \/><figcaption id=\"caption-attachment-2597\" class=\"wp-caption-text\">Fig.9 Obfuscated pattern3<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p><strong><b>Payload Analysis<\/b><\/strong><\/p>\n<p>The downloaded payload &#8220;{Random_number}<em><i>.exe<\/i><\/em>&#8221; is then executed from %temp% location.<\/p>\n<p>In this case, we found the payload name as <em><i>&#8220;iwamregutilman.exe&#8221;<\/i><\/em>. This rename its instance and launched its copy of name <em><i>&#8220;wsdquota.exe&#8221; <\/i><\/em>from &#8220;C:\\Windows\\system32&#8221; location.<\/p>\n<p>This file again spawned a new instance of its own and show its activity.<\/p>\n<figure id=\"attachment_2600\" aria-describedby=\"caption-attachment-2600\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2600\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/Proc-1024x95.png\" alt=\"\" width=\"768\" height=\"71\" \/><figcaption id=\"caption-attachment-2600\" class=\"wp-caption-text\">Fig.10 The execution flow<\/figcaption><\/figure>\n<p>The downloaded payload has a pre-defined list of words, by using a combination of 2 words from this list it creates the name of 2<sup>nd<\/sup>\u00a0self-copy executes from respective locations. If the system is 32-bit, then it executed its self-copy from &#8220;C:\\Windows\\System32&#8221; folder else if it is 64-bit then the location is &#8220;C:\\Windows\\SysWOW64&#8221;.<\/p>\n<figure id=\"attachment_2601\" aria-describedby=\"caption-attachment-2601\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2601 size-large\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/Listof-File-names-1024x389.png\" alt=\"\" width=\"768\" height=\"292\" \/><figcaption id=\"caption-attachment-2601\" class=\"wp-caption-text\">Fig.11 List of file names<\/figcaption><\/figure>\n<p>The following is the list of names stored in this file.<\/p>\n<figure id=\"attachment_2602\" aria-describedby=\"caption-attachment-2602\" style=\"width: 654px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2602 size-full\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/Listof-File-names2.png\" alt=\"Fig.12 Total list of names\" width=\"654\" height=\"135\" \/><figcaption id=\"caption-attachment-2602\" class=\"wp-caption-text\">Fig.12 Total list of names<\/figcaption><\/figure>\n<p>By combining the 1<sup>st<\/sup>\u00a0word as &#8220;wsd&#8221; and 2<sup>nd<\/sup>\u00a0word is &#8220;quota&#8221; it creates the name of the file name as &#8220;wsdquota.exe&#8221;.<\/p>\n<p>The first instance of the dropped file contains the huge encrypted data. This data will get decrypted at runtime and writes 2 another PE file in memory which can be used by the parent file for further process.<\/p>\n<p>After this, the parent process checks whether the process is spawned by itself or not. If not, then it creates one mutex and closes the parent process and run as an individual.<\/p>\n<p>The spawned process will list out all the running process and stores it in a memory. After that, it starts enumerating each process.<\/p>\n<figure id=\"attachment_2603\" aria-describedby=\"caption-attachment-2603\" style=\"width: 768px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2603 size-large\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/EnumrateProc_loop-1024x382.png\" alt=\"\" width=\"768\" height=\"287\" \/><figcaption id=\"caption-attachment-2603\" class=\"wp-caption-text\">Fig.13 Show each process list enumeration<\/figcaption><\/figure>\n<p>By using the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/desktop\/api\/tlhelp32\/nf-tlhelp32-createtoolhelp32snapshot\"><u>CreateToolhelp32Snapshot<\/u><\/a>\u00a0function, it takes the snapshot of each process and threads, heaps and modules used by these processes.<\/p>\n<figure id=\"attachment_2608\" aria-describedby=\"caption-attachment-2608\" style=\"width: 924px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2608 size-full\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/CreateSnap.png\" alt=\"\" width=\"924\" height=\"255\" \/><figcaption id=\"caption-attachment-2608\" class=\"wp-caption-text\">Fig.14 Use of CreateToolhelp32Snapshot function<\/figcaption><\/figure>\n<p>After taking the details of each running process, malware starts to encrypting the data and sends to the malicious server in POST request.<\/p>\n<figure id=\"attachment_2605\" aria-describedby=\"caption-attachment-2605\" style=\"width: 744px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2605 size-full\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/Untitled-1.png\" alt=\"\" width=\"744\" height=\"283\" \/><figcaption id=\"caption-attachment-2605\" class=\"wp-caption-text\">Fig.15 Post request<\/figcaption><\/figure>\n<p>As the all malicious servers are not active, so we can&#8217;t find the post activity after the response of this malware.<\/p>\n<p>Following is the list of malicious URLs present in malware which sends the POST request to each URL.<\/p>\n<figure id=\"attachment_2607\" aria-describedby=\"caption-attachment-2607\" style=\"width: 410px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2607\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/Malicious-Domains.png\" alt=\"\" width=\"410\" height=\"329\" \/><figcaption id=\"caption-attachment-2607\" class=\"wp-caption-text\">Fig.16 CnC request domain list<\/figcaption><\/figure>\n<p><strong><b>IOCs<\/b><\/strong><\/p>\n<p>4154619d2075d3f6c9e73bf4cdccdb17 (DOC)<\/p>\n<p>6f86fa7d95fed4472ad03eb77cb6a9a4 (DOC)<\/p>\n<p>2dcf064d40ef8fda90193fb00d306020 (DOC)<\/p>\n<p>8249D414627D3DDE168318C92A63F74A (PE)<\/p>\n<p>7B6E1369FF14E16A4815AE1DB32F0794 (PE)<\/p>\n<p><strong><b>\u00a0<\/b><\/strong><\/p>\n<p><strong><b>Detection Statistics<\/b><\/strong><\/p>\n<p>Quick heal has successfully detected the spam email which is the initial vector of the Emotet campaign. It is a special type of a detection provided by Quick Heal for detecting such kinds of campaigns.<\/p>\n<p>Below are the last one-month statistics of email detections.<\/p>\n<figure id=\"attachment_2612\" aria-describedby=\"caption-attachment-2612\" style=\"width: 808px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2612 size-full\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/DetectionStat1-1.png\" alt=\"\" width=\"808\" height=\"353\" \/><figcaption id=\"caption-attachment-2612\" class=\"wp-caption-text\">Fig.17 Email detections<\/figcaption><\/figure>\n<p>As Quick Heal is detecting the initial vector of Emotet campaign, we have seen less hits from the second and third vector of this campaign.<\/p>\n<figure id=\"attachment_2611\" aria-describedby=\"caption-attachment-2611\" style=\"width: 702px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2611\" src=\"https:\/\/blogs_admin.seqrite.com\/wp-content\/uploads\/2018\/07\/DetectionStat2.png\" alt=\"\" width=\"702\" height=\"336\" \/><figcaption id=\"caption-attachment-2611\" class=\"wp-caption-text\">Fig.18 Doc and Executable detections<\/figcaption><\/figure>\n<p><strong><b>\u00a0<\/b><\/strong><\/p>\n<p><strong><b>Detection Names<\/b><\/strong><\/p>\n<ul>\n<li>MIME.Emotet.Downloader.31464<\/li>\n<li>MIME.Emotet.31831<\/li>\n<li>MIME.Emotet.31617<\/li>\n<li>MIME.Emotet.31618<\/li>\n<li>W97M.Emotet.31645<\/li>\n<li>W97M.Emotet.31769<\/li>\n<li>X97M.Emotet.32092<\/li>\n<li>Trojan.Emotet.Y4<\/li>\n<li>Trojan.Emotet.X4<\/li>\n<\/ul>\n<p><strong><b>Conclusion<\/b><\/strong><\/p>\n<p>Spreading Emotet malware via spam mail which has social engineering tricks to phish the user easily.<\/p>\n<p>Quick Heal provides multilayered protection against each layer of Emotet campaign.<\/p>\n<p><strong><b>Security measures to follow<\/b><\/strong><\/p>\n<ul>\n<li>Don&#8217;t open any link in mail body sent by an unknown source.<\/li>\n<li>Don&#8217;t download attachments received by an untrusted source.<\/li>\n<li>Always turn on email protection of your antivirus software.<\/li>\n<li>Don&#8217;t enable \u2018macros\u2019 or &#8216;editing mode&#8217; upon execution of the document.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong><b>Subject Matter Experts:<\/b><\/strong><\/p>\n<p>Prashant Tilekar, Aniruddha Dolas, Preksha Saxena, Prakash Galande, Vallabh Chole | Quick Heal Security Labs<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Emotet malware campaign has been existing for a long time. It comes frequently in intervals with different techniques and variants to deliver malware on a victim. Attackers are smart and they use complex techniques to avoid detection. At the start of 2017, we had seen the emotet campaign spreading through email attached PDF and JS [&hellip;]<\/p>\n","protected":false},"author":38,"featured_media":86561,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,24,303,5,293],"tags":[1443,1615,1503,1548,521],"class_list":["post-86560","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email","category-malware","category-phishing","category-security","category-spam","tag-banking-malware","tag-emotet","tag-malspam","tag-obfuscation","tag-phishing-email"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/86560"}],"collection":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/comments?post=86560"}],"version-history":[{"count":1,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/86560\/revisions"}],"predecessor-version":[{"id":86562,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/86560\/revisions\/86562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media\/86561"}],"wp:attachment":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media?parent=86560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/categories?post=86560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/tags?post=86560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}