Virtualization-Based Malware: The Stealth Threatening Banking Apps
The mobile banking threat landscape is rapidly evolving. While traditional detection techniques like root detection, emulator checks, and certificate pinning provide baseline security, a more advanced and stealthier threat has emerged: virtualization-based malware.
Get Sanadhyakaushik’s stories in your inbox
Join Medium for free to get updates from this writer.
In this blog post, we explore:
- What virtualization-based malware is
- How attackers use it to bypass security controls
- Technical deep-dive into frameworks like VirtualApp, Replugin, and EpicC
- Real-world malware examples
- Defensive strategies for banking apps
🧨 What Is Virtualization-Based Malware?
Virtualization-based malware runs the victim banking app inside a virtual container or sandbox — typically using an app-level or user-mode virtualization layer — allowing attackers to:
- Clone and isolate legitimate apps
- Hook sensitive APIs like
getText(),onKeyUp(),WebView.loadUrl() - Observe UI flows, extract OTPs, manipulate transactions
- Remain undetected by root/jailbreak/emulator detection logic
🧪 How It Works
🔹 Step 1: Attacker Installs a Virtual Container App
Tools/frameworks commonly used:
- VirtualApp — Open-source Android container that allows launching and injecting other apps
- Replugin, VMOS, SandVXposed — For systemless, Xposed-based virtualization
- EpicC — Class loader hijacking + app virtualization for Java-level injection
These frameworks simulate a parallel Android environment.
🔹 Step 2: Banking App is Loaded Inside the Virtualized Context
The attacker or malware drops the original APK or clones it via:
virtualCore.installPackage(apkPath);
virtualCore.launchApp(packageName);🔹 Step 3: Hooking Internal Methods
Inside the virtual context, the attacker hooks sensitive methods using:
XposedHelpers.findAndHookMethod(
"android.widget.EditText",
lpparam.classLoader,
"getText",
new XC_MethodHook() {
protected void afterHookedMethod(MethodHookParam param) {
CharSequence text = (CharSequence) param.getResult();
Log.d("StolenText", text.toString());
}
});These hooks can be used to steal:
- Usernames and passwords
- OTPs
- Card numbers
- Transaction data
🔹 Step 4: UI Automation or Replay
To automate fraud or simulate legitimate user behavior, attackers use:
- Accessibility APIs
- Monkey scripts
- ADB shell commands inside virtualized environments
- Custom gesture emulators
🧠 Real-World Malware Using Virtualization
📌 Case Study 1: Teabot
- Delivered via trojanized dropper apps
- Uses
VirtualAppto launch banking apps and capture credentials - Injects overlays via accessibility service
📌 Case Study 2: Godfather Trojan
- Runs inside virtual emulators
- Fakes system environment (e.g., spoofed location, battery, Wi-Fi)
- Uses class loaders to hook dynamic banking targets
📌 Case Study 3: Nerbian Banker
- Ships with its own VM layer
- Bypasses biometric authentication via app injection
- Captures WebView DOM for browser-based banking sessions
🛡️ Why Traditional Defenses Fail
Defense MechanismWhy It Fails Under VirtualizationRoot/Jailbreak DetectionVirtual environment is clean OSEmulator DetectionTools like qemu, ro.hardware bypassed/spoofedDevice AttestationBasic attestation is not hardware-boundSSL PinningHooked with Frida or bypassed in proxy layerInput ObfuscationAccessibility APIs bypass visual-only protections
🔐 Detection and Mitigation
✅ 1. Hardware-Based Attestation
Use Google Play Integrity API with hardware-backed enforcement, or Apple DeviceCheck with server-side validation.
// Check profileMatch field strictly
if (!response.profileMatch) {
rejectRequest("Environment spoofed");
}✅ 2. Environment Fingerprinting
Collect and validate:
- Sensor readings (accelerometer, magnetometer noise)
- Battery drain rate
- Unusual uptime
- Emulator artifacts like
/dev/qemu_pipe,ro.product.manufacturer=unknown
✅ 3. Behavioral Biometrics
Measure:
- Typing patterns
- Touch pressure
- Swipe velocity
- App interaction timelines
Virtual environments often fail to generate natural interaction patterns.
✅ 4. RASP (Runtime Application Self-Protection)
Detect:
- Reflection-based class loading
- Method hooking
- Xposed/Frida/VirtualApp signatures
Sample detection code:
public static boolean isRunningInVirtualApp() {
String processName = ActivityManager.getRunningAppProcessInfo().processName;
return processName.contains("com.lody.virtual") || processName.contains("vmos");
}✅ 5. Session Risk Scoring
Combine:
- Geolocation
- IP reputation
- Time of day
- Typing speed
- Device model consistency
📈 Conclusion
Virtualization-based malware is post-root era malware — it doesn’t need deep system access to wreak havoc. For mobile banking apps, the future of fraud will be sandbox-based, stealthy, and automated.
To stay ahead, developers and security teams must go beyond traditional threat models and understand the execution context, not just app code or root status.





