{"id":11327,"date":"2018-01-31T15:10:03","date_gmt":"2018-01-31T23:10:03","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2018\/01\/31\/news-5098\/"},"modified":"2018-01-31T15:10:03","modified_gmt":"2018-01-31T23:10:03","slug":"news-5098","status":"publish","type":"post","link":"https:\/\/www.palada.net\/index.php\/2018\/01\/31\/news-5098\/","title":{"rendered":"Scarab ransomware: new variant changes tactics"},"content":{"rendered":"<p><strong>Credit to Author: vhioureas| Date: Wed, 31 Jan 2018 22:28:22 +0000<\/strong><\/p>\n<p style=\"text-align: left;\">The Scarab ransomware was discovered in June 2017. Since then, several variants have been created and discovered in the wild. The most popular or widespread versions were distributed via the Necurs botnet and initially written in Visual C compiled. However, after unpacking, we&#8217;ve found that another variant discovered in December 2017, called Scarabey, is distributed a little differently, with a different payload code as well.<\/p>\n<p>Scarabey, like most ransomware, is designed to demand a Bitcoin payment from its victims after encrypting files on their systems. However, instead of being distributed via Necurs malspam like the original Scarab, Scarabey was found targeting Russian users and being distributed via RDP\/manual dropping on servers and systems.<\/p>\n<p>In addition, Scarabey\u00a0seems to not be packed in any samples we have come across. The malicious code is written in Delphi without the C++ packaging that Scarab has and\u00a0the content and language of the ransom notes are different for each.<\/p>\n<h5 style=\"text-align: center;\">SAMPLES BEING REFERENCED<\/h5>\n<h5 style=\"text-align: center;\">SCARAB ORIGINAL: e8806738a575a6639e7c9aac882374ae<br \/> SCARABEY VARIANT:\u00a09a02862ac95345359dfc3dcc93e3c10e<\/h5>\n<h3>The ransom notes<\/h3>\n<p>As far as the victim is concerned, the main difference between Scarabey and other Scarab ransomware is the language of the ransom note and the scare tactic used in the encryption message.<\/p>\n<p>In the Scarab sample, the ransom note is written in English, however, it reads as if you translated word-for-word a Russian text into English, without knowing proper English grammar or syntax. Scarabey, on the other hand, is written in Russian. What&#8217;s interesting is that when you throw the Scarabey note into Google translate, as I have done below, it contains the same grammatical errors as the Scarab note.<\/p>\n<div id=\"attachment_21393\" style=\"max-width: 599px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-21393\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Scarab-ransom-note-2-600x596.png\" alt=\"Scarab ransom note\" width=\"589\" height=\"585\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Scarab-ransom-note-2-600x596.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Scarab-ransom-note-2-150x150.png 150w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Scarab-ransom-note-2-300x298.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Scarab-ransom-note-2.png 604w\" sizes=\"auto, (max-width: 589px) 100vw, 589px\" \/><\/p>\n<p class=\"wp-caption-text\">Original Scarab message<\/p>\n<\/div>\n<div id=\"attachment_21224\" style=\"max-width: 587px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-21224\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/ScarabMessage.png\" alt=\"\" width=\"577\" height=\"384\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/ScarabMessage.png 1176w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/ScarabMessage-300x199.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/ScarabMessage-600x398.png 600w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/p>\n<p class=\"wp-caption-text\">Scarabey message, translated from Russian to English with Google translate<\/p>\n<\/div>\n<p>This is more proof that that the authors of Scarab are likely Russian speakers who had written the note in their native language and run it through a translator to be added into the Scarab code. It would then seem quite likely that, since they decided to target Russians. they released the Scarabey note in their native language to cover more victims.<\/p>\n<h4>Different threats<\/h4>\n<p>In the original Scarab versions, it warns: The longer the user waits, the more the price will go up.<\/p>\n<p>For Scarabey, on the other hand, it tells users that for every day they wait, more and more files will be deleted, until there are no more files left for them to recover.<\/p>\n<p>Essentially, the criminals are implying that they have copies of the unencrypted files to give back to the user, or that they have control of the victim computer to delete files. This is not true for a few reasons:<\/p>\n<ol>\n<li>Besides the fact that the volume of data transfer to send up every file on the victim&#8217;s computer is completely unreasonable, there is no network functionality for sending files to the malware authors to hold as ransom.<\/li>\n<li>There is no backdoor or remote access code in scarab or its variants, which makes the threat of deleting files on victim&#8217;s computer impossible.<\/li>\n<li>The decryption process, from our understanding, is that they will send you decryption software loaded with the unique key after the ransom is payed. Then you can run the software and decrypt your files. That being said, there is no way for them to limit what gets decrypted as it is done locally and offline.<\/li>\n<li>Nowhere in the malware&#8217;s code is there any section that deletes user&#8217;s files from the computer.<\/li>\n<\/ol>\n<p>Specifically, in the message, you see the author implying that the code is initially decrypted server side, which is untrue:<\/p>\n<blockquote>\n<p><strong><em>&#8220;24 files are deleted every 24 hours. (we have copies of them)<\/em><\/strong><br \/> <strong><em> If you do not run the decryption program within 72 hours, all the files on the computer are completely deleted, without the possibility of recovery.&#8221;<\/em><\/strong><\/p>\n<\/blockquote>\n<p>Then, the malware author gives the steps to decrypt, which reference the use of a decryption program sent to the victim after payment. A decryption software received after payment with your unique key will decrypt files <strong>locally:<\/strong><\/p>\n<blockquote>\n<p><strong><em>&#8220;- After starting the decoder, the files are decoded within an hour.<\/em><\/strong><br \/> <strong><em> &#8211; Decoders of other users are incompatible with your data, as each user<\/em><\/strong><br \/> <strong><em> unique encryption key&#8221;<\/em><\/strong><\/p>\n<\/blockquote>\n<p>The conclusion here is that the deletion of files or the idea that the malware authors have access to delete files is purely a scare tactic used to urge users into sending money quickly.<\/p>\n<h3>Technical analysis<\/h3>\n<p>While comparing the code from Scarab to Scarabey, it became quite clear that this variant, although written in Russian and targeting Russian users, likely comes from the same authors of the original. Throughout the entire code, both variants of malware are almost <em>byte-for-byte identical<\/em>. In addition, the sub processes generated, the dropped files, the encryption method used, and the mutexes used are all identical between the original Scarab version and Scarabey. This is the reason we consider it a variant, rather than a new family.<\/p>\n<p>The following image shows the output from the two malware variants. The only things that differ are the addresses of code and memory data references (highlighted in yellow and red).<\/p>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21293\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/SH13.png\" alt=\"\" width=\"2014\" height=\"1204\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/SH13.png 2014w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/SH13-300x179.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/SH13-600x359.png 600w\" sizes=\"auto, (max-width: 2014px) 100vw, 2014px\" \/><\/h6>\n<h4>Code analysis<\/h4>\n<p>The Scarabey variant is written in Delphi. First, it starts off by checking if it is the first time being run. It does this by checking if it has parameters passed in. If not, it checks to see if the following registry key has been set:<\/p>\n<p><strong>SoftwareILRTISoidle<\/strong><\/p>\n<h6>[First run check, registry key]<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21238\" style=\"font-size: 16px;\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-18-at-7.27.45-PM.png\" alt=\"\" width=\"2120\" height=\"874\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-18-at-7.27.45-PM.png 2120w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-18-at-7.27.45-PM-300x124.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-18-at-7.27.45-PM-600x247.png 600w\" sizes=\"auto, (max-width: 2120px) 100vw, 2120px\" \/><\/h6>\n<p>If not set (meaning it is the first time run), it checks that SEVNZ has not been created yet and executes cmd.exe to copy itself into temp roaming directory as sevnz.exe using:<\/p>\n<p><strong>cmd.exe \/c copy \/y C:UsersvirusLabDesktop9a02862ac95345359dfc3dcc93e3c10e.exe &#8220;C:UsersvirusLabAppDataRoamingsevnz.exe&#8221;<\/strong><\/p>\n<p>Then it spawns a process of itself with param &#8216;runas&#8217; as it exits.<\/p>\n<h6>[verifies SEVNZ.EXE does not exist, copies self to SEVNZ.EXE. executes elf with &#8216;runas&#8217; param]<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21239\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot2.png\" alt=\"\" width=\"2126\" height=\"808\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot2.png 2126w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot2-300x114.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot2-600x228.png 600w\" sizes=\"auto, (max-width: 2126px) 100vw, 2126px\" \/><\/h6>\n<p>Now the sub process takes over.<\/p>\n<p>The code flow now enters the same function as before, and deletes SEVNZ and re-copies it. It skips over those initial sections because of the parameter passed in. It then executes the previously copied file sevnz.exe:<\/p>\n<p><strong>C:Users[username]AppDataRoamingsevnz.exe<\/strong><\/p>\n<p>Then, it opens the process cmd.exe with command line&#8230;<\/p>\n<p><strong>&#8220;mshta.exe &#8220;javascript:o=new ActiveXObject(&#8216;Scripting.FileSystemObject&#8217;);setInterval(function(){try{o.DeleteFile(&#8216;9a02862ac95345359dfc3dcc93e3c10f.exe&#8217;);close()}catch(e){}},10);&#8221;&#8221;<\/strong><\/p>\n<p>&#8230;which simply waits and deletes itself, since the process can\u2019t delete while running.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21240\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot3.png\" alt=\"\" width=\"1652\" height=\"312\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot3.png 1652w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot3-300x57.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot3-600x113.png 600w\" sizes=\"auto, (max-width: 1652px) 100vw, 1652px\" \/><\/p>\n<p>Now onto the SEVNZ.exe process:<\/p>\n<p>The process checks to see if it is currently running as sevnz.exe by trying to delete<br \/> <strong>&#8220;&#8230;AppDataRoamingsevnz.exe&#8221;\u00a0<\/strong><\/p>\n<p>If it fails, it now knows that it is currently running as sevnz.exe rather than the original executable. Once it passes this check, it uses mtsha.exe to execute Javascript, which will delay and add itself into the registry auto-run:<\/p>\n<h5>mshta.exe &#8220;javascript:o=new ActiveXObject(&#8216;WScript.Shell&#8217;);<br \/> x=newActiveXObject(&#8216;Scripting.FileSystemObject&#8217;);<br \/> setInterval(function(){try{i=x.GetFile(&#8216;sevnz.exe&#8217;).Path;<br \/> o.RegWrite(&#8216;HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\ILRTISo&#8217;,i);}<br \/> catch(e){}},10);<\/h5>\n<p>Next, it proceeds to delete shadow volume copies, which is standard for ransomware to make sure users cannot restore encrypted files.<\/p>\n<h5>&#8212;&#8211;Executes these scripts with mtsha.exe:&#8212;&#8211;<br \/> ActiveXObject(&#8220;WScript.Shell&#8221;);<br \/> o.Run(&#8220;cmd.exe \/c wbadmin DELETE SYSTEMSTATEBACKUP -keepVersions:0&#8221;,0);<br \/> o.Run(&#8220;cmd.exe \/c wmic SHADOWCOPY DELETE&#8221;,0);<br \/> o.Run(&#8220;cmd.exe \/c vssadmin Delete Shadows \/All \/Quiet&#8221;,0);<br \/> o.Run(&#8220;cmd.exe \/c bcdedit &#8220;<\/h5>\n<h5>new ActiveXObject(&#8220;WScript.Shell&#8221;);<br \/> o.Run(&#8220;cmd.exe \/c wbadmin DELETE SYSTEMSTATEBACKUP-keepVersions:0&#8221;,0);<br \/> o.Run(\u201ccmd.exe \/cwmicSHADOWCOPYDELETE&#8221;0);<br \/> o.Run(&#8220;cmd.exevssadminDeleteShadows \/All\/Quiet&#8221;,0);<br \/> o.Run(&#8220;cmd.exe \/c bcdedit \/set {default} recoveryenabled No&#8221;,0);<br \/> o.Run(&#8220;cmd.exe \/c bcdedit \/set {default} bootstatuspolicy ignoreallfailures&#8221;,0);<\/h5>\n<p>It then opens a thread that loops forever and makes sure no \u201ckey\u201d processes are running. If any are found, it kills those processes. The reason for this is possibly that these processes have a lock on some files that the ransomware would have otherwise wanted to encrypt. So by killing these processes, it frees the files for encryption. The key processes are from a string generated:<\/p>\n<h6>agntsvc.exe<br \/> isqlplussvc.exe<br \/> ncsvc.exe<br \/> msftesql.exe<br \/> sqlagent.exe<br \/> sqlbrowser.exe<br \/> sqlservr.exe<br \/> sqlserver.exe<br \/> sqlwriter.exe<br \/> oracle.exe<br \/> ocssd.exe<br \/> dbsnmp.exe<br \/> synctime.exe;<br \/> mydesktopqos.exe<br \/> agntsvc.exe<br \/> isqlplussvc.exe<br \/> xfssvccon.exe<br \/> mydesktopservice.exe<br \/> ocautoupds.exe<br \/> agntsvc.exe<br \/> agntsvc.exe<br \/> agntsvc.exe<br \/> encsvc.exe<br \/> firefoxconfig.exe<br \/> tbirdconfig.exe<br \/> ocomm.exe<br \/> mysqld.exe<br \/> mysqld-nt.exe<br \/> mysqld-opt.exe<br \/> dbeng50.exe<br \/> sqbcoreservice.exe<\/h6>\n<p>In the main loop of the encryption function, it performs constant checks throughout the code for a mutex, and if it exists, this is a sign to clean itself up and remove itself from the system:<\/p>\n<h6>MUTEX:\u00a0 \u00a0STOPSCARABSTOPSCARABSTOPSCARABSTOPSCARABSTOPSCARAB.<\/h6>\n<p>The encryption loop can be called through many different sections in the code, but the section that runs initially and performs the majority of the encryptions is pictured below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21241\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot4.png\" alt=\"\" width=\"2130\" height=\"438\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot4.png 2130w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot4-300x62.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot4-600x123.png 600w\" sizes=\"auto, (max-width: 2130px) 100vw, 2130px\" \/><\/p>\n<p>Recursively goes through all folders and checks to make sure the extension is not .exe or .dll. If okay, it encrypts files and renames them with a .scarab extension.<\/p>\n<h6>[checking current file extension using POS(),\u00a0 if exists as substr of &#8220;exe,dll&#8221;]<\/h6>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21242\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot5.png\" alt=\"\" width=\"2018\" height=\"796\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot5.png 2018w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot5-300x118.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot5-600x237.png 600w\" sizes=\"auto, (max-width: 2018px) 100vw, 2018px\" \/><\/h6>\n<p>The encryption code does not directly use any crypto APIs. Instead, the AES code is embedded within the malware, as shown in the images above.<\/p>\n<h6>[section is the setup leading to the call to the main cryptor function]<\/h6>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21243\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/scrrernshot5-1.png\" alt=\"\" width=\"2110\" height=\"622\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/scrrernshot5-1.png 2110w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/scrrernshot5-1-300x88.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/scrrernshot5-1-600x177.png 600w\" sizes=\"auto, (max-width: 2110px) 100vw, 2110px\" \/><\/h6>\n<h4 style=\"text-align: left;\">Encryption algorithym<\/h4>\n<p>We have determined that the algorithm for encryption is AES. A 4-byte chunk\u00a0<strong>(0xDEFACE01)\u00a0<\/strong>is tacked onto the buffer before the actual file data\u00a0that it reads. This could be salt, or a joke from the malware author. It performs some data manipulation operations using generated bytes, which could likely be the initialization vector to create randomness.<\/p>\n<h6>[IV GENERATOR FUNCTION FOLLOWED BY START OF AES SETUP]<\/h6>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21258\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot9.png\" alt=\"\" width=\"2086\" height=\"914\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot9.png 2086w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot9-300x131.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot9-600x263.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot9-195x85.png 195w\" sizes=\"auto, (max-width: 2086px) 100vw, 2086px\" \/><\/h6>\n<h6>[XORS DATA PASSED INTO THE MAIN_AES_LOOP_FUNCTION WHICH IS THE IV.\u00a0 var_8 being the encryption key]<\/h6>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21260\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot10.png\" alt=\"\" width=\"2086\" height=\"798\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot10.png 2086w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot10-300x115.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot10-600x230.png 600w\" sizes=\"auto, (max-width: 2086px) 100vw, 2086px\" \/><\/h6>\n<p>The malware proceeds to run AES 256 on the data, via the AES_ALGO labeled function. We determined it&#8217;s AES 256 because of a few properties.<\/p>\n<ol>\n<li>It uses 16-character blocks. This is pretty standard for any type of AES. It encrypts 16 characters from the file at a time, which is 128 bits.<\/li>\n<li>What differentiates the versions of AES is the size of the keys and the number of encryption rounds. In this case, it uses 14 rounds, which is standard for AES 256, instead of 10, which is standard for AES 128.\u00a0 The key size is also 256 bits (32 bytes or characters).<\/li>\n<li>The sub type CBC (cipher block chaining) is also being used. The main indicator for CBC here is that the previous cipher text is used to encrypt the next plain text block. In other words, the previous encrypted block is used as the initialization vector for the next block of data to encrypt.<\/li>\n<\/ol>\n<h6>[showing the flow for AES CBC, IV being used first, followed by previous cipher text being used as IV]<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21259\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/CBCAES.png\" alt=\"\" width=\"601\" height=\"242\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/CBCAES.png 601w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/CBCAES-300x121.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/CBCAES-600x242.png 600w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/h6>\n<p>In this case, the IV bytes are being XORed against the plain text bytes as an initialization step to create more randomness in the results. As you can see from the next image, the output of AES is then copied into the variable that will be used at the beginning of the loop to initialize the next plain text block before performing AES on it. At this point, it should be clearly AES usage, despite not being called via crypto APIs.<\/p>\n<h6>[The image below shows where the previous cipher-text is used for initialization as the IV. NOTE: var_28 will contain the encrypted data]<\/h6>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21280\" style=\"font-size: 16px;\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot11.png\" alt=\"\" width=\"2138\" height=\"1116\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot11.png 2138w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot11-300x157.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot11-600x313.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot11-630x330.png 630w\" sizes=\"auto, (max-width: 2138px) 100vw, 2138px\" \/><\/h6>\n<p>Below are a few screenshots illustrating the algorithm. As you can see, the data is loaded into matrixes. Then, a series of data operations is performed against some hardcoded data, together with the encryption key bytes. What you are seeing below in the highlighted text is one set of operations (1 of 4) in a single round. Four of these sets make up one encryption round. This is because in order to perform the matrix mathematics, you need to perform the operation for each item in the matrix against each of the others. And as stated earlier, 14 rounds total are done.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21257\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot8.png\" alt=\"\" width=\"2134\" height=\"1142\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot8.png 2134w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot8-300x161.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot8-600x321.png 600w\" sizes=\"auto, (max-width: 2134px) 100vw, 2134px\" \/><\/p>\n<hr \/>\n<p>The encoded encryption key is written in the registry \u2018temp\u2019 key:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21234\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/key_in_reg.png\" alt=\"\" width=\"915\" height=\"166\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/key_in_reg.png 915w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/key_in_reg-300x54.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/key_in_reg-600x109.png 600w\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" \/><\/p>\n<p>If the key is found in the registry, it proceeds to the function that decodes the key from the registry into the raw encryption key. Otherwise, it jumps to new generate function.<\/p>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21284\" style=\"font-size: 16px;\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot12.png\" alt=\"\" width=\"2130\" height=\"462\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot12.png 2130w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot12-300x65.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/screenshot12-600x130.png 600w\" sizes=\"auto, (max-width: 2130px) 100vw, 2130px\" \/><\/h6>\n<p>This is interesting because it is the main key used to encrypt files. The format is similar to the key from the ransom note, but this one is longer, suggesting that the key given to the user as the ID is an encoded version of the key stored in the registry. Example of the dumped key:<\/p>\n<pre>[HKEY_CURRENT_USERSoftwareILRTISo]  \"temp\"=\"VkIAAAAAAADpt9Q2lAzhCExfqjLoD3vSpluc678N56Zn8b7LVRxMi1ZsYk2HXD1e4s3tiefTmZJAc0vxPposvLzP0yaCh5+KRQm60U0EkzeB2NXetarabUFYgJxb8QRsygKaOqBriC4Bs4ajM24h=e2CsVNP9R3q==UXNmfRFGIsv7NR9BIxE35bdoFpTU8rMGQ14MeQcAii1iY7GpNoY3b4DOgfuKGo3qNC1MYKYdfpn0dbiow3f7ZQGClpwTZ0shFhkWk7aTA7TM1prtgJte7TWe=ERHg8GaFrZtVs9ylNTYPt5CmzHBdAIaXeKZvZnSSafbi83o9gLgAS1OxAb7LBtJpZAJDyBkuyJFR4dFbXztponIBKT1OjtTvTMy07+0B4jI3=K1QGuKSROjAdCF06TsjKWlvUw0iUHRGasz946H3Mnxu3GdCHrAp9Cd94bMo1x1PVdIi3bXSwobjgOlJgJPJC4Y6J4QIE=e45PDNzdK6aCY0uiQ0jOD=8lDWTp=+r+dbGJrJ12qn8CRnBwaFIpyNjDhzdMdTwyvExCmuOesOLms8S7TRoV1GcTyWJAQpSJYcR66H6CngM5GHopdpoTH4mWVOOYp5HFHTDAvMafomF2S6xEmUgXIcKpB7oNohO+Wx0cUmf95=+9uozHMBWE4kFhj+OOKw0I7w7HnwYfafhxsw0CmoOvorZztXk8whlh1d4U26z=aJ6JwH8wVBSszsRLQ+H4y3bRaeupq5Vo+smDfigjVVzCam4HoAdOKzN9MWiigl9Oi+4vTkSFFazc6HzyVaHg8luKGBJMhi2FNHTFO56RA\"  <\/pre>\n<p>Versus the key from the ransom note:<\/p>\n<pre>+4IAAAAAAADIGnmIHZL=FYRQCAN=AgKnzw+0uzFbXSR5AdFlfTrhWN9sifnho8LiX5=V8SbNVWyWWrdbTLipFEeeEv=9zLmnid8e<\/pre>\n<pre>UqlqKr2RUN=V7LdjoyNwjWMNbylRiGNAKWK6g9exeHhVfUrZ+9oRTq6Kp5eNe7kDdV7UMPVZ12=5pm9a+5lOMw==TNi2R2tUjFcK  tTD3c9IZgJwOMgcOw3fRrmgaloh5cIV3V74DRy2segx13RDL4J6B+gJnfT2mxIZuBE1G5HcmuLHCoqQif2BamhfbMASCUEpOp7+Z  G0jI=1PTmOhD3Yq4XjJWI4mc61AruRlaYqwPTUUbrsI0zTYX1mmM3Tvyso8bqDy4h5meyPYuXlgtRj06mtdrGZszb6ObsIT4Fz0O  Ag=4HgI4VSHA=HAU5yCjZzIIkLhlWGvdAk  <\/pre>\n<p>The key used to encrypt changes from file to file. Meaning that two files with identical content will be different after encryption. Essentially what happens is that there is a initial key and many sub keys are derived from that key. If just a single encryption key was used for all of the files (which has been seen with other ransomware), you would be able to capture memory at any point in the encryption process, save the key, and use it to decrypt all of the files on your hard drive. Unfortunately, because of this key cycling that Scarab performs, it makes decryption of the files likely impossible.<\/p>\n<p>After full disk encryption is complete, the ransomware proceeds to a call function that enumerates all network folders and drives. For example: VMWare shared folders, Terminal services, Network Drives. If any are found, it encrypts the files within those folder as well.<\/p>\n<p>Once complete, it opens the encryption message via notepad.exe.<\/p>\n<h3 style=\"text-align: left;\">Rumors<\/h3>\n<p>There have been a number of articles we&#8217;ve come across online that state that Scarabey has the ability to act as a backdoor, allowing remote access, and also may gather sensitive data. From our analysis, we believe this to be untrue. We found no signs of any other functionality aside from simply encrypting files on user&#8217;s computer.<\/p>\n<p>Additionally, there were rumors of Scarab being built off of the open source ransomware project on gitHub called HiddenTear. We have confirmed this to be untrue in both our own research and with external researchers. It seems to be an industry consensus now that it was mistakenly posted.<\/p>\n<p>Malwarebytes for Windows detects this threat and its variant as:\u00a0<strong>Ransom.Scarab<\/strong>.<\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/01\/scarab-ransomware-new-variant-changes-tactics\/\">Scarab ransomware: new variant changes tactics<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/01\/scarab-ransomware-new-variant-changes-tactics\/\" target=\"bwo\" >https:\/\/blog.malwarebytes.com\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: vhioureas| Date: Wed, 31 Jan 2018 22:28:22 +0000<\/strong><\/p>\n<table cellpadding='10'>\n<tr>\n<td valign='top' align='center'><a href='https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/01\/scarab-ransomware-new-variant-changes-tactics\/' title='Scarab ransomware: new variant changes tactics'><img src='https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/shutterstock_708068020.jpg' border='0'  width='300px'  \/><\/a><\/td>\n<\/tr>\n<tr>\n<td valign='top' align='left'>We&#8217;ve found that a variant of the Scarab ransomware, called Scarabey, is distributed via a different technique, with a different payload code, and a new target: Russia.<\/p>\n<p>Scarabey, like most ransomware, is designed to demand a Bitcoin payment from its victims after encrypting files on their systems. However, instead of being distributed via Necurs malspam like the original Scarab, Scarabey was found targeting Russian users and being distributed via RDP\/manual dropping on servers and systems.<\/p>\n<p>Categories: <\/p>\n<ul class=\"post-categories\">\n<li><a href=\"https:\/\/blog.malwarebytes.com\/category\/threat-analysis\/malware-threat-analysis\/\" rel=\"category tag\">Malware<\/a><\/li>\n<li><a href=\"https:\/\/blog.malwarebytes.com\/category\/threat-analysis\/\" rel=\"category tag\">Threat analysis<\/a><\/li>\n<\/ul>\n<p>Tags: <a href=\"https:\/\/blog.malwarebytes.com\/tag\/necurs-malspam\/\" rel=\"tag\">Necurs malspam<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/ransomware\/\" rel=\"tag\">ransomware<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/ransomware-variant\/\" rel=\"tag\">ransomware variant<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/scarab\/\" rel=\"tag\">Scarab<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/scarabey\/\" rel=\"tag\">scarabey<\/a><\/p>\n<table width='100%'>\n<tr>\n<td align=right>\n<p><b>(<a href='https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/01\/scarab-ransomware-new-variant-changes-tactics\/' title='Scarab ransomware: new variant changes tactics'>Read more&#8230;<\/a>)<\/b><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<\/table>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/01\/scarab-ransomware-new-variant-changes-tactics\/\">Scarab ransomware: new variant changes tactics<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/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":[10488,10378],"tags":[3764,17369,3765,17370,17371,17372,10494],"class_list":["post-11327","post","type-post","status-publish","format-standard","hentry","category-malwarebytes","category-security","tag-malware","tag-necurs-malspam","tag-ransomware","tag-ransomware-variant","tag-scarab","tag-scarabey","tag-threat-analysis"],"_links":{"self":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/11327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=11327"}],"version-history":[{"count":0,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/11327\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=11327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=11327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=11327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}