Banking trojans continue to evolve quickly, affecting major banking organizations across the globe. We’ve seen an increase in malware using secureserver[.]net to target Spanish and Portuguese-speaking regions covering Latin America financial institutions. Additionally, hackers are also targeting Spanish and Portuguese-speaking European countries and other parts of the world.
This campaign is spread via URL secureserver[.]net, which is a hosting site that also offers domain name registration and web hosting services worldwide. During our research within X-Labs, we have observed that this domain is frequently abused to host malicious content.
The email contains embedded secureserver[.]net hosted url following pattern: https:\/\/\d{2,3}\.\d{2,3}\.\d{2,3}\.\d{2,3}\.host\.secureserver\.net
The URL when browsed from locations other than North and South American region either shows a blank page or redirects to some other clean pages. We tried to browse similar URL in Portugal and it downloaded an archive file. The archive file contains an .hta file, which itself contains bit of obfuscation
HTA file:
The file contains URL which contains code:
198.148.167.72.secureserver[.]net/OQQst11/gV7Pus771.js
JavaScript Code:
JavaScript code again resolves to an URL, “198.148.167.72.host.secureserver[.]net/VFb51.vbs” which contains VBS code.
First Stage VBS Code:
The script on execution drops itself in C:\Public as {{randomfilename}}.vbs and executes that VBS using shell. The VBS script contains the URL which is browsed, and another level of execution is performed:
Second Stage VBS code snip:
From here actual behavior of malware starts when it tries to connect to URL “198.148.167[.]72.host.secureserver.net/g1” and download encoded JS.
The URL downloads malicious JavaScript Obfuscated payload:
Obfuscated JS
The script is obfuscated using JS, which is specifically tailored to run in web browsers.
On Deobfuscating the code, we can depict behavior of the campaign statically.
Deobfuscated code and static analysis:
On Deobfuscation the code, we found it checks for various criteria before dropping actual payload:
Antivirus check:
VM and Bios check:
Operating System and OS language check:
If all the above criteria is satisfied, it creates folder in the HOMEDRIVE network and downloads AutoIt executable and encoded script in the folder and creates a shortcut for that folder in Startup:
The above image shows three URLs, which when browsed, drop file in a system network location:
From here, it creates a shortcut that runs on startup:
AutoIt encoded and de-coded script and analysis:
Decoded script
The decoded script is huge with lots of checks, primarily doing process injection in memory. A part of decoded script shows injection in a PE file which starts with 0x4D5A header for Executable file followed by a BinaryToString conversion of the hexadecimal code responsible for loading DLL into memory and invoking its export function:
On execution of AutoIt encoded file and autoit.exe along with dependency file jama1crt mentioned above, it drops a memory dump file. On statically analyzing the memory dump file, we found it again contained embedded AutoIt file:
This encoded script does rest of the injection in memory by using process like ALLOCATEEXESPACE, UNMAPVIEWSECTION, ALLOCATEEXESPACEATADDRESS and injects malicious code in one of the Microsoft’s legit Process, mobsync.exe:
Some important behavior performed by the malware that’s worth noting:
After execution and performing malicious injection in mobsync.exe, it connects to malicious C2s giving out important information such as Computer Name, System Information, User, and admin details and other important information’s.
The malware is distributed via geo-fenced URLs embedded in the email with the main motive being to steal the credentials from victim’s system by infecting victim’s system with process injection using the AutoIt script and tools. URLs mostly work in the North and South American regions with the intention to steal banking information and act as banking trojans or infostealers.
Once browsed from the email, the URL drops an archive file that contains an .HTA file. The HTA file then connects to a malicious URL and performs a series of activities, including browsing encoded JS via the browser. It later results in dropping the AutoIt script, executable and dependency payload.
When all are executed together, it performs process injection in memory of the system. Being evasive in nature, the file executes checking the system language, location, and other environment variables. After successful execution, it connects to malicious C2s providing sensitive information to attackers.
While working on the campaign, it was observed apart from following the pattern which is mentioned before, it also actively stole information by phishing techniques and directly dropping executables in archive file.
Forcepoint customers are protected against this threat at the following stages of attack:
Initial URL pattern |
https:\/\/\d{2,3}\.\d{2,3}\.\d{2,3}\.\d{2,3}\.host\.secureserver\.net |
HTA files |
37768083ff57e77850667394e0d27e8717e3eb35 c76eff517bd7c5e6d1f8ede73e9d260195e42c42 354b48288f2cc0eeefef2011e5ab38a7cb20fbf7 70ebed2ed13a350e59faa5c254ee099e2653c61e d3402ca43a7ebf6f2b944bf83e62261312761c53 |
VBS file |
8ae1dfa8e9544c0b9a6079aa18708f5fe5a82ee5 4114fb23a7211f0721f87947e8b5b5258f5ed47a 8655717e2a3ced90d352a7faf2586a73cefea7d8 |
Obfuscated JScript |
e156707c3ee3c40ca64f66447c5e36de3ae90eba |
AutoIt Script |
c1e2c1fddec0ed9676ed8ce38dbaf2006b50a31e |
URLs |
hxxp://45.40.96[.]231/AutoIt3 hxxp://45.40.96[.]231/AutoIt3.exe hxxp://45.40.96[.]231/jama1crt hxxps://www.rekemchiwdnas.com\/jm1 hxxps:// 198.148.167[.]72.host.secureserver.net/OQQst11/gV7Pus771.js hxxps://198.148.167[.]72.host.secureserver.net/ VFb51.vbs |
C2s |
jpmorgan-fisrt.homelinux[.]com |
Prashant serves as a Security Researcher for the X-Labs Threat Research Content. He spends his time researching web and email-based cyberattacks with a particular focus on URL research, email security and analyzing malware campaigns.