Coffee Ransomware Remains Active, Antiy Releases Decryption Tool

The original report is in Chinese, and this version is an AI-translated edition.

1.Overview

Recently, Antiy CERT (a member of the CCTGA Ransomware Prevention and Response Working Group) has detected the continued activity of the Coffee ransomware targeting China. This ransomware first appeared in January 2022 and is mainly spread through phishing emails and QQ group files.

The Coffee ransomware attackers crafted phishing emails and ransom notes in Chinese and provided detailed Chinese tutorials on how to purchase cryptocurrency in China to pay the ransom, highly targeting domestic users. The ransomware uses a “white and black” method to load malicious modules and employs ” DDR” (Dead Drop Resolvers) technology, exploiting legitimate web services to download subsequent malicious payloads and evade detection from security products. The ransomware also hijacks desktop shortcuts and further spreads through victims’ QQ chat tools.

Antiy Intelligent Endpoint Protection System (IEP) can effectively detect and kill the ransomware and provide practical protection for user terminals. Antiy has now released a decryption tool for the ransomware.

Special thanks to:

Harbin Institute of Technology Cybersecurity Emergency Response Team

CCTGA Ransomware Prevention and Response Working Group

2.ATT&CK Mapping Diagram Corresponding to the Incident

The distribution of technical characteristics of the attack samples is as follows:

Figure 2‑1

The following table lists the techniques used by the attackers in this incident:

Table 2‑1

ATT&CK Stages/CategoriesSpecific BehaviorNotes
Initial accessPhishingSpread through phishing emails and QQ group files
ExecuteInduce users to executeInduce users to execute
PersistenceTamper with client softwareTamper with client shortcuts
Defense evasionModify file and directory permissionsSet file permissions
Defense evasionExecute process hijackingUse legitimate executable files to load malicious DLLs
Defense evasionExecute signed binary agentLeverage signed binary proxies
DiscoverDiscover application windowDiscover QQ window
DiscoverDiscover files and directoriesDiscover files and directories
DiscoverDiscover processFound security software and QQ processes
DiscoverQuery the registryQuery the registry
DiscoverDiscover softwareFound a list of installed software
DiscoverDiscover system servicesDiscover system services
DiscoverDiscover system timeDiscover system time
Lateral movementLateral transfer of files or toolsLateral spread through QQ
InfluenceData encryption with adverse effectsEncrypt data

3.Attack Process

Attackers drop phishing email attachments or QQ group files in compressed format, tricking victims into decompressing and executing the shortcut contained within. The shortcut uses Unicode encoding to conceal the actual malicious program, csrts.exe. Once executed, the malicious program uses a “white and black” scheme, using the white file csrts.exe to load the malicious module Myou.dll. It then downloads and loads subsequent malicious payloads from hosting platforms and other sources, performing malicious actions such as file encryption, shortcut hijacking, and spreading through the victim’s QQ account.

Figure 3‑1

4.Protection Recommendations

For this ransomware, Antiy recommends taking the following protective measures:

4.1 Enterprise Protection

  1. Install terminal protection: Install anti-virus software. It is recommended that Antiy IEP users enable the ransomware protection tool module (enabled by default);
  2. When receiving QQ group files, confirm that the sender is reliable. It is recommended to execute suspicious files in a sandbox environment and only use the host after ensuring safety.
  3. Deploy an Intrusion Detection System (IDS): Deploy traffic monitoring software or equipment to facilitate the discovery and tracing of malicious code. Antiy Persistent Threat Detection System (PTD) uses network traffic as the detection and analysis object, and can accurately detect a large amount of known malicious code and network attack activities, effectively discovering suspicious network behavior, assets, and various unknown threats;
  4. Disaster recovery plan: Establish a security disaster recovery plan to ensure that the backup business system can be quickly activated;
  5. Antiy Service: If you are attacked by malware, it is recommended to isolate the attacked host in a timely manner and protect the site while waiting for security engineers to investigate the computer; Antiy 7*24 hour service hotline: 400-840-9234.

4.2 Email Protection

  • When receiving emails, confirm whether the source is reliable and avoid opening attachments in suspicious emails;
  • It is recommended to execute suspicious files in a sandbox environment and only execute them on the host when safety is ensured. The Antiy Persistent Threat Analysis System (PTA) uses a combination of deep static analysis and sandbox dynamic loading and execution to effectively detect, analyze and identify various known and unknown threats.

Antiy Intelligent Endpoint Protection System (IEP) can effectively detect and kill the ransomware and provide practical protection for user terminals.

Figure 4‑1 Antiy IEP provides effective protection

