{"id":13064,"date":"2018-08-10T02:20:06","date_gmt":"2018-08-10T10:20:06","guid":{"rendered":"https:\/\/www.palada.net\/index.php\/2018\/08\/10\/news-6831\/"},"modified":"2018-08-10T02:20:06","modified_gmt":"2018-08-10T10:20:06","slug":"news-6831","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2018\/08\/10\/news-6831\/","title":{"rendered":"Again! A New .NET Ransomware Shrug2"},"content":{"rendered":"<p><strong>Credit to Author: Ghanshyam More| Date: Fri, 10 Aug 2018 09:35:21 +0000<\/strong><\/p>\n<p>Estimated reading time: 5 minutesFor\u00a0several months, Quick Heal Security Labs has been observing an increase in ransomware\u00a0which are\u00a0built in\u00a0 .NET\u00a0framework. Ransomware like SamSam, Lime and now Shrug was found to be built in .NET framework. Malware authors are\u00a0finding it very easy to build and obfuscate malware in .NET framework rather than making them in other compilers. Quick Heal Security Labs has found a new ransomware named Shrug2. This ransomware demands a ransom\u00a0of 70$ in the form of Bitcoin for decrypting files. The infection vector of this ransomware is still unknown, but this file may arrive on the victim\u2019s machine via phishing emails, RDP brute force attacks, malvertising, bundled with other files, etc. Technical Analysis Before starting file encryption, this ransomware checks for an active Internet connection in an infinite loop by trying to connect to the following\u00a0URL: \u201chxxp:\/\/clients3[.]google[.]com\/generate_204\u201d Fig 1: Code to Check Internet Connection If an active Internet connection is found on the victim\u2019s system, it checks whether the system is previously infected with \u201cSHRUG2\u201d by checking the below registry entry: \u201cHKCUShrugTwo\u201d Fig 2: ShrugTwo Existing Registry Check If the system\u00a0is not infected, then it creates a subkey\u00a0with name \u201cShrugTwo\u201d\u00a0under HKCU and adds respective values to it as shown in Fig 3. \u00a0Identifier:\u00a0Generated using Username of logged on user appended with a randomly\u00a0generated number between 10000 to 99999, Eg. Username\/25413 \u00a0Installdate:\u00a0Date and time when the ransomware infects the\u00a0victim&#8217;s system. This date and time is\u00a0used by the ransomware to display the time left to decrypt\u00a0the files as shown in Fig 15. \u00a0cryKey: Randomly generated AES256 bit key used to encrypt files. \u00a0cryIV \u00a0:\u00a0Randomly generated Initialization Vector used to encrypt files. Fig 3: Creating ShrugTwo Registry and Adding Values Fig 4: ShrugTwo Registry Entry After this, malware executes below command to grant all permissions to directory and sub-directories present in %CD%. This command was also seen to have been used by the WannaCry ransomware. icacls\u00a0. \/grant Everyone:F\u00a0\/T \/C \/Q As all ransomware do, it also deletes restore points on the victim\u2019s system. For doing this, it doesn\u2019t use\u00a0trivial ransomware restore point deletion, such as vssadmin delete shadows \/all \/quiet &amp; wmic shadowcopy delete Rather it uses a very uncommon technique using\u00a0srclient.SRRemoveRestorePoint\u00a0as shown below: Fig 5: System Restore Point Deletion This ransomware encrypts files with around 76 different extensions. The list of extension is as follows: &#8220;txt, .docx, .xls, .doc, .xlsx, .ppt, .pptx, .odt, .jpg, .png, .jpeg, .csv, .mdb, .db, .sln, \u00a0\u00a0\u00a0\u00a0.html, .php, .asp, .aspx, .html, .xml, .json, .dat, .cpp, .cs, .c, .js, .java, .mp4, .ogg, \u00a0\u00a0\u00a0\u00a0.mp3, .wmv, .avi, .gif, .mpeg, .msi, .rar, .7zip, .z, .apk, .yml, .qml, .py3, .aif, .cda, \u00a0\u00a0\u00a0\u00a0.mpa, .wpl, .mid, .pkg, .deb, .arj, .rpm, .gz, .dbf, .yml, .tar, .pl, .rb, .ico, .tif, .asp, \u00a0\u00a0\u00a0\u00a0.xhtml, .rss, .jsp, .htm, .o, .zip, .midi, .tiff, .tiff, .midi, .zip, .tar.gz, .pyw, .bmp, .sql, \u00a0\u00a0.psd, .7z&#8221; The ransomware enumerates all files with the above extensions present in C:\\ drive only and stores them in a list named \u201cFilesToHarm\u201d. This list is later used for file encryption. Fig 6 : File Enumeration for Encryption Fig 7: Few Entries in \u201cFilesToHarm\u201d A similar kind of list is also created with the name \u201cHarmedFiles\u201d\u00a0which contains file paths of encrypted files having the extension\u00a0\u201c.SHRUG2\u201d, when the demanded ransom amount is paid or time to decrypt files is elapsed. This created list is used for file decryption or deletion. Fig 8 : File Enumeration for Decryption Fig 9: Few Entries in \u201cHarmedFiles\u201d This Ransomware uses AES256 algorithm in CBC(Cipher Block Chaining)\u00a0mode for encrypting enumerated files. In this type of mode,\u00a0there is a requirement\u00a0of Key\u00a0along with the Initialization Vector(IV). \u00a0The code\u00a0shown in Fig:\u00a010 is used to create below list and randomly selects 32 characters from it which is used as AES 256bit key. \u201cABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\u201d Fig 10: AES Key Generation Similarly,\u00a0code shown in Fig:\u00a011 is used to create below list and randomly selects 16 characters from it which is used as AES 128bit IV. \u201cZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba9876543210\u201d Fig 11: IV Generation Previously generated Key and IV are used to encrypt file paths present in \u201cFilesToHarm\u201d\u00a0list. Ransomware adds \u201c.SHRUG2\u201d\u00a0extension\u00a0to files after encryption. Fig 12: Encrypt Files and Add Extension To encrypt files, the ransomware selects file data in chunks of 128bit. This chunk of data is encrypted using previously generated Key and IV in&hellip;<br \/><a href=\"https:\/\/blogs.quickheal.com\/new-net-ransomware-shrug2\/\" target=\"bwo\" >http:\/\/blogs.quickheal.com\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: Ghanshyam More| Date: Fri, 10 Aug 2018 09:35:21 +0000<\/strong><\/p>\n<p>For\u00a0several months, Quick Heal Security Labs has been observing an increase in ransomware\u00a0which are\u00a0built in\u00a0 .NET\u00a0framework. Ransomware like SamSam, Lime and now Shrug was found to be built in .NET framework. Malware authors are\u00a0finding it very easy to build and obfuscate malware in .NET framework rather than making them in&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10459,10378],"tags":[11796,19195,11671,10439,3764,3765],"class_list":["post-13064","post","type-post","status-publish","format-standard","hentry","category-quickheal","category-security","tag-cyber-crime","tag-data-backup","tag-data-loss-prevention","tag-encryption","tag-malware","tag-ransomware"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/13064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=13064"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/13064\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=13064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=13064"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=13064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}