Ransomware is a hot topic and it’s about to become hotter. Why? Because now it’s targeting our cloud services. Nearly one out of five malware detections in the past month in the Netskope Active Platform are document files such as Microsoft Word that contain macros. Earlier this week, cloud platform vendor Avanan blogged about a widespread ransomware attack, called Cerber, that is being spread via cloud productivity platform, Microsoft Office 365. Incidentally, we have seen these types of macro-type malware-delivered ransomware across a variety of cloud-based file-sharing apps, and we don’t believe there’s anything necessarily unique about detecting it in Office 365. The name Cerber is derived from Cerberus, a 3-headed dog that guards the entrance to Hades in Greek mythology.
Figure 1: Image from Cerber ransomware note
The attacks use a decoy document loaded with malicious macro code that downloads Cerber malware files to users’ machines. When the decoy document is opened, it drops a VBScript file (.vbs) with a random name in the format “%APPDATA%\%RANDOM%.vbs.” The VBScript file is then launched using wscript.exe, which downloads an image file named “mhtr.jpg.” This jpeg image is downloaded from the URLs solidaritedeproximite[.]org/mhtr.jpg, 92.222.104[.]182/mhtr.jpg. If the file is not found when visiting solidaritedeproximite[.]org, it will be fetched from 92[.]222[.]104[.]182 as shown in Figure 2 below. At the time of writing this blog, solidaritedeproximite[.]org was not serving the file and was instead delivered from 92[.]222[.]104[.]182.
Figure 2: Network packet capture displaying attempts to the URLs used to download mhtr.jpg
The image file mhtr.jpg looks benign and displays content related to “zen-coding,” as shown in Figure 3, but has steganographically (hidden in plain sight) embedded malware inside it which is decoded to an exploit as shown in Figure 4. This technique has been used by such historic malware families as Bredolab, but is seeing a resurgence as it permits executables to be transmitted without causing network monitoring devices to suspect malicious activity.
Figure 3: Image that would be displayed if someone opened mhtr.jpg
Figure 4: JFIF image and the encoded blob of mhtr.jpg
At the time of writing this blog, very few security vendors were detecting this image file as shown from the VirusTotal page in Figure 5.
Figure 5: mhtr.jpg sample detection in VirusTotal
In the next stage of the attack, a random name .exe binary is dropped in %APPDATA% in a hidden folder. In our observation, it was EFSUI.EXE as shown in Figure 6. This is detected by majority of the security vendors as referenced from the VirusTotal page.
Figure 6: Binary extracted from mhtr.jpg detection in VirusTotal
This binary is a NSIS installer that has a list of files that are also dropped in %APPDATA% as shown in Figure 7.
Figure 7: Files inside the NSIS installer
The manually extracted payload (MD5 – DB073371DCBAC628E69C2B91E1E18BD9) of the Cerber ransomware is present inside the NSIS installer. Figure 8 shows the count of current security vendors from VirusTotal page who detect this binary at the time of writing this blog.
Figure 8: Detection of extracted file from the installer in VirusTotal
Debugging the binary and extracting the configuration provides more insight into how Cerber works, including locations, AV vendors, and file extensions.
In our observation, Cerber doesn’t encrypt files for users in the following countries:
Armenia, Azerbaijan, Belarus, Georgia, Kyrgyzstan, Kazakhstan, Republic of Moldova, Russian Federation, Turkmenistan, Tajikistan, Ukraine and Uzbekistan
“Blacklist”:{“countries”:[“am”,”az”,”by”,”ge”,”kg”,”kz”,”md”,”ru”,”tm”,”tj”,”ua”,”uz”]
It also tries to stop working if it detects the following anti-virus solutions in place:
“av_blacklist”:[“kaspersky lab”,”avast software”,”eset”,”bitdefender”,”bitdefender agent”,”lavasoft”,”arcabit”,”arcavir”,”bullguard ltd”,”bullguard software”,”emsisoft anti-malware”,”escan”,”etrust ez armor”,”ca”,”f-secure”,”g data”,”trustport”]”
Finally, it encrypts files with the following 444 extensions that are likely to be associated with high-value business files:
“Encrypt”:{“files”:[[“.contact”, “.dbx”, “.doc”, “.docx”, “.jnt”, “.jpg”, “.mapimail”, “.msg”, “.oab”, “.ods”, “.pdf”, “.pps”, “.ppsm”, “.ppt”, “.pptm”, “.prf”, “.pst”, “.rar”, “.rtf”, “.txt”, “.wab”, “.xls”, “.xlsx”, “.xml”, “.zip”, “.1cd”, “.3ds”, “.3g2”, “.3gp”, “.7z”, “.7zip”, “.accdb”, “.aoi”, “.asf”, “.asp”, “.aspx”, “.asx”, “.avi”, “.bak”, “.cer”, “.cfg”, “.class”, “.config”, “.css”, “.csv”, “.db”, “.dds”, “.dwg”, “.dxf”, “.flf”, “.flv”, “.html”, “.idx”, “.js”, “.key”, “.kwm”, “.laccdb”, “.ldf”, “.lit”, “.m3u”, “.mbx”, “.md”, “.mdf”, “.mid”, “.mlb”, “.mov”, “.mp3”, “.mp4”, “.mpg”, “.obj”, “.odt”, “.pages”, “.php”, “.psd”, “.pwm”, “.rm”, “.safe”, “.sav”, “.save”, “.sql”, “.srt”, “.swf”, “.thm”, “.vob”, “.wav”, “.wma”, “.wmv”, “.xlsb”, “.3dm”, “.aac”, “.ai”, “.arw”, “.c”, “.cdr”, “.cls”, “.cpi”, “.cpp”, “.cs”, “.db3”, “.docm”, “.dot”, “.dotm”, “.dotx”, “.drw”, “.dxb”, “.eps”, “.fla”, “.flac”, “.fxg”, “.java”, “.m”, “.m4v”, “.max”, “.mdb”, “.pcd”, “.pct”, “.pl”, “.potm”, “.potx”, “.ppam”, “.ppsm”, “.ppsx”, “.pptm”, “.ps”, “.pspimage”, “.r3d”, “.rw2”, “.sldm”, “.sldx”, “.svg”, “.tga”, “.wps”, “.xla”, “.xlam”, “.xlm”, “.xlr”, “.xlsm”, “.xlt”, “.xltm”, “.xltx”, “.xlw”, “.act”, “.adp”, “.al”, “.bkp”, “.blend”, “.cdf”, “.cdx”, “.cgm”, “.cr2”, “.crt”, “.dac”, “.dbf”, “.dcr”, “.ddd”, “.design”, “.dtd”, “.fdb”, “.fff”, “.fpx”, “.h”, “.iif”, “.indd”, “.jpeg”, “.mos”, “.nd”, “.nsd”, “.nsf”, “.nsg”, “.nsh”, “.odc”, “.odp”, “.oil”, “.pas”, “.pat”, “.pef”, “.pfx”, “.ptx”, “.qbb”, “.qbm”, “.sas7bdat”, “.say”, “.st4”, “.st6”, “.stc”, “.sxc”, “.sxw”, “.tlg”, “.wad”, “.xlk”, “.aiff”, “.bin”, “.bmp”, “.cmt”, “.dat”, “.dit”, “.edb”, “.flvv”, “.gif”, “.groups”, “.hdd”, “.hpp”, “.log”, “.m2ts”, “.m4p”, “.mkv”, “.mpeg”, “.ndf”, “.nvram”, “.ogg”, “.ost”, “.pab”, “.pdb”, “.pif”, “.png”, “.qed”, “.qcow”, “.qcow2”, “.rvt”, “.st7”, “.stm”, “.vbox”, “.vdi”, “.vhd”, “.vhdx”, “.vmdk”, “.vmsd”, “.vmx”, “.vmxf”, “.3fr”, “.3pr”, “