{"id":89337,"date":"2020-09-26T11:16:53","date_gmt":"2020-09-26T05:46:53","guid":{"rendered":"https:\/\/blogs_admin.quickheal.com\/?p=89337"},"modified":"2023-10-17T13:00:39","modified_gmt":"2023-10-17T07:30:39","slug":"emotet-trojan-back-world-unlocks","status":"publish","type":"post","link":"https:\/\/www.quickheal.com\/blogs\/emotet-trojan-back-world-unlocks\/","title":{"rendered":"Emotet Trojan is back as the world unlocks"},"content":{"rendered":"<p>A threat actor named Emotet Trojan has been in the wild for more than 5 years, and now it is back after a 5 months break. It has spread globally, infecting new as well as old targets. It is re-launched with multiple Malspam Campaigns to distribute in all sectors.<\/p>\n<p>We observed through our detection telemetry that Emotet campaigns have targeted a variety of sectors. It is spread through SpamMail with hot topics like Covid-19, Vaccine for Covid-19, and few other generic keywords like Health Insurance, Payment, Invoice, Job Update\/Opening, <a href=\"https:\/\/blogs.quickheal.com\/a-new-generation-of-cyberattacks-that-can-fry-your-computer\/\">Cyberattack<\/a>, Shipping and many more.<\/p>\n<p><strong>Infection chain<\/strong><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89339 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture1.jpg\" alt=\"\" width=\"1246\" height=\"484\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture1.jpg 1246w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture1-300x117.jpg 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture1-768x298.jpg 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture1-650x252.jpg 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture1-789x306.jpg 789w\" sizes=\"(max-width: 1246px) 100vw, 1246px\" \/>Fig 1: Infection chain<\/p>\n<p>&nbsp;<\/p>\n<p>The infection chain starts by sending crafted emails to the target organization or person. The attacker uses the Hijacking email method for sending the crafted mails with an attachment. The attachment may contain a word document a macro file or a PDF. Sometimes the email body contains URLs too. As the mailbox is hijacked, attachment is sent replying to old email threads or forwarding to an existing mail list, due to which the victim easily opens the attachment as the mail comes from a trusted mail id.<\/p>\n<p>We encountered an extensive count of spam mails, few of the examples are listed below-<\/p>\n<p><strong>Spam Mails<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89340 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture2.png\" alt=\"\" width=\"945\" height=\"431\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture2.png 945w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture2-300x137.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture2-768x350.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture2-650x296.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture2-789x360.png 789w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89341 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture3.png\" alt=\"\" width=\"457\" height=\"518\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture3.png 457w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture3-265x300.png 265w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture3-344x390.png 344w\" sizes=\"(max-width: 457px) 100vw, 457px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89342 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture4.png\" alt=\"\" width=\"878\" height=\"622\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture4.png 878w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture4-300x213.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture4-768x544.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture4-551x390.png 551w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture4-789x559.png 789w\" sizes=\"(max-width: 878px) 100vw, 878px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89343 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture5.png\" alt=\"\" width=\"883\" height=\"561\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture5.png 883w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture5-300x191.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture5-768x488.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture5-614x390.png 614w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture5-789x501.png 789w\" sizes=\"(max-width: 883px) 100vw, 883px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89344 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture6.png\" alt=\"\" width=\"455\" height=\"423\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture6.png 455w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture6-300x279.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture6-420x390.png 420w\" sizes=\"(max-width: 455px) 100vw, 455px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89345 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture7.png\" alt=\"\" width=\"447\" height=\"518\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture7.png 447w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture7-259x300.png 259w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture7-337x390.png 337w\" sizes=\"(max-width: 447px) 100vw, 447px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 2. Example of Spam mails<\/p>\n<p>&nbsp;<\/p>\n<p>The attacker has done a silly mistake here, we can see in the mail that the subject and the attachment name don\u2019t match. In most of the cases, an attachment name contains \u201cMedical report Covid-19&#8243;.<\/p>\n<p><strong>Doc Analysis<\/strong><\/p>\n<p>The office Document attachment contains macro. The macro contains a heavily obfuscated VBA code. The code is responsible to deliver payload in the chain.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89346 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture8.png\" alt=\"\" width=\"1115\" height=\"645\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture8.png 1115w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture8-300x174.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture8-768x444.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture8-650x376.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture8-789x456.png 789w\" sizes=\"(max-width: 1115px) 100vw, 1115px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 3. Macro code in an attachment.<\/p>\n<p>&nbsp;<\/p>\n<p>After some de-obfuscation, the \u201cQndiwjphrk8an6x\u201d function code is as below<\/p>\n<p>{Qndiwjphrk8an6x = &#8220;winmgmt&#8221; + &#8220;:win32_&#8221; + &#8220;p&#8221; + &#8220;rocess&#8221;}<\/p>\n<p>which translates into winmgmts:win32_process. Once we removed the chunked data we got a readable code with functions and reference variables.<\/p>\n<p>One interesting part of the directory in Macros\\Ofbszpwp168r\\o.stm is that we can see some obfuscated data again.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89347 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture9.png\" alt=\"\" width=\"625\" height=\"474\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture9.png 625w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture9-300x228.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture9-514x390.png 514w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 4. Obfuscation in Doc file<\/p>\n<p>&nbsp;<\/p>\n<p>After the initial level of de-obfuscation, we got a base64 encoded PowerShell script as shown in the below figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89348 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture10.png\" alt=\"\" width=\"678\" height=\"255\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture10.png 678w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture10-300x113.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture10-650x244.png 650w\" sizes=\"(max-width: 678px) 100vw, 678px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 5. base64 Encoded PowerShell code<\/p>\n<p>After decoding with base64 and processing data, we got the below PowerShell script.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89349 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture11.png\" alt=\"\" width=\"978\" height=\"329\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture11.png 978w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture11-300x101.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture11-768x258.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture11-650x219.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture11-789x265.png 789w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 6. Base64 Decoded PowerShell script<\/p>\n<p>&nbsp;<\/p>\n<p>It contains malicious domains or URLs which serve Emotet executables. Using PowerShell commands Emotet executable is downloaded at \u201c%temp%\u201d directory in the victim\u2019s machine.<\/p>\n<p><strong>Payload Analysis<\/strong><\/p>\n<p>The payload downloaded from the above file has a customized packer. The unpacking is done at runtime. Emotet\u2019s packer code is polymorphic which makes it difficult for signature-based detection tools to detect it based on the packer code.<\/p>\n<p>Its resource (.rsrc) section has significant data which seems to be an indication that the malware might be packed. In the below Fig. we can see that RC Data has an encrypted code.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89350 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture12.png\" alt=\"\" width=\"554\" height=\"188\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture12.png 554w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture12-300x102.png 300w\" sizes=\"(max-width: 554px) 100vw, 554px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 7. File with encrypted data in resource<\/p>\n<p>While debugging the file, we observed that the data will be decrypted using a slightly modified version of RC4. Key for RC4 is hardcoded in the file. After decryption, the control goes to the decrypted shellcode.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89351 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture13.png\" alt=\"\" width=\"554\" height=\"149\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture13.png 554w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture13-300x81.png 300w\" sizes=\"(max-width: 554px) 100vw, 554px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 8. RC4 used for decryption<\/p>\n<p>&nbsp;<\/p>\n<p>In some files we have seen the use of VirtualAllocExNuma to allocate new memory. This is used for fast processing. The beginning of an obfuscated shellcode is copied to the new address after being decrypted using the modified RC4 algorithm. In addition to the relatively short shellcode, an additional PE can be seen in the memory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89352 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture14.png\" alt=\"\" width=\"541\" height=\"330\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture14.png 541w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture14-300x183.png 300w\" sizes=\"(max-width: 541px) 100vw, 541px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 9. Decrypted shellcode and PE File<\/p>\n<p>&nbsp;<\/p>\n<p>The Shellcode deobfuscates several API calls at runtime, such as LoadLibraryA, GetProcAddress, VirtualAlloc, and VirtualProtect, all of which will be used to resolve APIs and allocate memory to run the additional PE.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89353 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture15.png\" alt=\"\" width=\"554\" height=\"162\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture15.png 554w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture15-300x88.png 300w\" sizes=\"(max-width: 554px) 100vw, 554px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 10. API Resolved<\/p>\n<p>&nbsp;<\/p>\n<p>After this, the malware allocates memory and copies the data of the decrypted file and calls VirtualProtect and finally, the program jumps to the real entry point of the decrypted file.<\/p>\n<p>The spreading mechanism of Emotet campaign remains almost the same that we had already discussed in our previous blog. Read it <a href=\"https:\/\/blogs.quickheal.com\/evolution-4-year-old-threat-emotet-infamous-trojan-complex-threat-distributer\/\" target=\"_blank\" rel=\"noopener\">here.<\/a><\/p>\n<p>After executing the Emotet, it will exfiltrate the data to the CnC server. While sending, the data is encoded and sent with some random name of the file and a random path to the server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89354 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture16.png\" alt=\"\" width=\"867\" height=\"327\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture16.png 867w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture16-300x113.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture16-768x290.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture16-650x245.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture16-789x298.png 789w\" sizes=\"(max-width: 867px) 100vw, 867px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 11\u00a0 CnC traffic<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Detection hits stats<\/strong><\/p>\n<p>In Quick Heal detection, we have successfully detected such Emotet trojans. We have multiple detection layers like Email protection, Online protection, and Behaviour detection to protect our customers.<\/p>\n<p>Here is the detection stats number of hits per day in the last 45 days.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-89355 size-full\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2020\/09\/Picture17.png\" alt=\"\" width=\"480\" height=\"288\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture17.png 480w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture17-300x180.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2020\/09\/Picture17-250x150.png 250w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 12 Detection Stats<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>Emotet is a persistent threat actor and highly successful in delivering email-based malware, with major focus on email theft and sending additional malware. It has a moderate obfuscated code to deliver and bypass the detection technique.<\/p>\n<p>With the global impact of COVID-19, threat actors are likely to continue to use COVID-19-themed emails to deliver malware broadly in support of their objectives for all sectors.<\/p>\n<p>Quick Heal customers have long been protected from Emotet and other COVID-19-themed emails. We continue to track and report such attacks to keep our customers safe.<\/p>\n<p>&nbsp;<\/p>\n<p><em>Subject Matter Experts:<\/em><\/p>\n<p><em>Prashant Tilekar and Preksha Saxena<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A threat actor named Emotet Trojan has been in the wild for more than 5 years, and now it is back after a 5 months break. It has spread globally, infecting new as well as old targets. It is re-launched with multiple Malspam Campaigns to distribute in all sectors. We observed through our detection telemetry [&hellip;]<\/p>\n","protected":false},"author":54,"featured_media":89356,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-89337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/89337"}],"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\/54"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/comments?post=89337"}],"version-history":[{"count":3,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/89337\/revisions"}],"predecessor-version":[{"id":92172,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/89337\/revisions\/92172"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media\/89356"}],"wp:attachment":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media?parent=89337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/categories?post=89337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/tags?post=89337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}