As you might have seen on Wired or Engadget, we were poking around on the pre-release EVO from Google I/O and managed to get root access to it before it had been shipped. You might remember my blurrycam video of the event:
We didn’t mention how we did it at the time, only that we exploited a serious vulnerability and recommended other users root their phones. Now that Sprint’s patch has been out in the wild for a while and everyone has updated, we’re releasing more details on what the security vulnerability is.
The first step of rooting any phone is taking stock of what’s on the device and doing a cursory check of whether you can use it to elevate permissions. This means running a shell on the device and poring over ls -l in every directory.
On the EVO I received from I/O, there was a file named “skyagent” in the /system/bin directory of the device. This file was also present in the latest, shipped firmware in Sprint HTC Hero phones. When we started poking at it, we discovered that not only would it let us get root, but it was effectively a backdoor into the device that allowed external users to peek and poke input, dump the contents of the screen and run arbitrary programs. Not only that, but the program listened on every interface, meaning external users could spy remotely on the device. We weren’t able to determine if the program could be launched remotely, but once it was launched, it was a very effective back door.
We disclosed this to Sprint quickly after finding it. They were very responsive and rolled it into a patch that they released alongside the EVO’s launch.
We’re still not sure what this program was doing on the device at launch. One theory is that it’s a test program, designed to provide input and output for automated testing on real devices. Another theory is that it’s a law-enforcement or three-letter-agency wiretap program for capturing communication. Yet another is that it was placed there by a rogue employee as a plain, malicious backdoor. There’s not enough evidence to determine which (if any) of the theories is correct and Sprint hasn’t disclosed anything.
Here’s an excerpt from our coming vulnerability disclosure (thanks to rpearl for turning our internal disclosure into something more readable):
The binary is executable by any user; no authentication or privileges are necessary. Further, during the program’s initialization, there are numerous instances in which a buffer overflow can overwrite stack or bssmemory; similarly, the program passes user controlled arguments unsanitized as a format string to a sprintf, also leading to memory being overwritten. We believe that these can only be exploited to the point of a denial of service, not to the end of arbitrary code execution. This appears to be by chance, not by design.
However, the security vulnerabilities present in skyagent are of less cause for concern than the purpose of the program. It appears that the binary was designed as a backdoor into the phone, allowing remote control of the device without the user’s knowledge or permission. When the program is invoked, it listens for connections over TCP (by default, port 12345, on all interfaces, including the 3G network!) that accepts a fixed set of commands. These commands appear to be authenticated only by a fixed “magic number”; the commands are neither encrypted on the way to the device or on the way back. The commands that we have knowledge of at this time include:
- sending and monitor user tap and drag input (“PentapHook”),
- sending key events (“InputCapture”),
- dumping the framebuffer (“captureScreen”),
- listing processes (“GetProc”),
- rebooting the device immediately,
- and executing arbitrary shell commands as root (“LaunchChild”)
Here’s the paper that Joshua Wise typed up from the analysis we did, describing the backdoor in more detail:

ok, so does unrevoked method 1 eliminate this program?? or do we need to root via method 2 in order to effectively shut done this “skyagent” security loophole? recently, my fring apk removed a portion of its service -video skype
, remotely during the night while i slept. Is this something that can be attributed to “skyagent”? i just woke up and it was gone! as if my app had changed. i had rooted unrevoked method 1, but hadn’t run that program the day that happened. If i flash a custom recovery or install a custom rom, will this remove skyagent? Please help -i want to rid myself of this security vulnerability!! Please expand on what steps i can take. THANKS GUYS, FOR ALL YOUR HELP AND WORK ON THIS!!! -Adam
I just noticed unrevoked 3 is out. I read your wiki, just still have a few questions not covered there. First, same as above (do you fix skyagent vulnerability here?) Second, is this only for those who haven’t OTA’d the recent 1.47.651.1 update from sprint, or will it work even if one has? Thanks & again i appreciate all your work!! You guys are awesome. -Adam