Figure 4‑2 Antiy IEP blocks encryption behavior

5.Ransomware Overview

Table 5‑1

Appearance timeJanuary 2022​
Encryption algorithmRC4+RSA
Encryption systemWindows
Encrypted file naming methodOriginal file name.coffee.The first four characters of the key.Original file suffix
ContactOperation instructions in the ransom letter
Encrypted file typesEncrypt files of specified formats (specific formats include * .docx , * .doc , *.docm , * .pdf, * .xlsx , etc.)
Ransom currency and amount500 worth of ZEC (a digital currency called zerocoin)
Is it targeted?No
Can it be decrypted?Can
Whether it is transmitted on the intranetNo
Ransom letter interface

6.Sample Analysis

6.1 Sample Tags

Table 6‑1 Sample tags

Malicious code nameTrojan[ Ransom]/Win32.Coffee
Original file nameMyou.dll
MD5313BC92DCE801C2EC316C57EA74DD92A
Processor architectureIntel 386 or later processors and compatible processors
File size30.50 KB (31,232 bytes )
File formatBinExecute /Microsoft.DLL[:X86]
Timestamp2072-11-29 00:40:31 (forged)
Digital signatureNone
Packer typeNone
Compiled language.NET
VT first upload time2022-02-18 05:28:53
VT test results31/67

6.2 Use “DDR” (Dead Drop Resolvers) Technology to Download Malicious Functional Payloads

The compressed file uses a shortcut as bait, and the shortcut uses Unicode encoding to hide the actual target file path csrts.exe. Double-clicking the shortcut will call the program to run.

Figure 6‑1 Shortcut to execute malicious program

Using the “white and black” method, the white file csrts.exe with a digital signature is used to load the malicious module Myou.dll.

Figure 6‑2 Digital signature of csrts.exe

Copy yourself and Myou.dll to the %Appdata% directory and execute.

Figure 6‑3 Copy itself to the %Appdata% directory

Using “DDR” (Dead Drop Resolvers) technology, it downloads and loads RTLib.dll from Gitee (a Git-based code hosting platform in China) and IPFS (a decentralized file storage system). This file is the subsequent malicious function payload.

Figure 6‑4 Download and load the module

Figure 6‑5 Malicious payload stored by attackers on the Gitee platform

The sample will visit https://visitor-badge.laobi.icu/badge?page_id=dayXXX.nobody.com to count the number of victims. According to the website data, the number of infections surged on February 18, 2022.

Figure 6‑6 Statistics of the number of victims from January 1, 2022 to February 18, 2022

6.3 Use RC4 Algorithm for Data Encryption

If the “*-RSA.txt” file exists in the %Appdata% directory, the initial string is read from the file. Otherwise, a random lowercase GUID string is generated and saved to “<Generate another uppercase GUID > – RSA.txt “. An 8-character encryption key is then generated based on this string. The first four characters of the key will form the name of the encrypted file.

Figure 6‑7 Generate encryption key

If any of the following conditions is met, the sample will perform file encryption:

  • There is a security software process;
  • Receive encrypted instructions from the attacker;
  • The current time is greater than or equal to 4 days from the creation time of the %Appdata%\*-RSA.txt file.

Figure 6‑8 File encryption prerequisites

The file is encrypted using the RC4 symmetric encryption algorithm. The sample encrypts only the first 2,097,152 bytes (2 MB) of data in the file. After encryption, two bytes (0x24 and 0x21) are added to the end of the file as a marker.

Figure 6‑9 Encrypted files

The encryption function is only applicable to files with specified suffixes, as shown in the following table.

Table 6‑2 Encrypted file suffix

.key.keys.pfx.pem.p12.csr
.gpg.aes.docx.doc.docm.pdf
.xlsx.xls.xlsm.xlsb.ppt.pptx
.pptm.wps.et.dps.csv.mdb
.dbf.dat.db.sav.sas.sas7bdat
.m.mat.r.rdata.psd.cdr
.ai.jpg.3pg.mp4.mov.dwg
.dxf.vsd.lst.ba.rep.rbk
.ais.aib.dbb.mdf.ldf.myd
.frm.myi.ibd.sql.sqlite.fdb
.gdb.rdb.aof.udb.udbx.wt
.wl.wp.shp.cs.java.cpp
.pas.asm.rar.zip  

The encrypted file name format is: original file name.coffee.the first four characters of the key.the original file extension. For example, the encrypted file “Speech.docx” may be named “Speech.coffee.UV2v.docx”.

Figure 6‑10 Generate encrypted file name

