Linux下zergRush给Android2.3.6(ME865)获取root权限

昨天跟金华同学在大学城寻找新片景点,在路上,遇到一棵骨骼精奇的植物。掏出手机拍下以记之!


按照我的个人习惯,使用Linux系统喜欢用root,主要是方便干活。所以,拿到了新手机,不用root权限,怎么去深入探究它系统的工作原理呢?

下面马上动手,使用国外大牛利用系统bug写的获取root权限的程序。

1. 下载工具

su,Superuser.apk,提权程序zerg

各程序的用途:

su:切换用户运行进程。
Superuser.apk:在Android上管理具有root权限的应用程序。
zerg:使用系统漏洞获取root权限,有兴趣的朋友可以研究github上的源代码 https://github.com/revolutionary/zergRush/blob/master/zergRush.c

我尝试使用新版的zergRush,但是失败了 🙁 为了不误导后人,我这里只给出成功的方案。

2. 设置调试模式

打开在手机上的“设置->应用程序->开发->USB调试”,同时开启“设置->应用程序->未知源”。使用USB接入电脑,USB连接模式选择“仅充电”。

3. 复制文件

在终端里切换到工具目录下。首先,检查设备是否已连接。

root@xiaoxia-pc:/media/Data/moto/Exploit# adb devices
List of devices attached
0149BD1711001013 device

从PC上复制所需的3个文件到设备上,例如/data/local目录下。

root@xiaoxia-pc:/media/Data/moto/Exploit# ls
su Superuser.apk zerg
root@xiaoxia-pc:/media/Data/moto/Exploit# adb push zerg /data/local
505 KB/s (22776 bytes in 0.043s)
root@xiaoxia-pc:/media/Data/moto/Exploit# adb push su /data/local
561 KB/s (22228 bytes in 0.038s)
root@xiaoxia-pc:/media/Data/moto/Exploit# adb push Superuser.apk /data/local
3339 KB/s (754980 bytes in 0.220s)

4. 获取root权限

连接远程shell,设置文件为可执行。

root@xiaoxia-pc:/media/Data/moto/Exploit# adb shell
shell@edison:/$ cd /data/local
shell@edison:/data/local$ chmod 777 zerg

运行zerg,围观攻击结果。

shell@edison:/data/local$ ./zerg

[**] Zerg rush – Android 2.2/2.3 local root
[**] (C) 2011 Revolutionary. All rights reserved.

[**] Parts of code from Gingerbreak, (C) 2010-2011 The Android Exploid Crew.

[+] Found a GingerBread ! 0x00016118
[*] Scooting …
[*] Sending 149 zerglings …
[*] Sending 189 zerglings …
[+] Zerglings found a way to enter ! 0x18
[*] Sending 189 zerglings …
[*] Trying a new path …
[*] Sending 189 zerglings …
[*] Trying a new path …
[*] Sending 189 zerglings …
[*] Trying a new path …
[*] Sending 189 zerglings …
[+] Zerglings caused crash (good news): 0x40122c5c 0x0074
[*] Researching Metabolic Boost …
[+] Speedlings on the go ! 0xafd25ac9 0xafd397f7
[*] Sending 185 zerglings …

[+] Rush did it ! It’s a GG, man !
[+] Killing ADB and restarting as root… enjoy!
root@xiaoxia-pc:/media/Data/moto/Exploit#

成功获取root权限并且切断了adb连接。重新运行adb shell,就应该变为root了。

root@xiaoxia-pc:/media/Data/moto/Exploit# adb shell
root@edison:/#

提示符从$变为#。(如果没有#,提权失败。)

5. 安装su,Superuser.apk

把文件系统挂载为可写入。

root@edison:/# mount -o rw,remount /dev/null /system

复制su,Superuser到安装目录。不知道为何,我这里复制文件不可以用cp,只能用cat?

root@edison:/# cat /data/local/su > /system/bin/su
root@edison:/# cat /data/local/Superuser.apk > /system/app/Superuser.apk
root@edison:/# chmod 4755 /system/bin/su
root@edison:/# chmod 4755 /system/app/Superuser.apk

重启手机。话说,用reboot命令重启很快,屏幕一下子就黑了。

root@edison:/# reboot

6. 效果

重启手机后,可以使用adb连接shell,然后测试su命令是否可以使用!

root@xiaoxia-pc:/media/Data/moto/Exploit# adb shell
shell@edison:/$ su

Superuser.apk提示

允许之后,shell得到root权限。可以做任何事情了!

root@edison:/#

此次root是为了下次我在Android2.3建立VPN(类似Android4.0的VpnService.Builder实现的功能)提供环境基础。

参考资料:

http://forum.xda-developers.com/showthread.php?t=1327741

Linux下zergRush给Android2.3.6(ME865)获取root权限》有14个想法

      1. Blackrose

        meego看起来正统些,ui也不比android的ui差,java的界面感觉很慢呀。好像不多,目前能买的也就N9了

        回复
  1. ME865 ROOT这么麻烦啊?还是HTC好…
    说起来,N9的MeeGo才是纯正的Linux啊,安装QQ都可以用apt-get install QQ命令的,我好喜欢…

    回复

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据