Skip to content

Instantly share code, notes, and snippets.

@sanmai
Last active June 29, 2017 12:13
Show Gist options
  • Save sanmai/f6af292a99478b6da248bfc68fac9dd0 to your computer and use it in GitHub Desktop.
Save sanmai/f6af292a99478b6da248bfc68fac9dd0 to your computer and use it in GitHub Desktop.
root на Samsung Galaxy S - Android version 2.2 Froyo

Нужно включить отладку по USB:

Settings -> Applications -> Development -> USB debugging

Наш девайс должен быть виден.

$ adb devices
List of devices attached
100044ddd111	device

RageAgainstTheCage.tgz

$ sha1sum RageAgainstTheCage.tgz
e3b1626642bfa723d456bd657e679b667128685f  RageAgainstTheCage.tgz

$ tar xvf RageAgainstTheCage.tgz 
RageAgainstTheCage/
RageAgainstTheCage/exploid2-arm5.bin
RageAgainstTheCage/README
RageAgainstTheCage/rageagainstthecage.c
RageAgainstTheCage/743c.jpg
RageAgainstTheCage/exploid.c
RageAgainstTheCage/exploid2.c
RageAgainstTheCage/no-rocket-science.gif
RageAgainstTheCage/rageagainstthecage-arm5.bin

Исходники можно посмотреть здесь, например.

Поехали...

$ sha1sum rageagainstthecage-arm5.bin
bc41b82ae83661906d7445b5cf451f21f278846a  rageagainstthecage-arm5.bin

$ adb push rageagainstthecage-arm5.bin /data/local/tmp/
[100%] /data/local/tmp/rageagainstthecage-arm5.bin

$ adb shell chmod 0755 /data/local/tmp/rageagainstthecage-arm5.bin
$ adb shell 

На самом девайсе

$ /data/local/tmp/rageagainstthecage-arm5.bin
[*] CVE-2010-EASY Android local root exploit (C) 2010 by 743C

[*] checking NPROC limit ...
[+] RLIMIT_NPROC={2394, 2394}
[*] Searching for adb ...
[+] Found adb as PID 3247
[*] Spawning children. Dont type anything and wait for reset!
[*]
[*] If you like what we are doing you can send us PayPal money to
[*] [email protected] so we can compensate time, effort and HW costs.
[*] If you are a company and feel like you profit from our work,
[*] we also accept donations > 1000 USD!
[*]
[*] adb connection will be reset. restart adb server on desktop and re-login.

Дальше перемонтируем файловую систему:

adb shell mount -o remount,rw $(adb shell mount | grep system | cut -f1-2 -d" ")
adb shell mount | grep system | grep --color rw

Можно скопировать резервный su, а можно не делать:

SuperOneClick/Root$ adb push su-v2 /system/bin/su2
adb shell chmod 4755 /system/bin/su2

Правильней будет скопировать su из комплекта SuperSU:

SuperSU/arm$ adb push su /system/bin/su
adb shell chmod 4755 /system/bin/su

Затем нужно установить SuperSU:

adb install SuperSU-*.apk

Запустить на устройстве и согласиться на обновление su.

Так можно дать временный рут всем, но лучше без:

adb shell chmod 4755 /system/bin/sh

Восстанавливаем всё и убираем лишнее после всех операций:

adb shell su -c "chmod 0755 /system/bin/su2 /system/bin/sh"
adb shell ls -l /system/bin/sh /system/bin/su2 | grep rwx
adb shell rm /data/local/tmp/rageagainstthecage-arm5.bin
adb reboot

Источник вдохновения. Ещё один

После перезагрузки...

Проверим что доступы у нас есть...

$ adb shell su -c id
uid=0(root) gid=0(root)

Должно сначала спросить доступ, затем вывести как выше.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment