New Android spyware LianSpy relies on Yandex Cloud to avoid detection

Pierluigi Paganini August 07, 2024

A previously unknown Android Spyware, dubbed LianSpy, has been targeting Russian users since at least 2021.

In March 2024, cybersecurity researchers from Kaspersky discovered previously unknown Android spyware dubbed LianSpy.

The malware has been active since July 2021, it is designed to capture screencasts, exfiltrate user files, and harvest call logs and app lists. The malware employs various evasion techniques, including using the Russian cloud service Yandex Disk for C2 communications, avoiding dedicated infrastructure to remain undetected.

The spyware is likely deployed through either an unknown vulnerability or direct physical access to the victim’s device.

LianSpy first checks if it has system app status to automatically obtain necessary permissions. If not, it requests permissions for screen overlay, notifications, background activity, contacts, and call logs. Once it has obtained the necessary permissions, it ensures it is not being executed in a controlled environment. If safe, it sets up its configuration with predefined values and stores this information in SharedPreferences for persistence across reboots.

“Once activated, the spyware hides its icon and registers a built-in broadcast receiver to receive intents from the system. This receiver triggers various malicious activities, such as screen capturing via the media projection API, taking screenshots as root, exfiltrating data, and updating its configuration.” reads the published by Kaspersky. “To update the spyware configuration, LianSpy searches for a file matching the regular expression “^frame_.+\\.png$” on a threat actor’s Yandex Disk every 30 seconds. If found, the file is downloaded to the application’s internal data directory. The spyware then decrypts the overlay (data written after the end of the payload) in the downloaded file with a hardcoded AES key.”

The spyware stores victim data collected in the SQL table Con001, which includes the data type and its SHA-256 hash. The encryption process involves generating an AES key with a secure pseudorandom number generator to prevent timing attacks. This AES key is then encrypted using a hardcoded public RSA key embedded in the spyware. Only someone with the corresponding private RSA key can decrypt the stolen data, ensuring strong protection.

LianSpy supports advanced evasion techniques. It disguises itself as a legitimate app like Alipay or system services and can bypass Android 12’s privacy indicators by modifying settings to hide notification icons. It also hides notifications from background services using NotificationListenerService and suppresses status bar notifications with specific phrases.

LianSpy can capture screenshots stealthily using the screencap command with root access, leaving no trace of malicious activity. It relies on cloud and pastebin services to obscure malicious activity and encrypts exfiltrated data to prevent victim identification, even if cloud credentials are compromised. It also gains root access through a modified su binary, suggesting the use of unknown exploits or physical device access for delivery.

The spyware does not use its infrastructure but relies on Yandex Disk for data exfiltration and storing configuration commands. The communication with its C2 server is unidirectional, with the malware handling update checks and data exfiltration on its own. Yandex Disk credentials can be updated via a hardcoded pastebin URL, which may differ among malware variants, and a list of these URLs is included in the IoC section.

“By exclusively leveraging legitimate platforms like Yandex Disk and pastebin services for data exfiltration and C2 communication, the threat actor has complicated attribution.” concludes the report published by Kaspersky. “This novel Android threat exhibits no overlap with ongoing malware campaigns targeting Russian users, and we will maintain vigilant monitoring for related activities.”

Follow me on Twitter:  and  and Mastodon

(SecurityAffairs – hacking, malware)



you might also like

leave a comment