The initial JavaScript downloader is obfuscated and contains several eval functions.
One of the eval calls is a function that returns a long string, which is decoded by another function.
The function that decodes the string is located further down in the script.
At first sight it looks complicated, but it is a simple replacement function.
First, the passed arguments are stored in a new variable.
It is done this way to work correctly with an arbitrary number of arguments.
Next, the replacement operation runs on the initial string. The second argument of the replace function in JavaScript is another function which returns the replacement string.
In this case, the second argument to this inline function is the capturing group which matches the regular expression {d+}.
Since the capturing group is a decimal number, it is used as an index for the arguments array which is returned as a replacement string.
In case of an index out of bounds exception, the function returns the whole matching string, which was most likely implemented to handle mismatches.
To decode the string three arguments (A, u, F) are passed to the function.
The decoded string is Base64 encoded which can simply be decoded to analyze it in more detail. By creating and writing an ActiveX Data Stream Object this sequence is decoded and executed using an eval statement.
The most notable part of this sequence are the hex characters stored in a nested array, which is used as another layer of obfuscation.
Using an ActiveX object, a shell application instance is created, passing a long, chained argument.
By simply adding line breaks after the & characters, we can reformat the command line argument into a readable format.
The first parts of the command line argument are used to write lines to a VBScript file using an echo function. This file is then executed, resulting in a download through an XMLHTTP object.
The response to the GET request – the malware payload – is written to a file called YVC.JAR.
The VBScript file is then deleted. Afterwards, the cmd.exe process waits 12 seconds, before running the payload.