The Cybersecurity and Infrastructure Security Agency (CISA), USA, has put out a script to retrieve VMware ESXi servers that were encrypted in the recent widespread ESXiArgs ransomware attacks.
ESXiArgs-Recover can help regain access to virtual machines (VM) and several files. Since the effectiveness of the recovery script cannot be confirmed on all systems, the tool can help reconstruct virtual machine metadata from virtual disks that were not impacted by the ransomware ESXiArgs.
A widespread ESXiArgs ransomware attack that started last Friday has been aimed at exposed VMware ESXi servers, with 2,800 servers being encrypted since. Agenzia per la Cybersicurezza Nazionale (ACN), Italy’s national cybersecurity agency, issued a global warning about a massive ransomware attack on Sunday.
CISA’s Recovery Script ESXiArgs-Recover
Cybersecurity & Infrastructure Security Agency (CISA) made the ESXiArgs-Recover recovery script available on February 7. Inputs from third-party researchers and tutorials by Enes Sonmez were added to it. The ransomware recovery script can be applied as follows:
- Downloading and saving the recovery script as /tmp/recover.sh
- Allow the permission to execute the script: chmod +x/tmp/recover.sh
- Run 1s /vmfs/volumes/datastore1 to browse and decrypt folders
- Run 1s to view files to make a note of the VM.
- Adding the name of the virtual machine in the name here – /tmp.recover.sh [name], run this CISA recovery script.
After running the ransomware recovery script, one will know whether the virtual machine can be recovered or not. If the ESXiArgs-Recover script runs successfully, one will need to re-register the virtual machine.
To remove the ransom note, move it to the ransom.html file and regain access to the ESXi web interface, the following steps is advised:
- Run: cd /usr/lib/vmware/hostd/docroot/ui/ & mv index.html ransom.html & mv index1.html index.html
- Run: cd /usr/lib/vmware/hostd/docroot & mv index.html ransom.html & rm index.html & mv index1.html index.html
- Reboot the ESXi server to navigate to the web surface minutes after.
- Navigate to the virtual machines page in the ESXi web interface
- If the restored virtual machine already exists, unregister it by right-clicking on the VM and selecting Unregister.
- Next, click on Create/ Register VM.
- Choose: Register an existing virtual machine
- To access the restored VM folder, click: Select one or more virtual machines, a datastore or a directory
- Select the vmx file from the folder.
- Click Next > Finish. This will allow complete access to the virtual machine.
This CISA recovery script ESXiArgs-Recover was made available without any warranty and understanding of the application of the script is expected on the part of the engineer.
The ransomware attack using an old vulnerability
This ransomware attack includes two files named encrypt.sh, a shell script and encrypt, an ELF executable to encrypt the files.
The shell script looks for all the .log files in the root directory to delete them. This also erases the traces of the ransomware to evade detection. This was found by the Cyble Research & Intelligence Labs (CRIL) researchers from the sample hash: (SHA256), 11b1b2375d9d840912cfd1f0d0d04d93ed0cddb0ae4ddb550a5b62cd044d6b66.
The team discovered that the malicious file was a 64-bit gcc compiled ELF binary as the image below:
Previously known vulnerabilities are exploited to cause severe damage to infrastructure and routine operations. New vulnerabilities remain the focal point in ensuring the highest security in software to avoid exploitation however, it is just as crucial to patch all the vulnerabilities in the system that may be using an older version of the software.