Get the RSA public key from the XML string and encrypt the RC4 key to be used as the decryption password in the ransom note.

Figure 6‑11 RSA public key

Generate a ransom note named “Read Me.RSA.txt” in the path of the encrypted file. The ransom note includes instructions and the decryption password required for decryption.

Figure 6‑12 Ransom note

The Coffee ransomware demands ZEC coins worth 500 USDT (Tether, a virtual currency that pegs cryptocurrency to the legal currency US dollar) from victims, and provides a detailed payment guide in Chinese to instruct victims on how to install digital wallets, purchase virtual currency, pay the ransom, etc.

Figure 6‑13 Instructions provided in the ransom note

6.4  Achieving Persistence by Hijacking Desktop Shortcuts

The sample copies itself to the program directory pointed to by the normal desktop shortcut. The file name is the normal program name followed by the invisible characters “\u200e”, and the normal shortcut is modified to point to this file. When the user executes the program from the desktop shortcut, the malicious program is actually executed. (This feature was not enabled during analysis)

Figure 6‑14 Modify shortcut

The list of programs that hijack shortcuts is as follows.

Table 6‑3 List of infected programs

Tencent QQWeChatWPS OfficeFirefoxMicrosoft Edge
115 PC version115 BrowserMaxthon BrowserOpera browserXiaozhi Dual-core Browser
Tencent VideoYoukuiQiyiBaidu NetdiskAlibaba Cloud Disk
ThunderQQ Music​NetEase Cloud MusicKugou MusicKuwo Music
Tencent MeetingTIM​DingTalkAliwangwangYoudao Cloud Notes
Visual Studio CodeCAJ Viewer 7.2NetEase Youdao DictionaryFast PDF ReaderKingsoft PDF Standalone Edition
Tencent ClassroomYuanfudao​Xueersi Online SchoolRain ClassroomHimalayas
Quick EditLove EditingMeitu XiuXiuLight and shadowLook at the beautiful pictures
Storm Video 16Huya LiveDouyu LiveSteamSkype
Google ChromeCCTV VideoX Mind 8 Update 9QQ VideoQQ Games
CAD Mini ViewerAcrobat Reader DCMagic Hands of Light and ShadowPicasa 3We Game
Kingsoft PowerWord 2016Kuwo KaraokeMeitu Xiuxiu batch processingThunder VideoXiaoyao Simulator
Google Chrome    

6.5 Expand the Scope of Dissemination by Sending QQ Files and Messages

The sample will attempt to place the QQ window in the foreground, simulate QQ file and message sending operations, and use the QQ software in the victim’s system to spread further.

Figure 6‑15 Simulate sending QQ messages

The QQ files and messages sent are as follows.

Figure 6‑16 QQ files and messages sent

7.IoCs

MD5
AA877144EDCEF2E8D5A8D37D7EA0D4B6(csrts.exe)
313BC92DCE801C2EC316C57EA74DD92A(Myou.dll)
D88075B52E78EF0A1CA1C4258031D5A9(r.jpg)
ZEC payment address:
zs1rwqlxjhjaya307y2ejydheq09cvhj2p4ssgnwcv2apqvryh5e48jt29sr9uy3s3tek3s2e4u6l4
URL
https://gitee.com/temphi/chinese_chess/
https://gitee.com/tangren0526x/zarm/
https://gitee.com/youke0429/leadshop/
https://gitee.com/wul6688/shopsn/
https://gitee.com/zhaol5242/wxGameRank/
https://gitee.com/zhangl5642/aistudio.-wpf.-diagram/
http://ipfs.cf-ipfs.com/ipns/none.sbs/*
https://ipfs.fleek.co/ipns/none.sbs/*
http://cf-ipfs.com/ipns/none.sbs/*
https://none.sbs.ipns.ipfs.overpi.com/*
http://dweb.link/ipns/none.sbs/*
https://gateway.pinata.cloud/ipns/none.sbs/*

Appendix: About the China Internet Cybersecurity Threat Governance Alliance Ransomware Prevention and Response Working Group

The National Cyberspace Administration of China (CNCERT/CC) has partnered with leading domestic security companies to establish the “China Internet Cybersecurity Threat Governance Alliance Ransomware Prevention and Response Professional Working Group” (CCTGA Ransomware Prevention and Response Working Group). The Working Group is working on ransomware prevention and response efforts, including ransomware information notification, intelligence sharing, daily prevention, and emergency response. The Working Group also regularly releases ransomware updates on its official website (https://www.cert.org.cn/publish/main/44/index.html) or WeChat official account (CNCERT).