Skip to content

WindowsTechs.com

Collaborate Disseminate

Menu

Primary menu

  • Home

JavaScript-toting spam emails: What should you know and how to avoid them?

Posted on April 18, 2016 by msft-mmpc

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’ve 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

The spam email contains a .zip or .rar file attachment which carries a malicious JavaScript. The JavaScript attachment mostly has the following icon, depending on the system’s script software. The file names are either related to the spam campaign, or completely random:

JS1

Figure 1: Examples of JavaScript attachments from spam email campaigns

Not your favorite Java

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’s curiosity (finance-related, etc.).

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.

JS2

Figure 2: Sample code and URL

 

JS3

Figure 3: Another code sample

 

JS4

Figure 4: Another code sample

 

JS5

Figure 5: Another code sample

 

In some cases, the malicious JavaScript attachment is bundled with a dummy file to evade email rules.

JS6

Figure 6: An example of a JavaScript attachment and a dummy file

 

JS7

Figure 7: Another example of a JavaScript attachment and a dummy file

 

These URLs are mostly short-lived. But when successfully downloaded, the malware, in this case Ransom:Win32/Locky, enters the system and proceeds in its destructive mission.

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.

On the other hand, the JavaScript attachments only takes one or two clicks for it to start executing.

It is uncommon and quite suspicious for people to send legitimate applications in pure JavaScript file format (files with .js or .jse extension) via email. You should be wary of it and should not click or open it.

 

JS8

Figure 8: A screenshot of how the JavaScript attachment gets executed.

 

Same stuff, new package

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’s main objective is to download and execute other malware, such as password stealers, backdoors and ransomwares.

The JavaScript-toting email spam is no different.

These malicious email attachments are distributed through spam campaigns. Spam campaigns range from different social engineering areas that appeal to people’s curiosity – enough for them to take action and click what shouldn’t be clicked: from finance-related subjects like receipts, invoice and bank accounts, to resumes and shipment notifications.

 

JS9

Figure 9: A screenshot of a sample bank-related email spam.

 

JS10

Figure 10: A screenshot of a sample remittance-themed email spam.

 

JS11

Figure 11: A screenshot of a sample invoice-themed email spam.

 

JS12

Figure 12: A screenshot of a sample resume-themed email spam.

 

JS13

Figure 13: A screenshot of a shipment notification-themed email spam.

 

JS14

Figure 14: A screenshot of a sample debt case-themed email spam.

Mitigation and prevention

To avoid falling prey from those JavaScript-toting-emails’ social engineering tricks

  • Use Windows Defender for Windows 10 as your antimalware scanner.
  • Ensure that Microsoft Active Protection Service has been enabled.
  • Use Office 365 Advanced Threat Protection. It has a machine learning capability to help your network administrators block dangerous email threats. See the Overview of Advanced Threat Protection in Exchange: new tools to stop unknown attacks, for details.
  • 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 .js or .jse extension) via email. Do not click or open it.
  • Use the AppLocker group policy to prevent dubious software from running.
  • Though ransomware and macro-based malware are on the rise, there’s still something that you or your administrators can proactively do:
  • Ensure that a strong password policy is implemented throughout the enterprise.
  • Disable the loading of macros in Office programs.
  • Disable macro loading through the Group Policy settings.
  • Keep your software up-to-date to mitigate possible software exploits.
  • Protect derived domain credentials with Credential Guard for Windows 10 Enterprise.
  • Secure your code integrity with Device Guard for Windows 10 Enterprise.
  • Secure the lateral account movement in your enterprise.
  • Use two-factor authentication with Microsoft Passport and Windows Hello.

See some of the related blogs and threat reports:

  • New feature in Office 2016 can block macros and help prevent infection
  • Locky malware, lucky to avoid it
  • Social engineering tricks open the door to macro-malware attacks – how can we close it?
  • Macro malware report

 

Alden Pornasdoro

MMPC

This entry was posted in AppLocker Group Policy, backdoor, JavaScript spam attachment, JS/Locky, JS/Nemucod, JS/Swabfex, locky, nemucod, Rensomware payload, sample JavaScript email attachments, sample JavaScript spam, Spam, spam email vector, Swabfex, Tecrypt, Trojan, Windows Defender by msft-mmpc. Bookmark the permalink.

Post navigation

← Previous Previous post: CVE-2016-3943 (panda_endpoint_administration_agent)
Next → Next post: Security Weekly 460: Stories of the Week

Primary Sidebar Widget Area

Infocon Status

Internet Storm Center Infocon Status

Recent Posts

  • ISC Stormcast For Monday, May 11th, 2026 https://isc.sans.edu/podcastdetail/9926, (Mon, May 11th) May 11, 2026
  • Binaural Microphone on a Budget May 11, 2026
  • Most Polymarket Users Lose Money, While Top 1% Claim 76.5% of Gains, Study Finds May 11, 2026
  • Welcoming the Costa Rican Government to Have I Been Pwned May 11, 2026
  • PlayStation3 Emulator Devs Politely Ask Contributors to Stop Submitting ‘AI Slop’ Pull Requests May 11, 2026

Tag Cloud

Agriculture Alzheimer's Disease Art Audio Automation Bluetooth Building and Construction Campervan Camping Cancer Coronavirus (COVID-19) Cycling Dementia Diabetes DNA Electric Vehicles Food Home House Huawei Indiegogo MIT Mobility Moon New Atlas Audio NVIDIA Off-grid Off-road Pedal-assisted Photography Physics Radio Repair RV Samsung Satellite Sony SpaceX spoofing sustainable design The Immune System Tiny Footprint Training Water Zoom

Archives

  • Facebook
  • Twitter
  • Linkedin
  • Email
Copyright © 2026 WindowsTechs.com. All Rights Reserved.
Theme: Catch Box by Catch Themes
Scroll Up