{"id":6313,"date":"2017-01-23T15:50:18","date_gmt":"2017-01-23T23:50:18","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2017\/01\/23\/news-151\/"},"modified":"2017-01-23T15:50:18","modified_gmt":"2017-01-23T23:50:18","slug":"news-151","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2017\/01\/23\/news-151\/","title":{"rendered":"JavaScript-toting spam emails: What should you know and how to avoid them?"},"content":{"rendered":"<p>We have recently observed that spam campaigns are now using JavaScript attachments aside from Office files. The purpose of the code is straightforward. It downloads and runs other malware.<\/p>\n<p>Some of the JavaScript downloaders that we\u2019ve seen are:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/Entry.aspx?Name=TrojanDownloader:JS\/Swabfex\">TrojanDownloader:JS\/Swabfex<\/a><\/li>\n<li><a href=\"https:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/Entry.aspx?Name=TrojanDownloader:JS\/Nemucod\">TrojanDownloader:JS\/Nemucod<\/a><\/li>\n<li><a href=\"https:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/Entry.aspx?Name=TrojanDownloader:JS\/Locky.A\">TrojanDownloader:JS\/Locky<\/a><\/li>\n<\/ul>\n<p>The same JavaScript downloaders are also responsible for spreading the following ransomware:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/Entry.aspx?Name=Ransom:Win32\/Tescrypt\">Ransom:Win32\/Tescrypt<\/a><\/li>\n<li><a href=\"https:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/Entry.aspx?Name=Ransom:Win32\/Locky.A\">Ransom:Win32\/Locky<\/a><\/li>\n<\/ul>\n<p>The spam email contains a <em>.zip<\/em> or <em>.rar<\/em> file attachment which carries a malicious JavaScript. The JavaScript attachment mostly has the following icon, depending on the system\u2019s script software. The file names are either related to the spam campaign, or completely random:<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6743\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS1.png\" alt=\"JS1\" width=\"266\" height=\"124\" \/><\/a><\/p>\n<p><em>Figure 1: Examples of JavaScript attachments from spam email campaigns<\/em><\/p>\n<h2>Not your favorite Java<\/h2>\n<p>Just like a typical email campaign, the JavaScript-toting spam finds its way in your PC after a successful social engineering trick. In bag of tricks are attachment file names intentionally crafted to pique any person\u2019s curiosity (finance-related, etc.).<\/p>\n<p>The JavaScript attachments are heavily-obfuscated to avoid antivirus software detections. It consists of a download and execute function paired with one or two URLs hosting the malware.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6744\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS2.png\" alt=\"JS2\" width=\"723\" height=\"244\" \/><\/a><\/p>\n<p><em>Figure 2: Sample code and URL <\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6751\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS3.png\" alt=\"JS3\" width=\"724\" height=\"311\" \/><\/a><\/p>\n<p><em>Figure 3: Another code sample<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6754\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS4.png\" alt=\"JS4\" width=\"726\" height=\"318\" \/><\/a><\/p>\n<p><em>Figure 4: Another code sample<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6763\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS5.png\" alt=\"JS5\" width=\"724\" height=\"127\" \/><\/a><\/p>\n<p><em>Figure 5: Another code sample<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>In some cases, the malicious JavaScript attachment is bundled with a dummy file to evade email rules.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6773\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS6.png\" alt=\"JS6\" width=\"588\" height=\"403\" \/><\/a><\/p>\n<p><em>Figure 6: An example of a JavaScript attachment and a dummy file <\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6783\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS7.png\" alt=\"JS7\" width=\"589\" height=\"352\" \/><\/a><\/p>\n<p><em>Figure 7: Another example of a JavaScript attachment and a dummy file<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>These URLs are mostly short-lived. But when successfully downloaded, the malware, in this case <a href=\"https:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/Entry.aspx?Name=Ransom:Win32\/Locky.A\">Ransom:Win32\/Locky<\/a>, enters the system and proceeds in its destructive mission.<\/p>\n<p>It is interesting to note that an Office attachment with malicious macros typically requires two or more clicks on the document to run it. One click to open the document, and another click to enable the macros.<\/p>\n<p>On the other hand, the JavaScript attachments only takes one or two clicks for it to start executing.<\/p>\n<p>It is uncommon and quite suspicious for people to send legitimate applications in pure JavaScript file format (files with .<em>js<\/em> or .<em>jse<\/em> extension) via email. You should be wary of it and should not click or open it.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6791\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS8.png\" alt=\"JS8\" width=\"696\" height=\"480\" \/><\/a><\/p>\n<p><em>Figure 8: A screenshot of how the JavaScript attachment gets executed.<\/em><\/p>\n<p>&nbsp;<\/p>\n<h2>Same stuff, new package<\/h2>\n<p>It has been a common vector for malware to spread through email attachment. In the past months, we have seen Office file attachments that contains malicious macro. The code is simple and straightforward, it\u2019s main objective is to download and execute other malware, such as password stealers, backdoors and ransomwares.<\/p>\n<p>The JavaScript-toting email spam is no different.<\/p>\n<p>These malicious email attachments are distributed through spam campaigns. Spam campaigns range from different social engineering areas that appeal to people\u2019s curiosity \u2013 enough for them to take action and click what shouldn\u2019t be clicked: from finance-related subjects like receipts, invoice and bank accounts, to resumes and shipment notifications.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6793\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS9.png\" alt=\"JS9\" width=\"608\" height=\"463\" \/><\/a><\/p>\n<p><em>Figure 9: A screenshot of a sample bank-related email spam.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6794\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS10.png\" alt=\"JS10\" width=\"614\" height=\"504\" \/><\/a><\/p>\n<p><em>Figure 10: A screenshot of a sample remittance-themed email spam.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6803\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS11.png\" alt=\"JS11\" width=\"611\" height=\"516\" \/><\/a><\/p>\n<p><em>Figure 11: A screenshot of a sample invoice-themed email spam.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6813\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS12.png\" alt=\"JS12\" width=\"604\" height=\"481\" \/><\/a><\/p>\n<p><em>Figure 12: A screenshot of a sample resume-themed email spam.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6814\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS13.png\" alt=\"JS13\" width=\"604\" height=\"676\" \/><\/a><\/p>\n<p><em>Figure 13: A screenshot of a shipment notification-themed email spam.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS14.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-6821\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/JS14.png\" alt=\"JS14\" width=\"575\" height=\"651\" \/><\/a><\/p>\n<p><em>Figure 14: A screenshot of a sample debt case-themed email spam.<\/em><\/p>\n<h2><\/h2>\n<h2>Mitigation and prevention<\/h2>\n<p>To avoid falling prey from those JavaScript-toting-emails\u2019 social engineering tricks<\/p>\n<ul>\n<li>Use <a href=\"http:\/\/www.microsoft.com\/security\/pc-security\/windows-defender.aspx\">Windows Defender<\/a> for Windows 10\u00a0as your antimalware scanner.<\/li>\n<li><a href=\"http:\/\/windows.microsoft.com\/en-us\/windows-8\/join-maps-community\">Ensure that Microsoft Active Protection Service has been enabled<\/a>.<\/li>\n<li>Use Office 365 Advanced Threat Protection. It has a machine learning capability to help your network administrators <a href=\"https:\/\/blogs.office.com\/2016\/01\/14\/leading-the-way-in-the-fight-against-dangerous-email-threats\/\">block\u00a0dangerous email threats<\/a>. See\u00a0the <a href=\"https:\/\/www.youtube.com\/watch?v=GEE5y9sE_t4\">Overview of Advanced Threat Protection in Exchange: new tools to stop unknown attacks<\/a>, for details.<\/li>\n<li>Be wary of emails with JavaScript attachments. It is uncommon and quite suspicious for people to send legitimate applications in pure JavaScript file format (files with .<em>js<\/em> or .<em>jse<\/em> extension) via email. Do not click or open it.<\/li>\n<li>Use the <a href=\"http:\/\/social.technet.microsoft.com\/wiki\/contents\/articles\/5211.how-to-configure-applocker-group-policy-to-prevent-software-from-running.aspx\">AppLocker group policy<\/a> to prevent dubious software from running.<\/li>\n<li>Though ransomware and macro-based malware are on the rise, there\u2019s still something that you or your administrators can proactively do:<\/li>\n<\/ul>\n<ul>\n<li>Ensure that a strong <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/cc770394%28v=ws.10%29.aspx\">password policy<\/a> is implemented throughout the enterprise.<\/li>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/mmpc\/2016\/02\/24\/locky-malware-lucky-to-avoid-it\/\">Disable the loading of macros in Office programs<\/a>.<\/li>\n<li><a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/ee857085.aspx\">Disable macro loading through the Group Policy settings<\/a>.<\/li>\n<li>Keep your software <a href=\"http:\/\/www.microsoft.com\/security\/portal\/definitions\/adl.aspx\">up-to-date<\/a> to mitigate possible software exploits.<\/li>\n<li>Protect derived domain credentials with <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/mt483740%28v=vs.85%29.aspx\">Credential Guard\u00a0for Windows 10 Enterprise<\/a>.<\/li>\n<li>Secure your code integrity with <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/dn986865%28v=vs.85%29.aspx\">Device Guard for Windows 10 Enterprise<\/a>.<\/li>\n<li><a href=\"http:\/\/download.microsoft.com\/download\/5\/1\/6\/516F59A7-91EE-4463-8612-C85FD3BEBDC7\/pop-securing-lateral-account-movement.pdf\">Secure the lateral account movement in your\u00a0enterprise<\/a>.<\/li>\n<li>Use two-factor authentication with <a href=\"https:\/\/blogs.windows.com\/buildingapps\/2016\/01\/26\/convenient-two-factor-authentication-with-microsoft-passport-and-windows-hello\/\">Microsoft Passport and Windows Hello<\/a>.<\/li>\n<\/ul>\n<p>See some of the related blogs and threat reports:<\/p>\n<ul>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/mmpc\/2016\/03\/22\/new-feature-in-office-2016-can-block-macros-and-help-prevent-infection\/\">New feature in Office 2016 can block macros and help prevent infection<\/a><\/li>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/mmpc\/2016\/02\/24\/locky-malware-lucky-to-avoid-it\/\">Locky malware, lucky to avoid it<\/a><\/li>\n<li><a href=\"https:\/\/blogs.technet.microsoft.com\/mmpc\/2015\/04\/27\/social-engineering-tricks-open-the-door-to-macro-malware-attacks-how-can-we-close-it\/\">Social engineering tricks open the door to macro-malware attacks \u2013 how can we close it?<\/a><\/li>\n<li><a href=\"https:\/\/www.microsoft.com\/security\/portal\/enterprise\/threatreports_july_2015.aspx\">Macro malware report<\/a><\/li>\n<\/ul>\n<p><em>\u00a0<\/em><\/p>\n<p><em>Alden Pornasdoro<\/em><\/p>\n<p><em>MMPC<\/em><\/p>\n<p><a href=\"https:\/\/blogs.technet.microsoft.com\/mmpc\/2016\/04\/18\/javascript-toting-spam-emails-what-should-you-know-and-how-to-avoid-them\/\" target=\"bwo\" >https:\/\/blogs.technet.microsoft.com\/mmpc\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have recently observed that spam campaigns are now using JavaScript attachments aside from Office files. The purpose of the code is straightforward. It downloads and runs other malware. Some of the JavaScript downloaders that we\u2019ve seen are: TrojanDownloader:JS\/Swabfex TrojanDownloader:JS\/Nemucod TrojanDownloader:JS\/Locky The same JavaScript downloaders are also responsible for spreading the following ransomware: Ransom:Win32\/Tescrypt Ransom:Win32\/Locky&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10759,10378],"tags":[10847,10836,10846,10848,10849,10850,10795,10851,10852,10853,10854,10518,10855,10856,10857,10833,10762],"class_list":["post-6313","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-security","tag-applocker-group-policy","tag-backdoor","tag-javascript-spam-attachment","tag-jslocky","tag-jsnemucod","tag-jsswabfex","tag-locky","tag-nemucod","tag-rensomware-payload","tag-sample-javascript-email-attachments","tag-sample-javascript-spam","tag-spam","tag-spam-email-vector","tag-swabfex","tag-tecrypt","tag-trojan","tag-windows-defender"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/6313","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=6313"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/6313\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=6313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=6313"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=6313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}