Mr. Robot Variant of Vjw0rm
I was monitoring Any.Run
when a .js
file peeked my interest due to the limited network traffic.
Analysis
Metadata:
- Name:
1.js
- MD5 :
3f438e857c45a4812dbfa331fd3b8011
The first stage decrypts a long Unicode string then calls eval
on its result as seen in Figure 1.
|
|
Figure 1: Deobfuscation routine
When threat actor(s) use eval
, most of the time I can easily bypass this with replacing it with console.log
and using nodejs
to do the heavy lifting for us.
In our case here this is exactily what I did with removing the sleep and replacing eval
with console.log
.
After the script is run with modifications it is possible to obtain the pseudo deobfuscated code.
This means that the contents are still obfuscated to make it difficult for reading however we can identify some key functionality.
In this case most of the strings are stored in an array with the variable _0x4ba2
.
This will have to be deobfuscated by hand as seen in Figure 2.
|
|
Figure 2: Obfuscated result
To achieve this I renamed the variable and simplified the code so its easily human readable.
Vjw0rm
will first check for the registry key HKCU\\vjw0rm
if the value is TRUE
or FALSE
to determine if the machine is already infected or not and will then run the Install()
routine as seen in Figure 3.
|
|
Figure 3: Check if installed
The install routine will copy the script to the %TEMP%
directory then establish persistence by setting the registry key HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\WEW2BF0U0A
with the value being the path to vjw0rm
as seen in Figure 4.
|
|
Figure 4: Vjw0rm Persistence / Installation
After installation has completed it will send a HTTP POST request to the C2 server updatefacebook.ddns.net:6
.
Information of the victim machiine will be supplied to the C2 server by providing it in the User-Agent
header.
The traffic will look like the following:
|
|
The User-Agent
contains the campaign prefix, drive id, computer-name, username, caption, full name, TRUE/FALSE (if visual basic compiler present), TRUE/FALSE (if Vjw0rm is installed).
This variant has several command options, Sc
(write file to disk and run it), Ex
(run additional JSCript code), Rn
(rename the UUID), Up
(Run code w/ WScript), and RF
(run file).
Analysis files for this sample can be downloaded here.
The password to all ZIP archives on this site is infected
.
Thank you,