{"id":11317,"date":"2018-01-30T16:10:03","date_gmt":"2018-01-31T00:10:03","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2018\/01\/30\/news-5088\/"},"modified":"2018-01-30T16:10:03","modified_gmt":"2018-01-31T00:10:03","slug":"news-5088","status":"publish","type":"post","link":"https:\/\/www.palada.net\/index.php\/2018\/01\/30\/news-5088\/","title":{"rendered":"GandCrab ransomware distributed by RIG and GrandSoft exploit kits"},"content":{"rendered":"<p><strong>Credit to Author: Malwarebytes Labs| Date: Tue, 30 Jan 2018 23:43:52 +0000<\/strong><\/p>\n<p><em>This post was authored by Vasilios Hioueras and J\u00e9r\u00f4me Segura<\/em><\/p>\n<p>Late last week saw the appearance of a new ransomware called GandCrab. Surprisingly, it is distributed via two exploit kits: RIG EK and GrandSoft EK.<\/p>\n<p>Why is this surprising? Other than Magnitude EK, which is known to consistently push the <a href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2017\/10\/magniber-ransomware-exclusively-for-south-koreans\/\" target=\"_blank\" rel=\"noopener\">Magniber ransomware<\/a>, other exploit kits have this year mostly\u00a0dropped other payloads, such as Ramnit or SmokeLoader, typically followed by RATs and coin miners.<\/p>\n<p>Despite a bit of a slowdown in ransomware growth towards the last quarter of 2017, it remains a tried and tested business that guarantees threat actors a substantial source of revenue.<\/p>\n<h3>Distribution<\/h3>\n<p>GandCrab was first <a href=\"https:\/\/twitter.com\/CryptoInsane\/status\/956803455833853952\" target=\"_blank\" rel=\"noopener\">spotted<\/a> on Jan 26 and later identified in exploit kit campaigns.<\/p>\n<p><strong>RIG exploit kit<\/strong><\/p>\n<p>The well-documented Seamless gate appears to have diversified itself as of late with distinct threads pushing a specific payload. While Seamless is notorious for having <a href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2017\/12\/seamless-campaign-caught-using-punycode\/\" target=\"_blank\" rel=\"noopener\">switched to International Domain Names<\/a> (IDNs) containing characters from the Russian alphabet, we have also discovered a standard domain name in a different malvertising chain. (Side note: that same chain is also used to redirect to the Magnitude exploit kit.)<\/p>\n<p>We observed the same filtering done upstream, which will filter out known IPs, while the <em>gav[0-9].php<\/em> step is a more surefire way to get the redirection to RIG EK.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/RIG.png\" data-rel=\"lightbox-0\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21358\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/RIG.png\" alt=\"\" width=\"706\" height=\"304\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/RIG.png 706w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/RIG-300x129.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/RIG-600x258.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/RIG-195x85.png 195w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/a><\/p>\n<p>At the moment, only the <a href=\"https:\/\/twitter.com\/nao_sec\/status\/956924254376812544\" target=\"_blank\" rel=\"noopener\"><em>gav4.php<\/em><\/a>\u00a0flow is used to spread this ransomware.<\/p>\n<p><strong>GrandSoft exploit kit<\/strong><\/p>\n<p>This exploit kit is an oldie, far less common, and thought to have <a href=\"https:\/\/github.com\/MISP\/misp-galaxy\/blob\/master\/clusters\/exploit-kit.json\" target=\"_blank\" rel=\"noopener\">disappeared<\/a>. Yet it was <a href=\"https:\/\/twitter.com\/kafeine\/status\/958298409944920064\" target=\"_blank\" rel=\"noopener\">discovered<\/a> that it too was used to redistribute GandCrab.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GrandSoft.png\" data-rel=\"lightbox-1\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-21357 alignnone\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GrandSoft.png\" alt=\"\" width=\"800\" height=\"611\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GrandSoft.png 800w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GrandSoft-300x229.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GrandSoft-600x458.png 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>GrandSoft EK&#8217;s landing page is not obfuscated and appears to be using similar functions found in other exploit kits.<\/p>\n<h3>Ransom note<\/h3>\n<p>Interestingly, GandCrab is not demanding payment in the popular Bitcoin currency, but rather a lesser-known cryptocurrency called Dash. this is another sign that threat actors are going for currencies that offer more anonymity and may have lower transaction fees than BTC.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GanCrab.png\" target=\"_blank\" rel=\"noopener\" data-rel=\"lightbox-2\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21359\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GanCrab.png\" alt=\"\" width=\"1191\" height=\"923\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GanCrab.png 1191w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GanCrab-300x232.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/GanCrab-600x465.png 600w\" sizes=\"auto, (max-width: 1191px) 100vw, 1191px\" \/><\/a><\/p>\n<h3>Technical analysis<\/h3>\n<p>After unpacking, the binary is pretty straight forward as far as analysis is concerned. There were no attempts to obfuscate data or code beyond just the first layer of the packer. Everything from the exclusion file types to web request variables, URLs, list of AVs\u2014even the whole ransom message\u2014is in plain text within the data section. On initial look-through, you can deduce what some of the functionality might be just by simply looking at the strings of the binary.<\/p>\n<p>The code flow stays relatively inline, so as far as reverse engineering is concerned, it allows you to quite accurately analyze it even just statically in a disassembler. The code is divided up into three main segments: <strong>initialization, network, <\/strong>and<strong>\u00a0encryption.<\/strong><\/p>\n<p><strong>Initialization<\/strong><\/p>\n<p>After unpacking, GranCrab starts out with a few functions whose tasks are to set up some information to be used later in the code. It queries information about the user such as:<\/p>\n<ul>\n<li>username<\/li>\n<li>keyboard type<\/li>\n<li>computer name<\/li>\n<li>presence of antivirus<\/li>\n<li>processor type<\/li>\n<li>IP<\/li>\n<li>OS version<\/li>\n<li>disk space<\/li>\n<li>system language<\/li>\n<li>active drives<\/li>\n<li>locale<\/li>\n<li>current Windows version<\/li>\n<li>processor architecture<\/li>\n<\/ul>\n<p>It specifically checks if the keyboard layout is Russian, writes out an integer representation for that result, and builds a string with all this info. Below is the code that is starting to write out the variable names to label the information gathered:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21339\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/1.png\" alt=\"\" width=\"1688\" height=\"660\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/1.png 1688w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/1-300x117.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/1-600x235.png 600w\" sizes=\"auto, (max-width: 1688px) 100vw, 1688px\" \/><\/p>\n<p>It then cycles through all letters of the alphabet querying if a drive exists and what type it is. If it is a CDRom, unknown, or non existent, it skips it. If a fixed drive is found, it copies its name to a buffer and copies a string describing what type of drive it is. For example, the C: drive is\u00a0FIXED.<\/p>\n<p>It then gets disk free space and information on sectors that it converts into another series of numbers via <em>printf<\/em> function tokens:\u00a0C:FIXED_64317550592. It continues this for every drive and builds a list.<\/p>\n<p>It puts all of the information gathered on the system together and\u00a0you can assume, before you even get to this point in the code, that this will be sent up to a C2 server at some point, as it is in the format of a GET request. Here is an example of how the system info gets structured below:<\/p>\n<pre><u>ip<\/u>=99.8.160.100&amp;<u>pc_user<\/u>=virusLab&amp;<u>pc_name<\/u>=VI<\/pre>\n<p>It also searches running processes, checking against a finite set of antivirus programs that will also be converted to the info string for the C2 server.<\/p>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21336\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-29-at-12.04.15-PM.png\" alt=\"\" width=\"1534\" height=\"384\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-29-at-12.04.15-PM.png 1534w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-29-at-12.04.15-PM-300x75.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/Screen-Shot-2018-01-29-at-12.04.15-PM-600x150.png 600w\" sizes=\"auto, (max-width: 1534px) 100vw, 1534px\" \/><\/h6>\n<p>It then proceeds to create a mutex with some system info along with a generated ID. For example:<\/p>\n<pre>Globalpc_group=WORKGROUP&amp;ransom_id=c9ed65de824663f<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21340\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/2.png\" alt=\"\" width=\"2040\" height=\"970\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/2.png 2040w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/2-300x143.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/2-600x285.png 600w\" sizes=\"auto, (max-width: 2040px) 100vw, 2040px\" \/><\/p>\n<p>In order to initialize itself for the future encryption, it cycles through a hardcoded list of processes to kill. This is a common technique among ransomware that attempts to kill processes that might have a lock on certain files, which it would like to encrypt.<\/p>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21341\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/3.png\" alt=\"\" width=\"1886\" height=\"1138\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/3.png 1886w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/3-300x181.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/3-600x362.png 600w\" sizes=\"auto, (max-width: 1886px) 100vw, 1886px\" \/><\/h6>\n<h6>KEY PROCESS LIST:<br \/> msftesql.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 sqlagent.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0sqlbrowser.exe<br \/> sqlservr.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0sqlwriter.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0oracle.exe<br \/> ocssd.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0dbsnmp.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 synctime.exe<br \/> mydesktopqos.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0agntsvc.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0isqlplussvc.exe<br \/> xfssvccon.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0mydesktopservice.exe\u00a0 \u00a0 \u00a0 \u00a0ocautoupds.exe<br \/> agntsvc.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0agntsvc.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0agntsvc.exe<br \/> encsvc.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 firefoxconfig.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 tbirdconfig.exe<br \/> ocomm.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 mysqld.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 mysqld-nt.exe<br \/> mysqld-opt.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0dbeng50.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 sqbcoreservice.exe<br \/> excel.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 infopath.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0msaccess.exe<br \/> mspub.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 onenote.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 outlook.exe<br \/> powerpnt.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 steam.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0thebat.exe<br \/> thebat64.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 thunderbird.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 visio.exe<br \/> winword.exe\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0wordpad.exe<\/h6>\n<p>Next, it calls the built-in crypto functions to generate keys. GandCrab generates the public and private keys on the client side and uses the standard Microsoft crypto libraries available using API calls from <em>Advapi32.dll<\/em>. It calls <em>CryptGenKey<\/em> with the RSA algorithm.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21343\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/5.png\" alt=\"\" width=\"1894\" height=\"1136\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/5.png 1894w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/5-300x180.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/5-600x360.png 600w\" sizes=\"auto, (max-width: 1894px) 100vw, 1894px\" \/><\/p>\n<p><strong>Network connection<\/strong><\/p>\n<p>Now it enters the main <em>loop<\/em> for the Internet functionality portion of the ransomware. This area of code either succeeds and continues to the encryption section of code, or it loops again and again attempting to succeed. If it never succeeds, it will never encrypt any file.<\/p>\n<p>This section starts off by making a <em>GET<\/em> request to\u00a0<em>ipv4bot.whatismyipaddress.com <\/em>that saves the IP address returned and adds to the <em>GET<\/em> request string, which has been built with the system information.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21345\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/6.png\" alt=\"\" width=\"1944\" height=\"830\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/6.png 1944w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/6-300x128.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/6-600x256.png 600w\" sizes=\"auto, (max-width: 1944px) 100vw, 1944px\" \/><\/p>\n<p>It continues and takes a binary chunk, which is the RSA public key that was stored earlier in the initialization. That key is converted to base64 via the <em>CryptBinaryToStringA<\/em> API with the following parameters:<\/p>\n<pre><strong>CRYPT_STRING_NOCRLF\u00a0 and CRYPT_STRING_BASE64<\/strong><\/pre>\n<p>It will be tacked on the the existent <em>GET<\/em> string, which it has been building this whole time. Below is an example of the RSA key generated in binary and its conversion, followed by the finalized <em>GET<\/em> string with the base64 of the keys in it:<\/p>\n<h6>This is an example of an RSA public key generated with the crypto APIs:<br \/> A7 EC BD E2 49 43 E1 11 DA 12 10 E0 25 59 AA 83 77 35 FC 3E 49 C8 3B 6C 3D 91 CF FF 96 6E D8 45 FE 8A 58 20 E6 CB 91 AB 99 6A E2 04 EC 58 66 95 05 8C 2F 7E C6 19 6D 24 B5 5F C4 9A 01 3D 3B FB 31 4E AC 25 07 8C 0E 6C 57 4C C0 23 24 3A EB 57 97 17 79 F8 62 73 6B AD B2 09 60 BB B7 9A CF F9 5B 68 B8 C1 44 07 F5 5E 3E 06 FE C2 35 CF 99 82 29 28 37 1B E6 51 29 6C 0B 87 89 F9 90 26 F7 CC DA 75 C4 46 A1 E3 30 09 C0 6A CB 5E CB 87 8E 40 EF 4C 7E 02 AE E8 06 6A D7 24 FC 0E 40 EA 69 CD 6D 8D 24 92 6E 53 2F D2 69 D2 A2 F3 97 54 63 EB D9 C7 BD 9E 41 19 91 F1 6B D6 CA AD 9E 0E D3 0B A0 53 50 84 87 6D 49 4C 49 D2 3B 8E 80 F7 7F 35 F1 D7 A7 81 0F 90 04 40 AC 4B 7C ED 37 71 8A B1 FA 84 33 33 FB 62 EE 04 A3 C7 9A 47 2C 64 64 95 3D 34 A5 CC 12 6E E4 81 40 E6 7F 03 02 C4 57 D6<\/h6>\n<p>Which gets converted to:<\/p>\n<pre>BgIAAACkAABSU0ExAAgAAAEAAQCn7L3iSUPhEdoSEOAlWaqDdzX8PknIO2w9kc\/\/lm7YRf6KWCDmy5GrmWriBOxYZpUFjC9+xhltJLVfxJoBPTv7MU6sJQeMDmxXTMAjJDrrV5cXefhic2utsglgu7eaz\/lbaLjBRAf1Xj4G\/sI1z5mCKSg3G+ZRKWwLh4n5kCb3zNp1xEah4zAJwGrLXsuHjkDvTH4CrugGatck\/A5A6mnNbY0kkm5TL9Jp0qLzl1Rj69nHvZ5BGZHxa9bKrZ4O0wugU1CEh21JTEnSO46A93818dengQ+QBECsS3ztN3GKsfqEMzP7Yu4Eo8eaRyxkZJU9NKXMEm7kgUDmfwMCxFfW<\/pre>\n<p>And builds the <em>GET<\/em> string to send to the C2 with all the system information from earlier, and also the encryption keys:<\/p>\n<pre><u>action<\/u>=call&amp;<u>ip<\/u>=99.8.160.100&amp;<u>pc_user<\/u>=virusLab&amp;<u>pc_name<\/u>=VIRUSLAB-PC&amp;<u>pc_group<\/u>=WORKGROUP&amp;<u>pc_lang<\/u>=en-US&amp;<u>pc_keyb<\/u>=0&amp;<u>os_major<\/u>=Windows 7 Enterprise&amp;<u>os_bit<\/u>=x64&amp;<u>ransom_id<\/u>=c9ed65de824663fc&amp;<u>hdd<\/u>=C:FIXED_64317550592\/50065174528&amp;<u>pub_key<\/u>=BgIAAACkAABSU0ExAAgAAAEAAQCn7L3iSUPhEdoSEOAlWaqDdzX8PknIO2w9kc\/\/lm7YRf6KWCDmy5GrmWriBOxYZpUFjC9+xhltJLVfxJoBPTv7MU6sJQeMDmxXTMAjJDrrV5cXefhic2utsglgu7eaz\/lbaLjBRAf1Xj4G\/sI1z5mCKSg3G+ZRKWwLh4n5kCb3zNp1xEah4zAJwGrLXsuHjkDvTH4CrugGatck\/A5A6mnNbY0kkm5TL9Jp0qLzl1Rj69nHvZ5BGZHxa9bKrZ4O0wugU1CEh21JTEnSO46A93818dengQ+QBECsS3ztN3GKsfqEMzP7Yu4Eo8eaRyxkZJU9NKXMEm7kgUDmfwMCxFfW   &amp;<u>priv_key<\/u>=BwIAAACkAABSU0EyAAgAAAEAAQCn7L3iSUPhEdoSEOAlWaqDdzX8PknIO2w9kc\/\/lm7YRf6KWCDmy5GrmWriBOxYZpUFjC9+xhltJLVfxJoBPTv7MU6sJQeMDmxXTMAjJDrrV5cXefhic2utsglgu7eaz\/lbaLjBRAf1Xj4G\/sI1z5mCKSg3G+ZRKWwLh4n5kCb3zNp1xEah4zAJwGrLXsuHjkDvTH4CrugGatck\/A5A6mnNbY0kkm5TL9Jp0qLzl1Rj69nHvZ5BGZHxa9bKrZ4O0wugU1CEh21JTEnSO46A93818dengQ+QBECsS3ztN3GKsfqEMzP7Yu4Eo8eaRyxkZJU9NKXMEm7kgUDmfwMCxFfWGRZmQmHH5W5K1RYgSg8VJEFLebRW8+o7X0K30wzzrw5NHpJpVJYX8OKot8KvopS4wsZzuxu5YJih1ZYVgF6QT5FW4WEG3BzMtq5vGVqTmrlckudC0xfGlGb7J41vUkZsp6S07NTIIT7HtYJSA\/pxS51Zg+13TfU0nxC92RkKuva\/8Dzmgssm6uE7aYJQFEkUmkPImYreHGIPsffEEGtZM9zwz4tXbrXLch0BoRNHeR+GFLJclnLc5JMg\/J4BLaS6js+RGxRbZGMPJDVX6lTEEl+aIYO38Wh49+Zcpzs4EOUfb1EsoLEDAZbppIWq8Yr1P6KtWkqIXRzjUk9HXiJm3qHm0u0vchV4iRAKz2MJ\/xZdYjHp+C3qMTTsNbQbtcscpy13\/rEv8oO6clfciSCPcthy5IkLFLKZQP5be+IcsAjxeSoOqqtEpNpj8nOKfZ5PvEs+\/kn718vG0R5CMU4I0fyF0BD68AFat6dl5gHK1sKs0ndAvCKdDMg\/HqO\/JKUZRSza2VKkgxpXC57BRGNP0r\/jYySGnqhE2owHQaXoEmP9tme1A8PHsAoNtUEd0SO4\/pn4hDg70o\/Nmph\/UWqtOq9nSlrxQMD8Q08w4K2H1CC3eCAnHZOM8PTCDYH3nh6f\/ftkVtyrpudTpicTjoUSEkwtEPRsWk7ff3F\/Na8D2FcXSI5xQ6R+R2uy8GvVoxpBy8Xdh78VqViOBlu5+Jxp09PMQmI2EFususg4VJeH047Wayi2r+VemzAX1rTuMh2mRKfKa+eae+YBKjBUkIh9WPCmFjO+3lll7GqV7P4JFm1g2sjrm\/dPWnoGzfg1E7brER6aD2q+w1+4o8wCzNTNvPH2bwPMyV6R+vbWOVZUTprzZ4sRr7KxT0ucZmNA76WX39NegSU56tOngYpAQprOMrJP0NYmrizT8FsCOcqlUGk0jf6moarJSWQxh2MxXtlpFAvJjPTqqKruIVMhIkTJ9aZHKnn02a5PIdLcs4a09D85js9klKZn90Gj6C4AxlT2nI\/ba9mEx+7srvxxbh1XNgI987IWLsLYpWxHlRptJqIvI0ZAA3EuvwZuZ8f6sqLM2\/rSxdOnFW5hd8am9zgopimktfkjFtsHpev\/Svf0VlxQ3Fj22A06aXqfi7hmWPZ8ZCtZ874PUHgbrG3foNESQiTghT2NLV9rNNad7ij\/kVA=   &amp;<u>version<\/u>=1.0<\/pre>\n<h6>[Crypto key base 64 functions]<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21346\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/8.png\" alt=\"\" width=\"2026\" height=\"1018\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/8.png 2026w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/8-300x151.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/8-600x301.png 600w\" sizes=\"auto, (max-width: 2026px) 100vw, 2026px\" \/><\/h6>\n<h6>[Section of code that is adding the encoded keys to the get string under priv_key parameter]<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21347\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/9.png\" alt=\"\" width=\"1548\" height=\"1114\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/9.png 1548w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/9-300x216.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/9-600x432.png 600w\" sizes=\"auto, (max-width: 1548px) 100vw, 1548px\" \/><\/h6>\n<p>At this point, it is clear that the malware will be sending this info to the C2 server. This is interesting because it may be possible to pull the keys from memory and use them for the decryption of files.<strong style=\"font-size: 16px\">\u00a0<\/strong><span style=\"font-size: 16px\">We will continue to investigate this and update the article if any discoveries are found.<\/span><\/p>\n<p>GandCrab&#8217;s server is hosted on a <em>.bit<\/em> domain, and therefore it has to query a name server that supports this TLD. It does this by querying for the addresses of the following domains using the command:<\/p>\n<pre>nslookup\u00a0[insert domain]\u00a0\u00a0a.dnspod.com.<\/pre>\n<p>This command\u00a0queries the <em>a.dnspod.com<\/em> name server, which support the .bit TLD for one of the domains below.<\/p>\n<pre>bleepingcomputer.bit  nomoreransom.bit  esetnod32.bit  emsisoft.bit  gandcrab.bit<\/pre>\n<p>The <em>NSlookup<\/em> child process is opened through a pipe that was created. This is done so that a child process can directly affect the memory in the parent process, rather than transferring outputs manually back and forth. It is an interesting and useful technique. You can look at the following section of code for more details:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21355\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/17.png\" alt=\"\" width=\"1666\" height=\"1110\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/17.png 1666w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/17-300x200.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/17-600x400.png 600w\" sizes=\"auto, (max-width: 1666px) 100vw, 1666px\" \/><\/p>\n<p>The ransomware now attempts to send data to the server, and if an error occurs or the server was not reachable, it continues this whole process in an infinite loop until it finds one that works, re-querying for client IP and running <em>nslookup<\/em> again and again with different IP outputs. Unless it connects with the server, it will run until it is closed manually.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21348\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/10.png\" alt=\"\" width=\"2064\" height=\"1144\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/10.png 2064w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/10-300x166.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/10-600x333.png 600w\" sizes=\"auto, (max-width: 2064px) 100vw, 2064px\" \/><\/p>\n<p>As mentioned before, it will not continue to the encryption routine until it finds a server, which means it will enter in an infinite loop of IP requests:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21344\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/7.png\" alt=\"\" width=\"1666\" height=\"740\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/7.png 1666w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/7-300x133.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/7-600x267.png 600w\" sizes=\"auto, (max-width: 1666px) 100vw, 1666px\" \/><\/p>\n<p>Once it finds one of these, it continues to open a thread that will start the main encryption functionality. However, before it begins, it opens another thread that creates a window and labels itself as Firefox.The window is loaded with code that will copy itself to the <em>temp<\/em> directory and set itself up in the registry. This is actually one of the few parts of the malware that is not taken directly from plain text. The file name copy of itself is a random series of letters generated by calling the\u00a0<em>cryptGenRandom<\/em> function, and using its output on an array of letters.<\/p>\n<p>The strange part about this function is not what it does, because it is creating persistence that we had been waiting for, but rather why a window was created in the first place. As far as we could understand, there is no benefit of launching a window to perform these tasks. Maybe it was experiment on the part of the author, but the intent remains unclear.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21354\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/15.png\" alt=\"\" width=\"1948\" height=\"778\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/15.png 1948w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/15-300x120.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/15-600x240.png 600w\" sizes=\"auto, (max-width: 1948px) 100vw, 1948px\" \/><\/p>\n<h4>Encryption routine<\/h4>\n<p>As we have established from the initialization section of the malware, the encryption algorithm used is RSA. Before we get the encryption section, the code makes sure that it is not encrypting specific types of files that it considers protected. The files are the following, hard coded into the malware:<\/p>\n<pre>desktop.ini  autorun.inf  ntuser.dat  iconcache.db  bootsect.bak  boot.ini  ntuser.dat  thumbs.db  GDCB-DECRYPT.txt  .sql<\/pre>\n<p>If it finds that the file name is on that list, it will skip it and continue to the next. It also skips looking into a folder if it is one of these key folders:<\/p>\n<pre>local app data  windows  programfiles  program data  ransomware  localsettings<\/pre>\n<p>When it passes these checks and gets to a specific file, it runs one final check on the extension against a list of acceptable file extensions to be encrypted:<\/p>\n<h6><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21349\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/14.png\" alt=\"\" width=\"2266\" height=\"594\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/14.png 2266w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/14-300x79.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/14-600x157.png 600w\" sizes=\"auto, (max-width: 2266px) 100vw, 2266px\" \/><\/h6>\n<p>If all checks pass, it proceeds to use the previously generated keys along with some salt and random number generated to encrypt the file and rename it with a .GDCB extension. The main encryption loop is a recursive function that will eventually make it to every file on the drive.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21350\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/11.png\" alt=\"\" width=\"1338\" height=\"512\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/11.png 1338w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/11-300x115.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/11-600x230.png 600w\" sizes=\"auto, (max-width: 1338px) 100vw, 1338px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21351\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/12.png\" alt=\"\" width=\"1560\" height=\"988\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/12.png 1560w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/12-300x190.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/12-600x380.png 600w\" sizes=\"auto, (max-width: 1560px) 100vw, 1560px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21352\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/13.png\" alt=\"\" width=\"1640\" height=\"586\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/13.png 1640w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/13-300x107.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/13-600x214.png 600w\" sizes=\"auto, (max-width: 1640px) 100vw, 1640px\" \/><\/p>\n<h3>Protection<\/h3>\n<p>Malwarebytes users are protected at the delivery chain (exploit protection), but we also proactively stopped this ransomware before having seen it, thanks to our anti-ransomware engine:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21360\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/block.png\" alt=\"\" width=\"470\" height=\"240\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/block.png 470w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/block-300x153.png 300w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/p>\n<h3>Conclusion<\/h3>\n<p>It is interesting to see a new ransomware being distributed via exploit kits in what so far seems to be a few ongoing campaigns. The other interesting aspect is that two distinct exploit kits are delivering it, although it is unclear if the same actor is behind both campaigns and experimenting with different distribution channels.<\/p>\n<h3>Indicators of Compromise<\/h3>\n<p>Seamless gate<\/p>\n<pre>31.31.196.187,xn--80abmi5aecft.xn--p1acf<\/pre>\n<p>GrandSoft EK (IP)<\/p>\n<pre>62.109.4.135<\/pre>\n<p>GandCrab (packed)<\/p>\n<pre>69f55139df165bea1fcada0b0174d01240bc40bc21aac4b42992f2e0a0c2ea1d<\/pre>\n<p>GandCrab (unpacked)<\/p>\n<pre>ab0819ae61ecbaa87d893aa239dc82d971cfcce2d44b5bebb4c45e66bb32ec51<\/pre>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/01\/gandcrab-ransomware-distributed-by-rig-and-grandsoft-exploit-kits\/\">GandCrab ransomware distributed by RIG and GrandSoft exploit kits<\/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\/gandcrab-ransomware-distributed-by-rig-and-grandsoft-exploit-kits\/\" target=\"bwo\" >https:\/\/blog.malwarebytes.com\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: Malwarebytes Labs| Date: Tue, 30 Jan 2018 23:43:52 +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\/gandcrab-ransomware-distributed-by-rig-and-grandsoft-exploit-kits\/' title='GandCrab ransomware distributed by RIG and GrandSoft exploit kits'><img src='https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/01\/photo.jpg' border='0'  width='300px'  \/><\/a><\/td>\n<\/tr>\n<tr>\n<td valign='top' align='left'>Ransomware may have slowed its growth but is still a go-to payload for threat actors looking to monetize drive-by download attacks. The latest attempt: GandCrab ransomware.<\/p>\n<p>Categories: <\/p>\n<ul class=\"post-categories\">\n<li><a href=\"https:\/\/blog.malwarebytes.com\/category\/threat-analysis\/exploits-threat-analysis\/\" rel=\"category tag\">Exploits<\/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\/exploit-kits\/\" rel=\"tag\">exploit kits<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/gandcrab\/\" rel=\"tag\">gandcrab<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/gandcrab-ransomware\/\" rel=\"tag\">gandcrab ransomware<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/grandsoft\/\" rel=\"tag\">grandsoft<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/ransomware\/\" rel=\"tag\">ransomware<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/rig\/\" rel=\"tag\">RIG<\/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\/gandcrab-ransomware-distributed-by-rig-and-grandsoft-exploit-kits\/' title='GandCrab ransomware distributed by RIG and GrandSoft exploit kits'>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\/gandcrab-ransomware-distributed-by-rig-and-grandsoft-exploit-kits\/\">GandCrab ransomware distributed by RIG and GrandSoft exploit kits<\/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":[10528,10987,17363,17364,17365,3765,11589,10494],"class_list":["post-11317","post","type-post","status-publish","format-standard","hentry","category-malwarebytes","category-security","tag-exploit-kits","tag-exploits","tag-gandcrab","tag-gandcrab-ransomware","tag-grandsoft","tag-ransomware","tag-rig","tag-threat-analysis"],"_links":{"self":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/11317","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=11317"}],"version-history":[{"count":0,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/11317\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=11317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=11317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=11317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}