Fortinet Blog | News and Threat Research

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

DroidKungFu is getting smarter (hopefully, so am I)

by RSS Axelle Apvrille  |  May 11, 2012  |  Category: Security Research

Since the beginning, the malicious Android DroidKungFu family has always been showing technologically advanced features (see one of our previous posts on DroidKungFu). The recent versions of the malware (version F and G) follow the same trend as they are now experiencing ways to hide their malicious behavior in native executables and additionally encrypting string constants within these.

For instance, variant F - which has been found to trojan some samples of the famous Cut the Rope game - runs a service named UpdateCheck whose first task is to load a so-called “adv3” library :

static {




System.loadLibrary("adv3");




}

Does adv3 stand for advanced? This library surely is … maliciously advanced. Straight after decompilation, it is still difficult to understand, because all string constants are encrypted:

Encrypted strings to be found in Android/DroidKungFu

Fortunately, the encryption algorithm is no match to AES ;). Let’s have a look at the decryption function, named “init_predata”. It’s quite simple: the idea is to process each byte of the encrypted string, byte by byte, apply the bitwise NOT operator to the byte and overwrite the current byte with the result.

Encryption function applies a NOT to each byte

If you want to automate decryption of those strings, you can use Tim Strazzere’s IDA script. Actually, he performs an XOR with 0xFF on each byte, which is equivalent to the bitwise not.

Ok, so, DroidKungFu uses a native library with encrypted string constants. What does the library actually do?

Piping commands to “su

First, notice it drops another executable. Yes! Another ELF executable was hidden within the library… This executable is 26460-byte long and it actually processes commands to the malicious remote C&C server. Like the library, its strings are encrypted with a bitwise not.

Then, it opens a pipe to /system/bin/su (to issue commands as root), creates the command strings (e.g  /system/bin/setprop r0.bot.id value, where r0.bot.id is a property, and value the value to set to that property), and writes the string to the pipe. Thus, the command is executed as root.

– the Crypto Girl

by RSS Axelle Apvrille  |  May 11, 2012  |  Category: Security Research
Tags: droidkungfu ELF encryption IDA pipe
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 8
  • 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

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