If we beautified it as per below we will see the obfuscation this shell script:
You can read the codes here, no free ride copy/paste this time, since we have hard times with those false positives from antiviruses
Shortly. The blue color explaining the obfuscation strings saved in some variables. The yellow marked color words are functions to be executed, and the red color area is the main function of this script, to download and install a payload.
The obfuscation used is in the enc() and dec() function (see that big pic codes) for encryption and decryption, by using the below code (I picked this one, the one used for decrypting)
tr "[.0-9a-zA-Z\/\/\:]" "[a-zA-Z0-9\;-=+*\/]";They called it encryption, but is just a mere obfuscator using the character map translation in "tr". Below is the easy shell script I made to decode them:
We'll see another 3502 file. And a bunch of the CNC used. Noted the username and password they use ;)
If you permutated the URL with the payload name you will some ALIVE malware URLs like these:
The payload
The header looks very "fine":
ELF Header:First block:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Intel 80386
Version: 0x1
Entry point address: 0x8048110
With the key that lead to this address:
A hard-coded callback IP address
And look what I got next to the xor key :))
Sample is shared in kernel mode-->[here]
Conclusion & Credits
This threat is the first time we see using complicated installer/builder. I and other team mates start to feel like playing CTF with this crook. They (China actors) are improving in steps, we must be aware. Please stay safe folks..
Credit: @shibumi (threat sensoring), @wirehack7 (formulation), and others who doesn't want to be mentioned.
Additional
(A reserved section for additional and updates)
#MalwareMustDie!!
SOCIAL SHARE CARD GENERATOR