Fortinet Blog | News and Threat Research

  • Products
  • Solutions
  • Service & Support
  • Partners
  • Corporate
  • Resources
  • How to Buy

StarCraft culture to understand Android

by RSS Axelle Apvrille  |  June 19, 2012  |  Category: Security Research

Zerg Rush - Image courtesy of http://sheezyart.com/art/view/1244706/

As you probably do not know, I am a StarCraft II player. I really hadn’t expected it to be of any use to my job as an analyst, until yesterday where I read this tweet:

“I don’t even know what ‘zerg rush’ means and now I can’t google for answer either”

This is about the first time I am going to be able to boast for some StarCraft culture! Yeah! :))

StarCraft is real time strategy game developed by Blizzard. It features three different races: Zerg, Terran, Protoss. Each race has its own units and characteristics. In particular, Zergs are particularly ugly, slimy (personal opinion!) and one of their best known strategies consists in quickly creating numerous basic attack troops, called zerglings, and sending them out for attack. Other races tend to need more time to build their army, and a pack of basic zerglings is often enough to cause havoc. This strategy is called a Zerg Rush (see link and video).

On Android, Zerg Rush refers to a local root exploit. Its developer obviously plays StarCraft II, see the comments:

[+] Found a GingerBread ! 0x00017118
[*] Sending 149 zerglings ...
[*] Trying a new path ...
[*] Sending 149 zerglings ...
[*] Trying a new path ...
[*] Sending 149 zerglings ...
[*] Trying a new path ...
[*] Sending 149 zerglings ...
[+] Zerglings caused crash (good news): 0x401219c4 0x0054
[..]

The program (source code named zergRush.c) crafts a specific FrameworkCommand that it sends to the vold daemon. Initially, the command is not perfectly crafted, so it expects a crash. If a crash occurs, this is “good news” for the program because the device is likely to be vulnerable. It then crafts the command more precisely to cause a stack buffer overflow and returns to a chain of Return Oriented Exploitation (ROP) gadgets. That chain of gadgets execute as root

system("boomsh")

The program probably does not directly execute boomsh because the stack is marked as unexecutable, so it makes the device believe the commands are issued by vold.

What is boomsh? No more than a copy of the zergRush program, but when run as root, it falls in a particular case where it simply calls a shell. That’s how we end up with root shell on the device.

To be honest, the analogy with StarCraft is a bit far fetched:

* the number of zerglings corresponds to the amount of dummy data to write at the beginning of the command.

* the nydus (Zerg base) corresponds to the communication socket with vold

* collossus and high templars are powerful Protoss units. They correspond to error cases where the exploit is unable to root the device.

* hellion, siege tanks are Terran units. They correspond to other error cases.

* speedlings are upgraded zerglings. To do this upgrade, you must launch the Metabolic boost research. In the exploit, the metabolic boost research corresponds to searching for ROP gadgets

* walling is a StarCraft 2 technique which consists in defending one’s base by constructing many contiguous buildings on the base’s access road. Attackers have to destroy the buildings first to access your base, which usually leaves enough time to defend. In the exploit, this corresponds a case where the instruction to jump to is too far away

Thanks to David Maciejak for dissecting the exploit code with me and Guillaume Lovet for reviewing my post!

gl hf

– the Crypto Girl

PS. Actually I am a lame Protoss player. The real masters are bogbert and starlu :)

by RSS Axelle Apvrille  |  June 19, 2012  |  Category: Security Research
Tags: android exploit root ROP rush vulnerability zerg
comments powered by Disqus

Category

  • All
  • RSS Subscribe
  • Security Research
  • RSS Subscribe
  • Industry Trends & News
  • RSS Subscribe

FortiGuard Labs on the Web

  • Twitter Twitter
  • Facebook Facebook
  • LinkedIn LinkedIn
  • Youtube Youtube

Monthly Archives

  • May 2013 7
  • April 2013 17
  • March 2013 12
  • February 2013 11
  • January 2013 12
  • December 2012 8
  • November 2012 7
  • October 2012 4
  • September 2012 7
  • August 2012 7
  • July 2012 9
  • June 2012 17
  • May 2012 14
  • April 2012 16
  • March 2012 15
  • February 2012 11
  • January 2012 6
  • December 2011 4
  • November 2011 6
  • October 2011 11
  • September 2011 2
  • August 2011 2
  • July 2011 4
  • June 2011 6
  • May 2011 6
  • April 2011 5
  • March 2011 7
  • February 2011 5
  • January 2011 7
  • December 2010 8
  • November 2010 11
  • October 2010 3
  • September 2010 8
  • August 2010 4
  • July 2010 9
  • June 2010 9
  • May 2010 9
  • April 2010 6
  • March 2010 8
  • February 2010 6
  • January 2010 9
  • December 2009 8
  • November 2009 6
  • October 2009 6
  • September 2009 8
  • August 2009 5
  • July 2009 8
  • June 2009 7
  • May 2009 4
  • April 2009 7
  • March 2009 9
  • February 2009 4
  • January 2009 1
  • Older

Popular topics

hashdays bredolab Malware botnet conference webinar reverse engineering adobe hacking challenge Antivirus Windows FortiGate facebook Zeus privacy challenge UTM symbos/yxes google Firewall symbian exploit Security trojan mobile malware android Cryptography zitmo Mac OS X Fortinet network security Threat Landscape sms reversing Anti-Spam microsoft Research BYOD SpyEye mobile phone stuxnet Anonymous symbianos virut mobile phones iphone apple Mobile Security derek manky mobile