首页
社区
课程
招聘
Xposed检测绕过
发表于: 2022-1-30 12:58 18011

Xposed检测绕过

2022-1-30 12:58
18011

分享一些Xposed检测绕过的总结,很多加壳软件检测到xposed就会杀死当前软件进程。。。

1.绕过jar Class检测

2.绕过堆栈检测

3.绕过包名检测

4.绕过jar文件检测:

5.绕过maps检测

6.绕过vxp检测

7.绕过SO检测

8.绕过ClassPath检测

9.检测缓存

 
// 过防止调用loadClass加载 de.robv.android.xposed.
        XposedHelpers.findAndHookMethod(ClassLoader.class, "loadClass", String.class, new XC_MethodHook() {
            @Override
            protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                if(param.args != null && param.args[0] != null && param.args[0].toString().startsWith("de.robv.android.xposed.")){
 
                    // 改成一个不存在的类
                    param.args[0] = "de.robv.android.xposed.ThTest";
                }
 
                super.beforeHookedMethod(param);
            }
        });
// 过防止调用loadClass加载 de.robv.android.xposed.
        XposedHelpers.findAndHookMethod(ClassLoader.class, "loadClass", String.class, new XC_MethodHook() {
            @Override
            protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                if(param.args != null && param.args[0] != null && param.args[0].toString().startsWith("de.robv.android.xposed.")){
 
                    // 改成一个不存在的类
                    param.args[0] = "de.robv.android.xposed.ThTest";
                }
 
                super.beforeHookedMethod(param);
            }
        });
XposedHelpers.findAndHookMethod(StackTraceElement.class, "getClassName", new XC_MethodHook() {
            @Override
            protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                String result = (String) param.getResult();
                if (result != null){
                    if (result.contains("de.robv.android.xposed.")) {
                        param.setResult("");
                        // Log.i(tag, "替换了,字符串名称 " + result);
                    }else if(result.contains("com.android.internal.os.ZygoteInit")){
                        param.setResult("");
                    }
                }
 
                super.afterHookedMethod(param);
            }
        });
XposedHelpers.findAndHookMethod(StackTraceElement.class, "getClassName", new XC_MethodHook() {
            @Override
            protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                String result = (String) param.getResult();
                if (result != null){
                    if (result.contains("de.robv.android.xposed.")) {
                        param.setResult("");
                        // Log.i(tag, "替换了,字符串名称 " + result);
                    }else if(result.contains("com.android.internal.os.ZygoteInit")){
                        param.setResult("");
                    }
                }
 
                super.afterHookedMethod(param);
            }
        });
findAndHookMethod("android.app.ApplicationPackageManager", lpparam.classLoader, "getInstalledApplications", int.class, new XC_MethodHook() {
            @SuppressWarnings("unchecked")
            @Override
            protected void afterHookedMethod(MethodHookParam param) throws Throwable { // Hook after getIntalledApplications is called
                if (debugPref) {
                    XposedBridge.log("Hooked getInstalledApplications");
                }
 
                List<ApplicationInfo> packages = (List<ApplicationInfo>) param.getResult(); // Get the results from the method call
                Iterator<ApplicationInfo> iter = packages.iterator();
                ApplicationInfo tempAppInfo;
                String tempPackageName;
 
 
                // Iterate through the list of ApplicationInfo and remove any mentions that match a keyword in the keywordSet
                while (iter.hasNext()) {
                    tempAppInfo = iter.next();
                    tempPackageName = tempAppInfo.packageName;
                    if (tempPackageName != null && tempPackageName.equals("de.robv.android.xposed.installer")) {
                        iter.remove();
                        if (debugPref) {
                            XposedBridge.log("Found and hid package: " + tempPackageName);
                        }
                    }
                }
 
                param.setResult(packages); // Set the return value to the clean list
            }
        });
