[SANS ISC] JavaScript Downloader Delivers Agent Tesla Trojan, (Thu, Nov 18th)

Yesterday I spotted a piece of JavaScript script that delivers Agent Tesla[1]. New waves of this information stealer trojan are regularly spread to victims. PE files are delivered through downloader scripts attached to phishing emails. Those scripts are regularly updated and the one I found yesterday was interesting. The file was delivered as a 7z archive pretending to content a product catalog. Inside the archive, there was a JavaScript called “Product Specification #87305.js” (SHA256:2c15a96371122649e0c47c4e1af2eff14860a7d8fafc6f71267ea5035d5d4201). The file has a current VT score of 15/55[2].

The file is nicely obfuscated but strings remain readable. Obfuscation techniques have two goals: 

Make the malware analyst job more difficult (and prevent the human eye to spot interesting information just by having a look at the code)
Defeat security controls in place (IDS, YARA rules, and all types of scanners)

In this case, obfuscation has been used for the second goal. Indeed strings remain readable:

[email protected]:/MalwareZoo/20211117$ grep -Eo “https://[^ >’]+” Product Specification #87305.js

The script is a one-liner but easy to beautify. The most interesting line is this one:

var _0xa4fe8b = [

This array is used with the function _0x4fccd5() as seen in this example:

var WshShell=WScript[‘CreateObject’](‘WScript.Shell’),
  xhr=new ActiveXObject(‘MSXML2.XMLHTTP’);

To make the analysis more difficult, the function is aliased to another one (that’s why I like JavaScript!):

function _0x2f7e(_0x57e24e,_0x597446)
var _0x248d35=_0x248d();
return _0x2f7e=function(_0x2f7e14,_0x486218)
var _0x38ca6a=_0x248d35[_0x2f7e14];
return _0x38ca6a;

var _0x4fccd5=_0x2f7e;

The index of the array to use is specified in hexadecimal (Ex: “0x124”) and corrected to access the right element.

The script uses the classic ActiveX objects: ‘MSXML2.XMLHTTP’ to download the file, ‘ADODB.Stream’ to dump it on the file system and ‘WScript.Shell’ to execute it.

[1] https://attack.mitre.org/software/S0331/
[2] https://www.virustotal.com/gui/file/2c15a96371122649e0c47c4e1af2eff14860a7d8fafc6f71267ea5035d5d4201/detection

Xavier Mertens (@xme)
Senior ISC Handler – Freelance Cyber Security Consultant

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

Source: Read More (SANS Internet Storm Center, InfoCON: green)

You might be interested in …

[TheRecord] CISA, FBI issue holiday warning about hackers, urge vigilance

Hackers could try to ruin your holiday season, the Cybersecurity and Infrastructure Security Agency and the FBI warned on Monday. The organizations issued a joint advisory just a few days before Thanksgiving to remind “critical infrastructure partners that malicious cyber actors aren’t making the same holiday plans as you.” “Recent history tells us that this […]

Read More

[HackerNews] Verify End-Users at the Helpdesk to Prevent Social Engineering Cyber Attack

All posts, HackerNews

Although organizations commonly go to great lengths to address security vulnerabilities that may exist within their IT infrastructure, an organization’s helpdesk might pose a bigger threat due to social engineering attacks. Social engineering is “the art of manipulating people so they give up confidential information,” according to Webroot. There are many different types of social engineering […]

Read More

[SecurityWeek] U.S. Agencies Share More Details on ADSelfService Plus Vulnerability Exploitation

All posts, Security Week

The U.S. Cybersecurity and Infrastructure Security Agency (CISA), the Federal Bureau of Investigation (FBI), and the Coast Guard Cyber Command (CGCYBER) have shared new details on in-the-wild attacks targeting a recently patched flawin Zoho’s ManageEngine ADSelfService Plus product. read more Source: Read More (SecurityWeek RSS Feed)

Read More