このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


安全 研究 by Dan Rosenberg

It's Bugs All the Way 負かす/撃墜する

安全 研究 by Dan Rosenberg

やじ the Sony Tablet S

After getting a taste of やじ tablets with the Lenovo Thinkpad tablet, I decided to turn my attention to the Sony Tablet S. It turned out to be a 堅い 装置 to root.

The Bug

The Sony Tablet S has a logging service running as root 指名するd nfx_log_service. This service 持続するs on-disk backups of the Android logcat 衝撃を和らげるものs in the /スピードを出す/記録につける directory. This directory is group-writable and group “スピードを出す/記録につける”, which is 認めるd to the アジア開発銀行 爆撃する, so we can 修正する とじ込み/提出するs in this directory.

The logging service uses predictable filenames for its 生産(高). 特に, “Kernel.txt”, “AndroidMain.txt”, “AndroidEvent.txt”, and “AndroidRadio.txt” are used. As you might 推定する/予想する, by 取って代わるing these とじ込み/提出するs with 象徴的な links, it’s possible to 原因(となる) the logging service to either create a new とじ込み/提出する 含む/封じ込めるing the contents of the appropriate スピードを出す/記録につける 衝撃を和らげるもの, or if the symlink is in place at boot time, append the appropriate スピードを出す/記録につける 衝撃を和らげるもの to an 存在するing とじ込み/提出する. These とじ込み/提出するs are created as root:root 0644, so once they are created we do not have the ability to 支配(する)/統制する their contents.

The Goal

普通は, I’d go straight for victory by creating a symlink at one of the logfile 場所s (I chose “/スピードを出す/記録につける/AndroidRadio.txt“) to /data/地元の.支え(る) and 令状ing “ro.kernel.qemu=1″ a whole bunch of times to the 無線で通信する スピードを出す/記録につける. This would 原因(となる) /data/地元の.支え(る) to be created 含む/封じ込めるing the ro.kernel.qemu 所有物/資産/財産, so that when I reboot the 装置 アジア開発銀行 runs as root and it’s game over.

Unfortunately, that doesn’t やめる work here. The Sony Tablet S already has a /data/地元の.支え(る) とじ込み/提出する, and worse, it’s 現実に a symlink to /configs/地元の.支え(る). Since /configs is a read-only mountpoint, we won’t be able to overwrite this とじ込み/提出する. However, if we could 除去する the 存在するing /data/地元の.支え(る), we could create a new とじ込み/提出する there that 始める,決めるs the ro.kernel.qemu 所有物/資産/財産 and 許すs us to 勝利,勝つ. But how can we use our logger vulnerability to 除去する a とじ込み/提出する?

Trickiness

It turns out the Android 一括 経営者/支配人 has an 利益/興味ing 行為. 一括s have data directories at /data/data/[一括]/. Ordinary 一括s have a lib directory in the data directory for native libraries. However, system 一括s (like the ones 任命する/導入するd by Google or the OEM, in this 事例/患者 Sony) are not 推定する/予想するd to have libraries in this directory. If any system 一括 has とじ込み/提出するs in its /data/data/[一括]/lib/ directory, those とじ込み/提出するs are 削除するd on boot by the 一括 経営者/支配人. Interestingly, this 含むs に引き続いて symlinks. So if we can somehow 原因(となる) a system 一括’s data folder to 含む/封じ込める a symlink at /data/data/[一括]/lib that points to /data, then the /data directory will be erased on boot, wiping out /data/地元の.支え(る) and 許すing us to create a new one and 伸び(る) root.

Android 装置s 含む/封じ込める a program called “run-as” that 許すs the アジア開発銀行 爆撃する to assume the 特権s of any 使用/適用 that is 示すd as “debuggable”. This is 決定するd by checking the /data/system/一括s.名簿(に載せる)/表(にあげる) とじ込み/提出する, which 含む/封じ込めるs a 名簿(に載せる)/表(にあげる) of 一括s, their uids, the debuggable 旗, and their data directories. For the 偉業/利用する, we can 選ぶ any system 使用/適用 – I chose com.google.android.場所.

We can use our logging vulnerability by creating a symlink at /スピードを出す/記録につける/AndroidRadio.txt that points to /data/system/一括s.名簿(に載せる)/表(にあげる), rebooting the 装置, and running a program that スピードを出す/記録につけるs 一括s.名簿(に載せる)/表(にあげる) lines for a 偽の 使用/適用 that’s 示すd as debuggable with the same uid as this system 使用/適用. For example, I used:


com.pwn.me 10026 1 /data/data/com.google.android.場所

In this 事例/患者, 10026 was the uid of com.google.android.場所. This might 変化させる based on 装置. At this point, the logging service appends this line to 一括s.名簿(に載せる)/表(にあげる), and we can “run-as com.pwn.me”, at which point we have the 特権s of our system 一括. We can then 取って代わる the system 一括’s lib directory with a symlink to /data, reboot the 装置, 偉業/利用する the logger again to create a fresh /data/地元の.支え(る) 含む/封じ込めるing the line “ro.kernel.qemu=1″, and reboot again, at which point アジア開発銀行 is running as root and we can 任命する/導入する su and Superuser.

The Final 製品

A script that 自動化するs these steps on Windows is 利用できる here. To run it, 確実にする your 装置 is in USB debugging 方式, connect it 経由で USB, 抽出する the zip, and run “run.bat”. Enjoy!

If you were 伴う/関わるd in raising a bounty for this 偉業/利用する, 寄付s can be made below.









This 入ること/参加(者) was 地位,任命するd on Wednesday, February 8th, 2012 at 2:43 pm and is とじ込み/提出するd under Android, 開発/利用. You can follow any 返答s to this 入ること/参加(者) through the RSS 2.0 料金d. Both comments and pings are 現在/一般に の近くにd.