Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

3-in-1 Malware Infection through Spammed JavaScript Attachments

Recently we've observed a massive uptick of malicious spam with JavaScript attachments with an intention to spread and infect Windows systems with variety of malicious executables. The spam usually contains a ZIP file attachment containing only one JavaScript file.


The spam campaign has been ongoing for the past months but last week we've observed a massive huge uptick in our spam traps

An example of the spam campaign claims to be a resume from a fake named sender.


Extracting the ZIP file contains a file with .JS file extension


JavaScript De-obfuscation and Analysis

The attached JavaScript file is obfuscated. One of the easiest ways to de-obfuscate this script is to look for the eval() method within the script and replace it with alert() method. The alert() method will display a dialogue box of the de-obfuscated JS string instead of the eval() method that compiles and runs the string. For this particular sample, the eval() method is not called directly in the code and is hidden inside a variable that appears to be a random string.


After replacing the variable to alert() method, we will then save the file and run the script by opening it through a browser. If successful, a Message box will popup containing the de-obfuscated JavaScript:


Cleaning up the code shows a function named "dl" that carries out the download routine using ActiveXObject framework, saving downloaded files to the Windows Temporary folder and then executing them.



The downloaded files have a destructive payload, one of which may result to permanent loss of files. The de-obfuscated URL shows the link pointing to .JPG files; these are actually malicious Windows executables. Once they are downloaded, the files are renamed to .EXE file extension and saved in the Temporary folder. The file named 2.jpg belongs to a Fareit botnet that is designed to steal credentials from FTP clients, web browsers, mail clients and even bitcoin wallets.

The routine where the malware tries to steal user credentials from FireFTP Firefox add-on



Fareit Trojan also attempts to steal bitcoin in the infected system

The stolen credentials are then sent to a list of remote control servers.


The other downloaded executable disguised in the URL link as 3.jpg is an Outlook email harvester. The Trojan attempts to harvest Outlook contacts and sends the collected data to the domain name spamhausgandon[.]com.


The last payload is the file 1.jpg that is actually an executable file of a ransomware otherwise known as a Cryptolocker. The Trojan encrypts targeted files which include Office documents such as .doc, .docx, .xls, .xlsx, .pdf, also of images such as .jpg, .png, .raw, .svg and others


After encrypting the target files, an instruction note in different file format (html or txt or image) is dropped in the victim's computer with instructions on how to pay the operators in exchange for restoring the encrypted files.



Malicious JavaScript is just another method used by the crooks to spread malware, but it is increasing in popularity it seems even with such a small amount of obfuscated code, it is capable of downloading multiple payloads.

Email administrators should consider blocking inbound JavaScript files outright at the gateway. For end users, consider disabling the Windows Script Host (WSH). Instructions for disabling WSH can be found in this link from Microsoft.

Trustwave Secure Email Gateway blocks this malicious spam campaign

Latest SpiderLabs Blogs

Welcome to Adventures in Cybersecurity: The Defender Series

I’m happy to say I’m done chasing Microsoft certifications (AZ104/AZ500/SC100), and as a result, I’ve had the time to put some effort into a blog series that hopefully will entertain and inform you...

Read More

Trustwave SpiderLabs: Insights and Solutions to Defend Educational Institutions Against Cyber Threats

Security teams responsible for defending educational institutions at higher education and primary school levels often find themselves facing harsh lessons from threat actors who exploit the numerous...

Read More

Breakdown of Tycoon Phishing-as-a-Service System

Just weeks after Trustwave SpiderLabs reported on the Greatness phishing-as-a-service (PaaS) framework, SpiderLabs’ Email Security team is tracking another PaaS called Tycoon Group.

Read More