Zscaler 部落格

訂閱 Zscaler 部落格,第一時間獲取最新資訊!

Security Research

JavaScript Malspam Campaigns

image
ROHIT HEGDE
April 25, 2017 - 3 分鐘閱讀
>JavaScript Malspam Campaigns

Introduction:

The Zscaler ThreatLabz team has observed multiple active malspam campaigns with links to malicious JavaScript payloads in the wild. These JavaScript files when opened by the end user will trigger download and execution of malware executables belonging to various Dropper and Backdoor Trojan families. We have seen over 10,000 instances of malicious JavaScript payloads from these campaigns in last two weeks. The JavaScript files are highly obfuscated to avoid detection and on first look shared similarity to Angler EK's landing page.

Two URL formats are commonly being used at this time, one with just alphanumeric characters in path and the other with string ‘.view’ in the path. The examples for these URLs are seen below,

http://yountstreetglass[.]com/TRucDEpdoO4jsaFaF4wCTxl8h/
http://unbunt[.]com/view-report-invoice-0000093/w0ru-bb26-w.view/

The javascript files have names which try to masquerade as bills and receipts of various services like  DHL, UPS and Vodafone to name a few.

image

Figure 1: Number of hits for the JavaScript malspam over last 30 days.

We analyzed several variations of obfuscated JavaScript payloads and we will look at the details of one such payload in this report.

Infection Cycle:

The attack starts when victims receive malicious spam emails that contain links to what appear to be bills or receipts for different services, such as DHL. Once the user clicks on the link, a malicious JavaScript is downloaded and executed. Internet Explorer displays a warning requesting permission to allow execution of the ActiveX component as shown in the screenshot below:

image

Figure 2: JavaScript execution on targeted Windows machine

Allowing execution of this ActiveX component causes the browser to download and execute the malicious payload as shown in the screenshot below:

image

Figure 3: Malware payload download capture

JavaScript analysis:

When we opened the JavaScript, we observed that it was heavily obfuscated with random strings and numbers assigned to variables, which makes very little sense.

image

Figure 4: Obfuscated JavaScript

The JsFormatted script shows 4,000+ lines of code, which try to hide the script’s logic.

image

Figure 5: JsFormatted obfuscated JavaScript

A quick review of the obfuscated code revealed a line of particular interest, as shown below:

image

Figure 6: JavaScript code line where the deobfuscation starts.

Stepping into this function call provides us the deobfuscated code. Here, we review the important components of this script:

image

Figure 7: JavaScript function to download malware from the URL

The most important function (below) shows us the hardcoded URLs that will be used to download the malware payloads.

image

Figure 8:  JavaScript function containing URLs for malware payload.

The script will continue trying different URLs from the hardcoded list, until it successfully downloads the malware executable payload from one of them.

Finally, we looked at the function that executes the payload: the function which executes the payload:

image

Figure 9: JavaScript function responsible for the malware payload execution.

There are also other functions in the script that create temporary file paths and that save the payload to the temporary path. The JavaScript that is downloaded does not have any browser exploit that could cause automatic execution of the ActiveX component; the user has to explicitly allow the execution to get the machine infected. This is a simple JavaScript that was interesting because of the obfuscation involved in its code and its widespread use in malspam traffic.

We observed different variants of Trojan.Win32.Kasidet and Trojan.Win32/Emotet.K payloads being downloaded by these JavaScript files. Recently, the spammed URLs started serving zipped version of the JavaScript payload instead of direct JavaScript payload. However, the infection cycle remains identical once the user extracts and runs the JavaScript file.

Conclusion:

We should always be cautious when clicking on links or handling e-mail attachments received from an unknown sender. Threat actors keep changing their obfuscation techniques in an attempt to evade detection methods used by security engines. It is increasingly important to have multiple security layers to block these kinds of attacks. Zscaler ThreatLabZ will continue to monitor these malspam campaigns involving malicious scripts to ensure that Zscaler customers are protected.

form submtited
感謝您的閱讀

這篇文章對您有幫助嗎?

免責聲明:本部落格文章由 Zscaler 製作,僅供資訊參考,並以「現狀」提供,不保證其準確性、完整性或可靠性。Zscaler 對任何錯誤或遺漏,或基於所提供的資訊而採取的任何行動不承擔任何責任。本部落格文章中連結的任何第三方網站或資源僅為方便起見而提供,Zscaler 對其內容或做法概不負責。所有內容如有變更,恕不另行通知。存取此部落格,即表示您同意這些條款,並承認您有責任自行驗證並根據您的需求適當使用資訊。

訂閱 Zscaler 部落格,第一時間獲取最新資訊!

提交此表格即表示您同意我們的隱私權政策。