{"id":87915,"date":"2019-07-30T12:57:12","date_gmt":"2019-07-30T07:27:12","guid":{"rendered":"https:\/\/blogs_admin.quickheal.com\/?p=87915"},"modified":"2019-07-30T12:57:35","modified_gmt":"2019-07-30T07:27:35","slug":"megacortex-returns","status":"publish","type":"post","link":"https:\/\/www.quickheal.com\/blogs\/megacortex-returns\/","title":{"rendered":"MegaCortex Returns\u2026"},"content":{"rendered":"<p>MegaCortex, a ransomware which was first spotted in January this year, has become active again and has changed the way it previously attacked\/targeted the corporate world. In order to simplify its execution and increase its scale of operation, it uses \u2018Command Prompt\u2019 instead of \u2018PowerShell\u2019 in current targeted campaign.<\/p>\n<p><strong><u>Key Points:<\/u><\/strong><\/p>\n<p>1.While analyzing we found that the sample is digitally signed by \u201cThawte, Inc\u201d and publisher is &#8220;ABADAN PIZZA LTD\u201d, a UK based company.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-87948 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture1-11-300x132.png\" alt=\"\" width=\"468\" height=\"206\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture1-11-300x132.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture1-11.png 592w\" sizes=\"(max-width: 468px) 100vw, 468px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.1 The sample is digitally signed.<\/p>\n<p style=\"text-align: left;\">2. The ransom note is written in an aggressive and offhand language.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87944 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture2-300x93.png\" alt=\"\" width=\"490\" height=\"152\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture2-300x93.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture2-650x202.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture2.png 734w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.2 Very aggressive stance in ransom note.<\/p>\n<p><strong><u>BEHAVIOUR ANALYSIS:<\/u><\/strong><\/p>\n<p>Upon execution, MegaCortex cannot pass User Account Control and hence below pop up appears asking for access for the same.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87929 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture3-1-300x166.png\" alt=\"\" width=\"387\" height=\"214\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture3-1-300x166.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture3-1.png 462w\" sizes=\"(max-width: 387px) 100vw, 387px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.3 Pop up asking for access.<\/p>\n<p>The entire process of encryption is visible to the user as it appears on the command prompt as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87951 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture4-300x156.png\" alt=\"\" width=\"387\" height=\"201\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture4-300x156.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture4-650x337.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture4.png 682w\" sizes=\"(max-width: 387px) 100vw, 387px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.4 Encryption activity can be seen through command prompt.<\/p>\n<p>Once executed it creates lot of sub-processes hence creating a large process tree. As shown in the image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-87952 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture5-300x155.png\" alt=\"\" width=\"413\" height=\"214\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture5-300x155.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture5-768x397.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture5-650x336.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture5-789x408.png 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture5.png 1172w\" sizes=\"(max-width: 413px) 100vw, 413px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.5 Process Tree<\/p>\n<p>After encrypting a file, it appends \u201c. megacortex\u201d extension at the end of file\u2019s name. The pattern is &lt;file_name&gt;. &lt;original extension&gt;. &lt;new extension&gt; as shown in below image: &#8211;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87936 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture6-1-300x84.png\" alt=\"\" width=\"411\" height=\"115\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture6-1-300x84.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture6-1-304x84.png 304w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture6-1.png 604w\" sizes=\"(max-width: 411px) 100vw, 411px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.6 Encrypted files naming pattern<\/p>\n<p>This ransomware will also create a log file located at \u201cC:\\x5gj5_gmG8.log\u201d which records the names of files that could not be encrypted because of various reasons like access denied as the file is locked.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87928 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture7-300x114.png\" alt=\"\" width=\"395\" height=\"150\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture7-300x114.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture7-768x292.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture7-650x247.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture7-789x300.png 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture7.png 1016w\" sizes=\"(max-width: 395px) 100vw, 395px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.7 Log file<\/p>\n<p><strong><u>CODE ANALYSIS:<\/u><\/strong><\/p>\n<p>Once execution has been started, it uses \u201cnet stop \u2018service name\u2019 \/y\u201cand \u201csc config \u2018service name\u2019 start = disabled\u201d commands to terminate\/disable services. It disables or terminates approx. 1400 services and processes before starting encryption. It looks for service names that could be from a security software, backup servers, database servers, etc.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87953 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture8-300x123.png\" alt=\"\" width=\"378\" height=\"155\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture8-300x123.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture8.png 554w\" sizes=\"(max-width: 378px) 100vw, 378px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.8 Security products services will be stopped.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87954 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture9-300x143.jpg\" alt=\"\" width=\"390\" height=\"186\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture9-300x143.jpg 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture9-768x365.jpg 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture9-650x309.jpg 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture9-789x375.jpg 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture9.jpg 988w\" sizes=\"(max-width: 390px) 100vw, 390px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.9 Few services which MegaCortex looks for to terminate.<\/p>\n<p>While performing static analysis, we noticed that only \u2018KERNAL32.dll\u2019 was the DLL that was loaded initially. Much to our surprise, during debugging we found a lot more DLL\u2019s that were loaded and out of which \u2018cryptobase.dll\u2019 was the DLL that is being used for encryption and decryption activity.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87955 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture10-300x207.png\" alt=\"\" width=\"361\" height=\"249\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture10-300x207.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture10-229x158.png 229w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture10.png 544w\" sizes=\"(max-width: 361px) 100vw, 361px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.10 Used and imported DLLs<\/p>\n<p>The sample itself contains an encrypted instance which is encrypted using SALSA20 algorithm. Firstly, it decrypts the instance itself using \u2018RtlGenRandom\u2019 function. The \u2018Advapi32.dll\u2019 using this function as a resource named \u2018SystemFunction036\u2019. This function is used instead of API\u2019s from \u2018cryptobase.dll\u2019 to deceive analyst into believing that it is one of the genuine system functions.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87956 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture11-1-300x46.png\" alt=\"\" width=\"378\" height=\"58\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture11-1-300x46.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture11-1-768x119.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture11-1-650x101.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture11-1.png 788w\" sizes=\"(max-width: 378px) 100vw, 378px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.11 Algorithm used for Encryption.<\/p>\n<p>To encrypt files, it first scans the directories and then starts to encrypt the files by launching instances of itself. Each instance encrypts only one file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87957 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture12-300x174.png\" alt=\"\" width=\"355\" height=\"206\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture12-300x174.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture12.png 462w\" sizes=\"(max-width: 355px) 100vw, 355px\" \/><\/p>\n<p style=\"text-align: center;\">Fig 12. File encryption activity<\/p>\n<p>During decryption of its own instance, the encrypted sample is stored at the address pointed by \u2018EDI\u2019 register. The address of the decryption key is stored in the \u2018ESP\u2019 register. The key is being used to decrypt the data and store the data at the address pointed by \u2018ESI\u2019 register. In the below image, decryption has been started and can be seen in the hex dump at the address pointed by \u2018ESI\u2019.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87958 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture13-300x140.png\" alt=\"\" width=\"345\" height=\"161\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture13-300x140.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture13-768x359.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture13-650x304.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture13-789x369.png 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture13.png 1146w\" sizes=\"(max-width: 345px) 100vw, 345px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.13 Decryption Loop<\/p>\n<p>To save the time and efforts, MegaCortex adds the marker \u2019MEGA-G8=\u2019 at each file that is encrypted by this ransomware.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87959 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture14-300x118.png\" alt=\"\" width=\"381\" height=\"150\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture14-300x118.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture14.png 636w\" sizes=\"(max-width: 381px) 100vw, 381px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.14 Marker is added to each encrypted file<\/p>\n<p>MegaCortex ransomware has a blacklist of the extensions that it will not encrypt. It has a list of around 30 file extensions that include .bat, .exe, .dll, .sys, .tmp, etc. as shown below: &#8211;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87960 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture15-300x35.jpg\" alt=\"\" width=\"429\" height=\"50\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture15-300x35.jpg 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture15-768x91.jpg 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture15-650x77.jpg 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture15-789x93.jpg 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture15.jpg 856w\" sizes=\"(max-width: 429px) 100vw, 429px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.15 List of the blacklisted extension<\/p>\n<p>After encryption, the ransomware will also delete the volume shadow copies to prevent recovery of encrypted files.<\/p>\n<p>For that it uses \u201cvssadmin delete shadows \/all \/for=C:\\\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87961 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture16-300x22.png\" alt=\"\" width=\"437\" height=\"32\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture16-300x22.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture16-768x55.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture16-650x47.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture16-789x57.png 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture16.png 1168w\" sizes=\"(max-width: 437px) 100vw, 437px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.16 Command used to delete shadow copies<\/p>\n<p><strong>Ransom Note: &#8211;<\/strong><\/p>\n<p>The ransom note is written in a text file named \u201c!!!_READ-ME_!!!.txt\u201d which is kept on the desktop. It contains two email IDs for the victims to contact the attacker for information regarding payment.<\/p>\n<p>The ransom varies from 2 BTC to 600 BTC.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-87962 aligncenter\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/07\/Picture17-300x253.png\" alt=\"\" width=\"346\" height=\"292\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture17-300x253.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture17-768x648.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture17-462x390.png 462w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture17-789x666.png 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/07\/Picture17.png 858w\" sizes=\"(max-width: 346px) 100vw, 346px\" \/><\/p>\n<p style=\"text-align: center;\">Fig.16. Ransom note<\/p>\n<p>It is clearly seen that the attacker is no more ready to negotiate with the victims. Further they do not give any instructions as to how to buy bitcoins and asks the victim to Google the process. Also, they mention that they have attacked the system for profits and not to do any sort of charity.<\/p>\n<p>Most ransom notes walk you through the payment process and even show a lot of sympathy with the victim. But the attacker has an aggressive outlook towards the victim!<\/p>\n<p>The end of ransom note concludes with: \u201cMan is the master of everything and decides everything.\u201d<\/p>\n<p>&nbsp;<\/p>\n<p>IOC\u2019s: &#8211;<\/p>\n<p>MD5:c12ab67f2835b3a867af6c91aa3d3039<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Subject Matter Experts: &#8211;<\/strong><\/p>\n<p>Lavisha Mehndiratta,\u00a0Shivani Mule\u00a0| Quick Heal Security Labs<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MegaCortex, a ransomware which was first spotted in January this year, has become active again and has changed the way it previously attacked\/targeted the corporate world. In order to simplify its execution and increase its scale of operation, it uses \u2018Command Prompt\u2019 instead of \u2018PowerShell\u2019 in current targeted campaign. Key Points: 1.While analyzing we found [&hellip;]<\/p>\n","protected":false},"author":39,"featured_media":87937,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1671,910],"tags":[],"class_list":["post-87915","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-encryption","category-ransomware"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/87915"}],"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\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/comments?post=87915"}],"version-history":[{"count":3,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/87915\/revisions"}],"predecessor-version":[{"id":87950,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/87915\/revisions\/87950"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media\/87937"}],"wp:attachment":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media?parent=87915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/categories?post=87915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/tags?post=87915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}