findAndHookMethod("android.app.ApplicationPackageManager", lpparam.classLoader, "getInstalledApplications", int.class, new XC_MethodHook() {
            @SuppressWarnings("unchecked")
            @Override
            protected void afterHookedMethod(MethodHookParam param) throws Throwable { // Hook after getIntalledApplications is called
                if (debugPref) {
                    XposedBridge.log("Hooked getInstalledApplications");
                }
 
                List<ApplicationInfo> packages = (List<ApplicationInfo>) param.getResult(); // Get the results from the method call
                Iterator<ApplicationInfo> iter = packages.iterator();
                ApplicationInfo tempAppInfo;
                String tempPackageName;
 
 
                // Iterate through the list of ApplicationInfo and remove any mentions that match a keyword in the keywordSet
                while (iter.hasNext()) {
                    tempAppInfo = iter.next();
                    tempPackageName = tempAppInfo.packageName;
                    if (tempPackageName != null && tempPackageName.equals("de.robv.android.xposed.installer")) {
                        iter.remove();
                        if (debugPref) {
                            XposedBridge.log("Found and hid package: " + tempPackageName);
                        }
                    }
                }
 
                param.setResult(packages); // Set the return value to the clean list
            }
        });
Constructor<?> constructLayoutParams = findConstructorExact(java.io.File.class, String.class);
        XposedBridge.hookMethod(constructLayoutParams, new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
            @Override
            protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                if (param.args[0] != null) {
                    if (debugPref) {
                        XposedBridge.log("File: Found a File constructor: " + ((String) param.args[0]));
                    }
                }
 
                if (isRootCloakLoadingPref) {
                    // RootCloak is trying to load it's preferences, we shouldn't block this.
                    return;
                }
                if (((String) param.args[0]).contains("XposedBridge")) {
                    if (debugPref) {
                        XposedBridge.log("File: Found a File constructor with word super, noshufou, or chainfire");
                    }
                    param.args[0] = "/system/app/" + FAKE_FILE;
                }
            }
        });
Constructor<?> constructLayoutParams = findConstructorExact(java.io.File.class, String.class);
        XposedBridge.hookMethod(constructLayoutParams, new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
            @Override
            protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                if (param.args[0] != null) {
                    if (debugPref) {
                        XposedBridge.log("File: Found a File constructor: " + ((String) param.args[0]));
                    }
                }
 
                if (isRootCloakLoadingPref) {
                    // RootCloak is trying to load it's preferences, we shouldn't block this.
                    return;
                }
                if (((String) param.args[0]).contains("XposedBridge")) {
                    if (debugPref) {
                        XposedBridge.log("File: Found a File constructor with word super, noshufou, or chainfire");
                    }
                    param.args[0] = "/system/app/" + FAKE_FILE;
                }
            }
        });
XposedHelpers.findAndHookConstructor("java.io.FileReader",lpparam.classLoader ,String.class , new XC_MethodHook() {
          @Override
          protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
              String arg0 = (String) param.args[0];
              if(arg0.toLowerCase().contains("/proc/")){
                  param.setResult(null);
              }
          }
      });
XposedHelpers.findAndHookConstructor("java.io.FileReader",lpparam.classLoader ,String.class , new XC_MethodHook() {
          @Override
          protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
              String arg0 = (String) param.args[0];
              if(arg0.toLowerCase().contains("/proc/")){
                  param.setResult(null);
              }
          }

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 6
支持
分享
最新回复 (10)
雪    币: 198
活跃值: (616)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
学习了
2022-1-30 18:55
0
雪    币: 199
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
3
666
2022-3-8 14:49
0
雪    币: 29
活跃值: (5647)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
你这绕过简直就在小瞧天下人
2022-3-8 15:33
0
雪    币: 7201
活跃值: (21965)
能力值: ( LV12,RANK:550 )
在线值:
发帖
回帖
粉丝
5
支持支持
2022-3-8 15:56
0
雪    币: 18
活跃值: (87)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
感谢感谢
2022-4-5 19:38
0
雪    币: 300
活跃值: (219)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
实测无效
2022-4-12 16:25
0
雪    币: 514
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
8
有的app不杀死进程  但是hook注入不进去。
2022-7-25 20:02
0
雪    币: 4700
活跃值: (3688)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
学习到了
2023-2-22 22:44
0
雪    币: 0
活跃值: (308)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
.绕过jar文件检测:中的isRootCloakLoadingPref  在哪里获取  
FAKE_FILE值是什么!?
2023-12-14 15:42
0
雪    币: 859
活跃值: (915)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11
Shamiko  隐藏应用列表  这些要是能完全隐藏    不就不怕被检测了么
2023-12-18 18:46
0
游客
登录 | 注册 方可回帖
返回
//