{"id":87604,"date":"2019-04-09T15:19:34","date_gmt":"2019-04-09T09:49:34","guid":{"rendered":"https:\/\/blogs_admin.quickheal.com\/?p=87604"},"modified":"2019-04-10T15:12:14","modified_gmt":"2019-04-10T09:42:14","slug":"jcry-ransomware-written-golang","status":"publish","type":"post","link":"https:\/\/www.quickheal.com\/blogs\/jcry-ransomware-written-golang\/","title":{"rendered":"JCry &#8211; A Ransomware written in Golang!"},"content":{"rendered":"<p>For\u00a0several months, QH Labs has been observing an upswing in ransomware activity. We found a new ransomware which is written in Go lang. Malware authors are finding it easy to write ransomware in Go lang rather than traditional programming languages.<\/p>\n<p>Infection of Jcry ransomware starts with a compromised website.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87605\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/update.html_.png\" alt=\"\" width=\"1077\" height=\"151\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/update.html_.png 1077w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/update.html_-300x42.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/update.html_-768x108.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/update.html_-650x91.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/update.html_-789x111.png 789w\" sizes=\"(max-width: 1077px) 100vw, 1077px\" \/><\/p>\n<p>As shown in the above image, malware author tries to impersonate users by pretending to be an update of Adobe flash player and download malware on the user\u2019s machine. Fig 1. contains a part of javascript hosted on the compromised domain, which downloads a malicious file from the given URL. Whenever an impersonated user clicks on the Update button and executes a malicious file with the intention of updating the flash player, malware starts its execution.<\/p>\n<figure id=\"attachment_87627\" aria-describedby=\"caption-attachment-87627\" style=\"width: 930px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87627\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_1_Update.html_-1.png\" alt=\"\" width=\"930\" height=\"716\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_1_Update.html_-1.png 930w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_1_Update.html_-1-300x231.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_1_Update.html_-1-768x591.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_1_Update.html_-1-507x390.png 507w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_1_Update.html_-1-789x607.png 789w\" sizes=\"(max-width: 930px) 100vw, 930px\" \/><figcaption id=\"caption-attachment-87627\" class=\"wp-caption-text\">Fig 1 : Part of malicious script.<\/figcaption><\/figure>\n<p><strong>Flow of Execution:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87625\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/flow_diagram-1.png\" alt=\"\" width=\"471\" height=\"495\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/flow_diagram-1.png 471w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/flow_diagram-1-285x300.png 285w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/flow_diagram-1-371x390.png 371w\" sizes=\"(max-width: 471px) 100vw, 471px\" \/><\/p>\n<p><strong><b>Technical Analysis:<\/b><\/strong><\/p>\n<p>Downloaded malware (flashplayer_install.exe) is Self-extracting archive. On execution, it will extract the below mentioned components in \u201cStartup\u201d directory to create its persistence.<\/p>\n<p>Components:<\/p>\n<ol>\n<li>msg.vbs<\/li>\n<li>Enc.exe<\/li>\n<li>Dec.exe<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87608\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/extracted_comp.png\" alt=\"\" width=\"775\" height=\"140\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/extracted_comp.png 775w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/extracted_comp-300x54.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/extracted_comp-768x139.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/extracted_comp-650x117.png 650w\" sizes=\"(max-width: 775px) 100vw, 775px\" \/><\/p>\n<figure id=\"attachment_87609\" aria-describedby=\"caption-attachment-87609\" style=\"width: 629px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87609\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_2_SFX_instructions.png\" alt=\"\" width=\"629\" height=\"126\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_2_SFX_instructions.png 629w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_2_SFX_instructions-300x60.png 300w\" sizes=\"(max-width: 629px) 100vw, 629px\" \/><figcaption id=\"caption-attachment-87609\" class=\"wp-caption-text\">Fig 2 : Extracted components and SFX instructions.<\/figcaption><\/figure>\n<p>As mentioned in the above figure malware extract components and starts msg.vbs along with enc.exe(Encryptor)<\/p>\n<p>msg.vbs:<\/p>\n<p>This file is used to impersonate the user that, the system tried to update adobe flash player but access is denied for the user.<\/p>\n<figure id=\"attachment_87610\" aria-describedby=\"caption-attachment-87610\" style=\"width: 246px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87610\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_3_msg.vbs_.png\" alt=\"\" width=\"246\" height=\"122\" \/><figcaption id=\"caption-attachment-87610\" class=\"wp-caption-text\">Fig 3 : Message shown by msg.vbs<\/figcaption><\/figure>\n<p>Enc.exe (Encryptor):<\/p>\n<p>This executable is responsible for file encryption and it is written in Go language.<\/p>\n<figure id=\"attachment_87611\" aria-describedby=\"caption-attachment-87611\" style=\"width: 877px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87611\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_4_Go_lang.png\" alt=\"\" width=\"877\" height=\"72\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_4_Go_lang.png 877w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_4_Go_lang-300x25.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_4_Go_lang-768x63.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_4_Go_lang-650x53.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_4_Go_lang-789x65.png 789w\" sizes=\"(max-width: 877px) 100vw, 877px\" \/><figcaption id=\"caption-attachment-87611\" class=\"wp-caption-text\">Fig 4 : Go Build ID and library strings of Go Lang found in file.<\/figcaption><\/figure>\n<p>On execution, it firstly checks for the existence of \u201cpersonalKey.txt\u201d file in the current directory, to determine that system is already infected or not. If the file exists then malware considers that the system is already infected and it terminates itself. As well as it deletes msg.vbs and Enc.exe with the help of decryptor file. During encryption, it uses the combination of AES and RSA algorithm. File encryption is performed using AES 128 bit algorithm with 16-byte initialization Vector in CBC mode. Hardcoded RSA public key is found in the enc.exe file which is later used to encrypt AES key.<\/p>\n<figure id=\"attachment_87612\" aria-describedby=\"caption-attachment-87612\" style=\"width: 686px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87612\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_5_Public_key.png\" alt=\"\" width=\"686\" height=\"255\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_5_Public_key.png 686w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_5_Public_key-300x112.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_5_Public_key-650x242.png 650w\" sizes=\"(max-width: 686px) 100vw, 686px\" \/><figcaption id=\"caption-attachment-87612\" class=\"wp-caption-text\">Fig 5 : RSA PUBLIC KEY<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_87613\" aria-describedby=\"caption-attachment-87613\" style=\"width: 1407px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87613\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_6_Crypto_Operation.png\" alt=\"\" width=\"1407\" height=\"394\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_6_Crypto_Operation.png 1407w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_6_Crypto_Operation-300x84.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_6_Crypto_Operation-768x215.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_6_Crypto_Operation-650x182.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_6_Crypto_Operation-789x221.png 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_6_Crypto_Operation-304x84.png 304w\" sizes=\"(max-width: 1407px) 100vw, 1407px\" \/><figcaption id=\"caption-attachment-87613\" class=\"wp-caption-text\">Fig 6: Acquire Context for Crypto operations.<\/figcaption><\/figure>\n<p>It encrypts the below listed 138 extension files.<\/p>\n<p>\u201c3dm, 3ds, 3g2, 3gp, 7z, ai, aif, apk, app, asf, asp, avi, b, bak, bin, bmp, c, cbr, cer, cfg, cfm, cgi, cpp, crx, cs, csr, css, csv, cue, dat, db, dbf, dcr, dds, deb, dem, der, dmg, dmp, doc, dtd, dwg, dxf, eps, fla, flv, fnt, fon, gam, ged, gif, gpx, gz, h, hqx, htm, ics, iff, iso, jar, jpg, js, jsp, key, kml, kmz, log, lua, m, m3u, m4a, m4v, max, mdb, mdf, mid, mim, mov, mp3, mp4, mpa, mpg, msg, msi, nes, obj, odt, otf, pct, pdb, pdf, php, pkg, pl, png, pps, ppt, ps, psd, py, rar, rm, rom, rpm, rss, rtf, sav, sdf, sh, sln, sql, srt, svg, swf, tar, tex, tga, thm, tif, tmp, ttf, txt, uue, vb, vcd, vcf, vob, wav, wma, wmv, wpd, wps, wsf, xlr, xls, xml, yuv, zip\u201d<\/p>\n<p>To speed up the encryption, it encrypts only 1MB data for files of size more than 1 MB. After successful file encryption it appends \u201c.jcry\u201d extension to the filename.<\/p>\n<figure id=\"attachment_87614\" aria-describedby=\"caption-attachment-87614\" style=\"width: 353px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87614\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_7_Encypted_Files.png\" alt=\"\" width=\"353\" height=\"176\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_7_Encypted_Files.png 353w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_7_Encypted_Files-300x150.png 300w\" sizes=\"(max-width: 353px) 100vw, 353px\" \/><figcaption id=\"caption-attachment-87614\" class=\"wp-caption-text\">Fig 7:Encrypted files with jcry Extension.<\/figcaption><\/figure>\n<p>After encryption of files, it deletes all shadow copies with the help of the below command.<\/p>\n<p><strong><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u201cvssadmin delete shadows \/all\u201d<\/b><\/strong><\/p>\n<p>and launch Dec.exe using Powershell command.<\/p>\n<figure id=\"attachment_87615\" aria-describedby=\"caption-attachment-87615\" style=\"width: 1395px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87615\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_8_powershell.png\" alt=\"\" width=\"1395\" height=\"90\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_8_powershell.png 1395w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_8_powershell-300x19.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_8_powershell-768x50.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_8_powershell-650x42.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_8_powershell-789x51.png 789w\" sizes=\"(max-width: 1395px) 100vw, 1395px\" \/><figcaption id=\"caption-attachment-87615\" class=\"wp-caption-text\">Fig 8: Vssadmin and PowerShell execution.<\/figcaption><\/figure>\n<p>Dec.exe:<\/p>\n<p>On execution of Dec.exe firstly it terminates and deletes enc.exe. Dec.exe is console application which asks the decryption key (RSA private key). After entering valid key it may decrypt encrypted files.<\/p>\n<figure id=\"attachment_87616\" aria-describedby=\"caption-attachment-87616\" style=\"width: 655px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87616\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_9_Dec.exe_.png\" alt=\"\" width=\"655\" height=\"348\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_9_Dec.exe_.png 655w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_9_Dec.exe_-300x159.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_9_Dec.exe_-650x345.png 650w\" sizes=\"(max-width: 655px) 100vw, 655px\" \/><figcaption id=\"caption-attachment-87616\" class=\"wp-caption-text\">Fig 9 : Dec.exe.<\/figcaption><\/figure>\n<p>It also drops ransom note on desktop location. To recover encrypted files it demands for 500$ as ransom and provides onion link (hxxp:\/\/kpx5wgcda7ezqjty.onion) where infected user will get private key after payment.<\/p>\n<figure id=\"attachment_87617\" aria-describedby=\"caption-attachment-87617\" style=\"width: 995px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87617\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2019\/04\/Fig_10_Ransom_Note.png\" alt=\"\" width=\"995\" height=\"170\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_10_Ransom_Note.png 995w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_10_Ransom_Note-300x51.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_10_Ransom_Note-768x131.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_10_Ransom_Note-650x111.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2019\/04\/Fig_10_Ransom_Note-789x135.png 789w\" sizes=\"(max-width: 995px) 100vw, 995px\" \/><figcaption id=\"caption-attachment-87617\" class=\"wp-caption-text\">Fig 10: Ransom Note.<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p><strong>IOCs:<\/strong><\/p>\n<p>flashplayer_install.exe: c86c75804435efc380d7fc436e344898<br \/>\nEnc.exe : 5B640BE895C03F0D7F4E8AB7A1D82947<br \/>\nDec.exe : 6B4ED5D3FDFEFA2A14635C177EA2C30D<br \/>\nRecovery Link: hxxp:\/\/kpx5wgcda7ezqjty.onion<br \/>\nWallet Id: 1FKWhzAeNhsZ2JQuWjWsEeryR6TqLkKFUt<\/p>\n<p><strong><b>Prevention tips<\/b><\/strong><\/p>\n<ol>\n<li>Regularly take a backup of your important data in external drives like HDD, pen drive or Cloud storage.<\/li>\n<li>Install an antivirus and keep it updated.<\/li>\n<li>Keep your Operating System and software up-to-date.<\/li>\n<li>Never click on links or download attachments from any unknown or unwanted sources.<\/li>\n<\/ol>\n<p><strong>Subject Matter Expert:<\/strong><\/p>\n<p>Nagesh lathakar, Pratik Pachpor | Quick Heal Security Labs<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For\u00a0several months, QH Labs has been observing an upswing in ransomware activity. We found a new ransomware which is written in Go lang. Malware authors are finding it easy to write ransomware in Go lang rather than traditional programming languages. Infection of Jcry ransomware starts with a compromised website. As shown in the above image, [&hellip;]<\/p>\n","protected":false},"author":51,"featured_media":87619,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70,24,910],"tags":[294,77,49,50],"class_list":["post-87604","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-adobe","category-malware","category-ransomware","tag-adobe-flash-player","tag-drive-by-download","tag-malware","tag-ransomware"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/87604"}],"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\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/comments?post=87604"}],"version-history":[{"count":8,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/87604\/revisions"}],"predecessor-version":[{"id":87628,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/87604\/revisions\/87628"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media\/87619"}],"wp:attachment":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media?parent=87604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/categories?post=87604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/tags?post=87604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}