Behind the Scenes: How Criminal Enterprises Pre-infect Millions of Mobile Devices
This talk details the supply chain attack techniques used by the 'Lemon Group' to pre-infect millions of Android devices with malicious implants at the manufacturing level. The researchers analyze how these threat actors leverage compromised firmware, SDKs, and system components to deliver payloads that facilitate fraudulent activities like SMS interception, proxy services, and ad fraud. The presentation highlights the evolution of these threats from simple ROM-based infections to sophisticated, fileless, and modular malware architectures. The analysis provides insights into the threat actor's infrastructure, monetization strategies, and the challenges of attribution in complex supply chain compromises.
The Supply Chain Nightmare: How Pre-Infected Android Devices Are Monetized at Scale
TLDR: Researchers at Black Hat 2023 exposed the "Lemon Group," a sophisticated threat actor that pre-infects millions of Android devices at the manufacturing level. By compromising firmware, SDKs, and system components, they turn consumer hardware into a massive, modular botnet for ad fraud and proxy services. This research proves that even a "factory fresh" device can be a persistent threat, forcing security professionals to rethink trust in mobile hardware.
Supply chain attacks are no longer just about high-profile software updates or compromised CI/CD pipelines. The research presented by Fyodor Yarochkin and Zhengyu Dong at Black Hat 2023 shifts the focus to the most fundamental layer of the mobile ecosystem: the hardware itself. When millions of devices are shipped with malicious implants already baked into the firmware, the traditional perimeter-based security model becomes entirely irrelevant.
The Anatomy of a Pre-Infected Device
The "Lemon Group" operates by infiltrating the manufacturing process, ensuring that malicious code is present before the device ever reaches a consumer. This is not a simple case of a rogue app; it is a deep-seated compromise of the Android system. The researchers identified that these threat actors target the Android Zygote process, which is the parent process for all Android applications. By tampering with system libraries like libandroid_runtime.so, the attackers can inject malicious code into every application that launches on the device.
This technique allows for a modular, fileless architecture. Instead of relying on a single, static binary that could be easily detected by signature-based antivirus, the malware acts as a loader. It fetches additional "plugins" from a Command and Control (C2) server, which are then executed in memory. This modularity is the key to their longevity. They can push updates, change their monetization strategy, or pivot to new fraudulent activities without ever needing to re-infect the device.
Technical Execution: From Zygote to Proxy
The mechanical brilliance of this implant lies in its ability to hook into standard Android functions. For instance, the researchers demonstrated how the malware hooks print_learn_native to intercept execution flows. Once the loader is active, it communicates with the C2 server to receive a list of tasks. These tasks are essentially instructions for the various plugins, which are downloaded as encrypted ZIP files and decrypted in memory.
One of the most lucrative plugins identified is the proxy provider. This plugin transforms the infected device into a residential proxy node. The C2 server sends a task containing the server IP, port, and a timeout duration. The device then connects to a public server to establish a reverse proxy. This allows the threat actor to sell access to these devices to third parties who need residential IP addresses to bypass geo-blocking or rate-limiting on platforms like OWASP's list of common web vulnerabilities.
The code snippet below illustrates the logic used to hook the com.android.phone process to intercept sendBroadcast events, which is a common method for SMS interception:
// Simplified representation of the hooking logic
hook("com.android.phone", "sendBroadcast", (args) -> {
// Intercept SMS broadcast to exfiltrate data
if (isSMSBroadcast(args)) {
String smsContent = extractSMS(args);
sendToC2(smsContent);
}
});
Real-World Impact for Security Researchers
For a pentester or a bug bounty hunter, this research changes the threat model for mobile assessments. If you are testing an application on a device that has been pre-infected, your entire environment is compromised. The malware can intercept your traffic, manipulate the application's behavior, or exfiltrate sensitive data from the device's storage.
During an engagement, you should be looking for anomalous network traffic originating from system processes. If you see a device making frequent, encrypted connections to unknown domains—especially those that don't align with standard Google or OEM update services—you might be looking at a supply chain implant. Tools like Frida are essential here to inspect the runtime behavior of these system processes and identify hooks that shouldn't be there.
Defensive Realities
Defending against this level of compromise is notoriously difficult because the threat exists below the application layer. Standard mobile device management (MDM) solutions often lack the visibility to detect firmware-level tampering. The most effective defense is a rigorous NVD vulnerability scan of the device's firmware version, combined with network-level monitoring that flags suspicious C2 communication patterns. If you are an enterprise, you must assume that the hardware you purchase is not inherently secure and implement zero-trust network access (ZTNA) to isolate mobile devices from sensitive internal resources.
Attribution in these cases is a game of cat and mouse. The Lemon Group, like many other sophisticated actors, constantly evolves its infrastructure to evade detection. They use domain fronting, rotate C2 servers, and even share infrastructure with other groups like Triada to maintain their operations. When you expose one of their front-end portals, they simply rebrand and move to a new domain.
Security researchers must stop treating mobile devices as black boxes. The next time you perform a mobile assessment, consider the possibility that the device itself is the adversary. The supply chain is the new front line, and the battle is happening in the firmware.
Vulnerability Classes
Tools Used
Target Technologies
Attack Techniques
OWASP Categories
Up Next From This Conference

A New Attack Interface In Java Applications

Inference Attacks on Endpoint Privacy Zones in Fitness Tracking Social Networks

Abusing Azure Active Directory: From MFA Bypass to Listing Global Administrators
Similar Talks

Inside the FBI's Secret Encrypted Phone Company 'Anom'

Hacking Apple's USB-C Port Controller

