其他
【Android改机系列】一键新机原理剖析
一个改机案例:
6月份拿到一个口碑不错的商业改机案例,该案例只能运行在指定的手机,指定的rom,号称各大App无法检测,免root的改机框架。
我手上只有nexus6p,安装到手机上跑了一下,瞬间闪退,没有任何崩溃日志。但是这条日志出卖了它:
静态分析
解密字符串重打包
invoke-static {vX}, Lcom/test/decString(Ljava/lang/String;)Ljava/lang/String;
move-result-object vX
try {
DataInputStream is = new DataInputStream(new ByteArrayInputStream(Base64.decode(oriSign, 0)));
byte[][] sign2 = new byte[(is.read() & 255)][];
for (int i = 0; i < sign2.length; i++) {
sign2[i] = new byte[is.readInt()];
is.readFully(sign2[i]);
}
Class<?> activityThreadClass = Class.forName("android.app.ActivityThread");
Object currentActivityThread = activityThreadClass.getDeclaredMethod("currentActivityThread", new Class[0]).invoke(null, new Object[0]);
Field sPackageManagerField = activityThreadClass.getDeclaredField("sPackageManager");
sPackageManagerField.setAccessible(true);
Object sPackageManager = sPackageManagerField.get(currentActivityThread);
Class<?> iPackageManagerInterface = Class.forName("android.content.pm.IPackageManager");
this.base = sPackageManager;
this.sign = sign2;
this.appPkgName = context.getPackageName();
Object proxy = Proxy.newProxyInstance(iPackageManagerInterface.getClassLoader(), new Class[]{iPackageManagerInterface}, this);
sPackageManagerField.set(currentActivityThread, proxy);
PackageManager pm = context.getPackageManager();
Field mPmField = pm.getClass().getDeclaredField("mPM");
mPmField.setAccessible(true);
mPmField.set(pm, proxy);
Log.i(TAG,"PmsHook success.");
} catch (Exception e) {
Log.e(TAG,"PmsHook failed.");
e.printStackTrace();
}
}
过授权、签名校验、系统认证、登录
新机原理
绝杀技一:免root Hook
绝杀技二:全面Hook Android设备信息接口
绝杀技三:伪造真实用户活动
绝杀技四:基站、gps、ip位置一致
绝杀技五:SysPropertyHook
新机流程
准备新机设备信息PhoneInfo
完成Hook
- End -
看雪ID:seandong
https://bbs.pediy.com/user-766159.htm
本文由看雪论坛 seandong 原创
转载请注明来自看雪社区
往期热门回顾
1、Windows Kernel Exploit 内核漏洞学习(3)-任意内存覆盖漏洞
﹀
﹀
﹀
公众号ID:ikanxue
官方微博:看雪安全
商务合作:wsc@kanxue.com
↙点击下方“阅读原文”,查看更多干货