HiddenWasp Linux Malware
Original Issue Date:-
June 06, 2019
It has been observed that a new malware named as “HiddenWasp” targeting Linux operating systems is spreading. The malware focuses primarily on gaining remote access of the infected hosts making it different from other Linux malwares which aims crypto-mining or DDoS activity. The infection vector used by the malware is not known. The malware is capable of performing the following functions:
- Gaining remote access to the infected machine.
- Evade detection from variety of antivirus solutions.
- Uses malicious code from other known malwares namely Azael Rootkit and Mirai.
- Update existing versions of HiddenWasp on the compromised machine
- Make network connections to download other malwares.
- Make use of rootkits, Trojan implants and creation of ftp user account to maintain persistence in the system.
The malware is a combined package of various open source malwares such as an initial deployment script for downloading other malwares along with updating existing threats, a rootkit using Mirai code to hook into several functions and a Trojan having features of Azael rootkit that worked with the rootkit to remain operational. Also, similarities have been found in the HiddenWasp malware and other Linux malware named as Winnti malware.
Malware start its activities by execution of the initial deployment script which contains a code to create a user named as “sftp” on the compromised system with hardcoded password to maintain attacker’s access to infected machine even after the malware detection and cleanup. It is shown as below:
Thereafter the malware connects to remote server to download a tar file containing a full malware configuration package and then perform its other activities. The working of the malware is as follows:
Indicators of Compromise:
Command and Control server:
URLs downloading malicious script:
- hxxp:// 103.206.xx.xx /configUpdate.tar.gz
- hxxp:// 103.206.xx.xx /configUpdate-32.tar.gz
Best Practices and Recommendations:
- Check for the indicators of compromise associated with the malware and block command and control domain and IP addresses at security perimeter devices.
- Execute YARA rules against in-memory artifacts in order to be able to detect trojan implants.
- To check if your system is infected, search for “ld.so” files — if any of the files do not contain the string ‘/etc/ld.so.preload’, your system may be compromised. This is because the Trojan implant will attempt to patch instances of ld.so in order to enforce the LD_PRELOAD mechanism from arbitrary locations.
- Restrict Web Management Interface access of IoT devices to authorized users only and change default username/passwords
- Always change Default login credentials before deployment in production.
- Change default credentials at device startup and ensure that passwords meet the minimum complexity.
- Disable Universal Plug and Play (UPnP) on IoT devices unless absolutely required.
- Users should be aware of the installed devices and their capabilities. If a device comes with a default password or an open Wi-Fi connection, users should change the password and only allow it to operate on a home network with a secured Wi-Fi router.
- Control access to the devices with Access List
- Configure devices to "lock" or log out and require a user to re-authenticate if left unattended
- Identify systems with default passwords and implement abovementioned measures. Some the systems that need to examined are Routers, switches, web applications and administrative web interfaces, ICS systems, Telnet and SSH interfaces
- Implement account lockout policies to reduce the risk of brute forcing attacks.
- Telnet and SSH should be disabled on device if there is no requirement of remote management
- Configure VPN and SSH to access device if remote access is required.
- Configure certificate based authentication for telnet client for remote management of devices
- Implement Egress and Ingress filtering at router level.
- Report suspicious entries in Routers to your Internet Service Provider
- Keep up to date Antivirus on the computer system
- Keep up-to-date on patches and fixes on the IoT devices, operating system and applications.
- Unnecessary port and services should be stopped and closed.
- Logging must be enabled on the device to log all the activities.
- Enable and monitor perimeter device logs to detect scan attempts towards critical devices/systems