菜单

Today, a Chinese security researcher find a strange iOS dynamic library file in his iOS device and post it to PEDIY[1] — the biggest security forum in China. This dynamic library, as a plugin of the Cydia Substrate framework, will replace developer ID (or promotion ID) of popular iOS advertisement SDKs in all other applications running on the infected devices, and bring promotion fee to its author. We think this sample should be classified as malware or adware. As far as we know, this is the first iOS malware based on Cydia Substrate and spread in the wild.

Cydia Substrate is a very popular runtime instrumentation framework for jailbreaked iOS devices which is commonly used by jailbreak community developers to develop powerful tools or special applications for modifing system functions or the OS interface.

This dynamic library, named “spad.dylib”, was found under the directory /Library/MobileSubstrate/DynamicLibraries/. It’s configured to be injected to all applications which use the com.apple.UIKit framework. It uses Cydia Substrate’s API to hook lots of popular advertisement SDKs’ code in all applications which use these SDK to popup advertisement or get statistics of its installation. The sample will modify the developer ID (or “promotion ID”, “refer ID”, “Publisher ID”, “Ad id”) to some specific hard-coded values. We believe these IDs are belongs to the author of this sample. By replace these IDs in other applications, all further advertisements displayed in these applications will be counted as promoted by this author. Thus he will get related promotion fee which should been originally paid to the applications’ real developers.

For example, the sample will inject the MobClick SDK’s “MobClick” class and hook the “startWithAppkey:” and “startWithAppkey:reportPolicy:channelId:” method in it, and change the related app key to “51cd7b8d56240ba38c05d087″. (See figure 1 and figure 2)

Figure 1. The spad.dylib hooks methods in MobClick SDK

Figure 2. The spad.dylib changes app key in MobClick SDK

All advertisement SDKs targeted by the sample include:

- Youmi

- Sina Weibo

- Vpon

- Umeng MobClick

- Umeng App Union

- AdSaga

- MdotM

- InMobi

- MIX SDK

- Domob

- AdWhirl

- AdsMogo

- Google Mobile Ads SDK

- AderMob

- PolySDK

- GuoHe

- Komli Mobile

The second target in this list, Sina Weibo, is a very popular twitter-liked social network application in China but not an advertisement SDK.

This sample, spad.dylib, begin to spread in the wild at least from Dec 10, 2013, according to an iOS crash report hosted at synapticstuff.com [2]. We still don’t know how it infect the jailbreaded iOS devices. However, as the analysis above, we think it should be classified as malware or adware. Our suggest name of this familiy is iPhoneOS.Spad or iPhoneOS.AdThief.

In the past years, these’re many interesting iOS malware demo/PoC (like the Mactans and the Jekyll) written by the security researchers [3]. However, only a few iOS malware were found in the real world: Ikee, Ikee.b [4], FindAndCall [5], and Finfish. This malware becomes a new member of this short list, and is the first one based on Cydia Substrate.

UPDATE 03/25/2014

1. I’ve submitted the samples to the contagiominidump, while they havn’t published them yet. You can also download them from: