Locky Ransomware Installed Through Nuclear EK

In February 2016, Unit 42 published detailed analysis of Locky ransomware. We certainly weren’t the only ones who saw this malware, and many others have also reported on it. Since that time, Locky has been frequently noted in various campaigns using malicious spam (malspam) to spread this relatively new strain of ransomware.

When we initially reported on Locky, attackers were distributing the malware using Microsoft Office documents with malicious macros to download and execute the ransomware. Attackers quickly added another tactic, sending e-mails with zip attachments containing malicious Javascript files to accomplish the same goal. However, exploit kits (EKs) have also been used to infect users with Locky from casual web browsing. This activity suggests that there are effectively two paths to Locky: one through malspam and another through EK traffic.

Figure 1: An example of two paths to Locky from February 2016.

The EK path is rarely mentioned. So far, we have seen very little reporting on Locky’s propagation through EK traffic. Some sources noted Neutrino EK was used to send this malware, but no more has been publicly announced on the subject.

In recent days we have noticed Locky attempting to infect systems using the Nuclear EK.

Details

In February 2016 when Neutrino EK was first reported delivering Locky, we found a pcap of the traffic and saw the following pattern:

Figure 2: Wireshark display of Locky sent by Neutrino EK on 2016-02-16.

Proofpoint reported similar traffic and stated it was Locky distributed by a Neutrino EK thread known for spreading Necurs. This month, we ran across the same type of gate. This time, traffic patterns after the gate were similar to what we’ve seen for Nuclear EK. The payload was either Locky, or it was a downloader that retrieved Locky from another domain.

Figure 3: Wireshark display of Locky sent by Nuclear EK on 2016-03-15.

Figure 4: Wireshark display of Nuclear EK on 2016-03-16 sending a payload that downloaded Locky.

A Windows host infected with these Locky samples looks similar to previously-infected hosts when we first reported about the ransomware in February 2016.

Figure 5: A Windows host after being infected with Locky on 2016-03-16.

Conclusion

As noted in our previous blog post about Locky, Palo Alto Networks customers are protected from Locky through our next-generation security platform. WildFire continues to detect Locky, and AutoFocus identifies this threat under the Unit 42 “Locky” tag.

We continue to investigate Locky and EK traffic for applicable indicators to inform the community and further enhance our threat prevention platform.

Indicators of Compromise

Date/time range: 2016-03-15 and 2016-03-16
Gate IP address: 91.195.12.177
Gate domain: sed.poudelkamal.com.np
Nuclear EK IP address: 46.101.8.169
Nuclear EK domains: lotos.castrumtelcom.com.br , here.jninmobilaria.com.ar
Follow-up malware IP address: 46.148.20.32
Follow-up malware domain: js.cefora.com.ar
IP addresses from post-infection traffic caused by Locky ransomware:

  • 51.254.181.122
  • 51.255.107.8
  • 78.40.108.39
  • 149.202.109.205

Exploits and malware noted:

  • Description: 2016-03-15 Nuclear EK Flash exploit
  • SHA256 hash: 94bd74514cc9e579edf55dd1bac653ceca1837d930d109c6e701afe309b23310
  • Description: 2016-03-16 Nuclear EK Flash exploit
  • SHA256 hash: 4228036684f4f519704a102cd9322ac9edb1bfb5b20558a7a6873818f0e6a7b4
  • Description: 2016-03-15 Nuclear EK payload – Locky ransomware
  • SHA256 hash: faf4f689683f3347738ef0a8370a78d504b513d44f3a70f833c50de3d138c3b2
  • Description: 2016-03-16 Nuclear EK payload – file that downloaded Locky ransomware
  • SHA256 hash: a9dac0a0389c463b063cb30f647b3d1610e6052570efe2dfb1fca749d8f039fc
  • Description: Locky ransomware downloaded by Nuclear EK payload (soft.exe)
  • SHA256 hash: cc2355cc6d265cd90b71282980abcf0a7f3dcb3a608a5c98e7697598696481af

[Palo Alto Networks Research Center]

Connect to Protect: CSO Thoughts from RSA 2016

The theme of this year’s RSA Conference was “Connect to Protect,” promoting connections among the information security community, IT and other parts of the enterprise, and private and public sectors. It was the 25th annual event, which saw 40,000+ attendees and more than 550 vendors in the expo hall showing off their wares.

Over a number of days, keynotes from industry leaders addressed the need to do something different. Debates focused on the Internet of Things, industrial control systems, encryption, artificial intelligence and machine learning, crowdsourcing, and more, with many reflecting on current industry news.

Here are some of the highlights and themes of the week that particularly interested me:

Innovation Sandbox

In the top 10 finalists battle for the title of the “Innovation Sandbox” session, each vendor had three minutes to pitch to a panel of judges why their solution will have the greatest impact on information security in 2016. Phantom was the contest winner, describing how a typical enterprise has over 50 security solutions and nothing interoperates. Their solution tries to solve this by offering an open and orchestrated security platform.

Many vendors were talking about the need for security orchestration and how, in light of the challenge to hire skilled talent, teams need help integrating security tools and workflows. The industry needs to work together to make it easier for security professionals to do their job. The other side to this is the need to consolidate security solutions into a platform and move away from siloed approaches to solving security challenges.

Threat Intelligence

A very big theme that many vendors were talking about was threat intelligence. Whilst not new, it has evolved over the years to the point where many organisations are grappling with what to do with all of the data. We have seen various threat feeds being bundled into security solutions, web portals offering the latest security bulletins, indicators published on an ad hoc basis, and vendors trying to establish their own standards as opposed to aligning with industry- and community-based standards, such as STIX and TAXII. Whilst STIX and TAXII had evolved, security solutions and processes had not. Manual efforts were still required to be fed directly into the systems and, typically, required additional processing and analysis of raw information before being used.

The goal here is to provide as much end-to-end automation as possible, to collect the raw information from various sources, normalise the data as no one source looks the same, de-duplicate the data, age out the data, and the final piece is to use the data automatically in security solutions. As an industry we need to move away from manual analysis in processing the raw information. We need to be able to automate the enforcement to prevent an attack from taking place or the attackers from achieving their objective.

Skillset Shortage

The shortage of skills was mentioned during keynotes and in a lot of sessions I visited. When we look at the continuing rise of successful cyberattacks, as well as the growing focus on cybersecurity in businesses today, this has created the need for more skilled security professionals. This is an area that is often debated and was no different at RSA, with many saying that there aren’t enough people entering the field with the required skills, that the education and required skills may not necessarily be taught, and that the required skills are not necessarily taught but rather learned on the job. Unlike many industries, security is not a stand-alone discipline; it is actually a discipline within the computer field. Treating it otherwise is a mistake.

At the same time, businesses need to learn to foster these types of skills to be taught, looking at developing new processes and even operational models. Businesses should look to have programs in place to identify competent professionals within their own organisation and offer them jobs and training that will arm them with the security expertise needed. Whilst throwing more people at the security challenges, it is time businesses look to leverage other ways they have built, run and managed security in their environments and look to automate as much as they can.

When relating these themes to Asia-Pacific, I see that we are no different to the rest of the world. These are global challenges; and, in Asia-Pacific, we need to all work through these challenges together. The cyber attackers don’t discriminate against industries and geographies. Organisations in Asia-Pacific need to automate as much as possible. We, like every other part of the world, have a skillset shortage challenge. Like many organisations and governments, we are working to solve that by funding from industry to build security curriculum to be taught in higher education, governments investing in internship programs, we need to think about doing things smarter. Automation is key here. We need to work on preventing attacks, detecting the unknowns and closing the time it takes to turn them into known threats and provide this timely threat intelligence to everyone else – across all industries in Asia-Pacific.

In keeping with the theme of RSA, we need to connect as many people and businesses together as we can to solve the security challenges facing all of us. Security needs to be a team sport. Collaboration is something we need to continue to do more of across industries and between the public and private sectors. Working in siloes and not sharing what we have learned will only slow us down in our mission: to defend our people, organisations and information.

[Palo Alto Networks Research Center]

New Malware ‘Rover’ Targets Indian Ambassador to Afghanistan

On December 24, 2015, Unit 42 identified a targeted attack, delivered via email, on a high profile Indian diplomat, an Ambassador to Afghanistan. The body and content of the email suggest that it was crafted and spoofed to look like it was sent by the current Defence Minister of India, Mr. Manohar Parrikar, commending the Ambassador on his contributions and success.

India has been a key nation in building and funding Afghanistan’s infrastructure and economic development, which includes setting up iron ore mines, steel plants, power plants and transportation systems, helping reconstruct the Salma Dam and constructing a new Parliament Complex for the Afghan Government.

Given India’s significant contributions to the development of Afghanistan, it is likely that there may be groups or nations who would be interested in tracking and spying on key individuals who officially represent India in Afghanistan.

Overview of Rover infection

Figure 1 gives an overview of the exploitation, infection and C2 communications of the ‘Rover’ Trojan campaign targeting a victim running Windows XP.

Figure 1: Overview of the infection flow and C2 communications

Rover Trojan Infection Steps:

  1. RTF file exploits CVE-2010-3333 and downloads an executable from newsumbrella[.]net.
  1. The executable file downloaded from newsumbrealla[.]net is executed on the victim machine.
  1. The executable ‘file.exe‘ is a downloader which is used to call out to a server with the IP ‘46.166.165.254‘ and download the main Rover malware along with plugins used by the Rover malware.
  1. Rover malware and plugins are downloaded and installed on the victim machine.
  1. Data exfiltrated from the victim machine.

Targeting and Infection

Figure 2 shows an email which was sent to the Ambassador of India, appearing to commend the contributions the Ambassador has made in the development and success of projects on national interest, and attaching a letter of appreciation with a file name, “Appreciation_letter.doc”.

The attachment is an RTF file which exploits a specific vulnerability in Microsoft Word, CVE-2010-3333.

Figure 2: Spear phishing email sent to the Ambassador of Afghanistan

If the recipient of the e-mail opened the attachment in a vulnerable version of Word, the exploit code would download and execute a file from the domain newsumbrella[.]net as shown in Figure 3 below.

Figure 3: Hexdump showing the domain and the executable downloaded

Malware Analysis

During the time of analysis the executable file systemupdateAPI.exe was no longer being hosted on the newsumbrealla[.]net domain. However, we have noticed the same domain hosting another executable in the past within the same parent directory and having a similar naming for the folders as shown below

newsumbrella[.]net/ne3s/lat3st/w0rld/systemupdateAPI[.]exe

newsumbrella[.]net/ne3s/file[.]exe – hosted earlier

We believe that the executables hosted under the parent directory ‘ne3s’ are variants of the same downloader Trojan, which was used to download the Rover Trojan. The file, file.exe,contains the following debug information that indicates the file was originally namedsystemupdateAPI.exe.

Figure 4: Debug information of downloader program

By analyzing file.exe, we can see that it is a downloader, which creates ‘c:\system’ directory and depending on the OS version used, downloads the main Rover payload along with multiple DLL modules from 46.166.165.254.

Figure 5: Code snippet showing the OS version check and the subsequent download from 46.166.165.254

If the infected system is running an OS version prior to Windows Vista, it would download the following files from 46.166.165.254:

  • WindowsSecurityService2.exe (‘Rover’ main module)
  • Openal32.dll
  • Cxcore210.dll (OpenCV)
  • Highgui210.dll (OpenCV)
  • libsndfile-1.dll

If the OS version is Windows Vista or later, it would download the following files from 46.166.165.254 :

  • WindowsSecurityService3.exe (‘Rover’ main module)
  • OpenAL32.dll
  • opencv_world300.dll
  • msvcp100.dll
  • msvcp110.dll
  • msvcp120.dll
  • msvcr100.dll
  • msvcr110.dll
  • msvcr120.dll

After retrieving these files, the downloader Trojan executes the main module. Even though the main modules use different library versions, the functionality of the backdoors are identical.

By analyzing the files downloaded to the victim machine, we can see that the executableWindowsSecurityService2.exe imports the four DLL files that were downloaded to the same directory. The four DDLs are cxcore210.dll, highgui210.dll, OpenAL32.dll and libsndfile-1.dll as shown in Figure 6

Figure 6: Executable and DLLs downloaded to the victim machine

Attributes of the Rover variant

##############################################

File: WindowsSecurityService2.exe

##############################################

Meta-data

===============================================

Size          : 337920 bytes
Type          : PE32 executable (console) Intel 80386, for MS Windows
Architecture  : 32 Bits binary
MD5           : 76429f8515768f9f5def697e71071f51
SHA1          : d04ce934561934f758d77dfa944bd6743dd82cff
SHA256: 7757517ae6b4d513a57826f9ab65bd070d99d25ac526cfae3e9955c3c7cd457assdeep              : 6144:JabBRNUKgZ9SN0jzoFBB9hcrpXwg9xXYOGl93XO2rQLfbTpLuO7bIWjRO5gjPNq:JarSKu6yzoF8rpAqXYv3XOgQLfnpLuOu
imphash               : b5aa366f452feb9f4dff3c72157ca1f9
Date          : 0x5637227B [Mon Nov 2 08:44:43 2015 UTC]
Language      : ENGLISH
CRC:   (Claimed) : 0x59736, (Actual): 0x59736
Entry Point   : 0x43e3c8 .text 0/5

===============================================

Imports

===============================================

[1] ADVAPI32.dll
[2] WS2_32.dll
[3] WLDAP32.dll
[4] cxcore210.dll (OpenCV module)
[5] highgui210.dll (OpenCV module)
[6] OpenAL32.dll
[7] libsndfile-1.dll
[8] GDI32.dll
[9] KERNEL32.dll
[10] USER32.dll
[11] MSVCP90.dll
[12] RPCRT4.dll
[13] MSVCR90.dll

The author of ‘Rover’ used the following open source projects to implement the main functionalities of this custom malware.

OpenCV – Taking photos from the web cam
OpenAL – Recording Audio
Libsndfile – C library used for reading and writing audio files
LibCurl – For all network communications

OpenCV and OpenAL

Both versions of Rover use OpenCV and OpenAL for some of the main functions.

OpenCV is a library of functions written primarily for building real time computer visionapplications, image processing and also machine learning. It has seen wide acceptance in security systems, medical image analysis, unmanned vehicles, visual surveillance, object tracking, Artificial Intelligence and many other applications.

OpenAL is a cross-platform audio API for rendering multichannel three-dimensional positional audio (i.e., It is a means to generate audio in a three-dimentional space.) Earlier versions of OpenAL were opensource but later versions (since v1.1) have been proprietary.

Once executed, Rover creates following registry entry to execute itself when the computer reboots.

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\”System Application” = c:\system\WindowsSecurityService[2 or 3].exe

The malware then creates six threads, each with a different job:

  • Heartbeat
  • Screenshot
  • Stealing Files from HDD
  • Keylogger
  • Search files on USB
  • Backdoor

Figure 7: Threads created by the malware

1. Heartbeat:

This sends heartbeat signal on HTTP to the C2 server at 46.166.165.254 every five seconds and checks whether the C2 server is running.

2. ScreenShot:

This saves screenshots as c:\system\screenshot.bmp and sends it to the C2 server at 46.166.165.254 every 60 minutes.

Figure 8: Screenshots sent to C2 server at 46.166.165.254

3. Finding specific file types on Removable Drive:

This thread searches for for files with the following extensions on removable drives and copies them to ‘c:\system’ every 5 seconds.

  • pdf
  • doc
  • docx
  • ppt
  • pptx
  • xls
  • xlsx

4. Keylogger:

This logs key strokes at ‘c:\system\log.txt’ and sends captured data to the C2 every 10 seconds

5. Stealing specific file types from Hard Drive:

This thread searches for for files with the following extensions on fixed drives and sends them to C2 every 60 minutes.

  • pdf
  • doc
  • docx
  • ppt
  • pptx
  • xls
  • xlsx

Figure 9: Document file being sent to C2

6. Backdoor:

This thread obtains backdoor commands from C2 every 10 seconds and executes them. Backdoor commands are listed below:

Command Description
CAMERA Take photos using system webcam and store them as c:\system\camera.jpg before sending to the C2.
AUDIO Record audio from default audio input as c:\system\audio.ogg and sending it to the C2.
SCREEN Take a screenshot and save it as c:\system\screenshot.bmp then send it to the C2.
KILL Remove persistence registry entry and terminate itself.

Though ‘Rover’ is unsophisticated and lacks many modern features common to advanced malware, detection rate of the ‘Rover’ is extremely low. At the time of this writing, two out of three samples on VirusTotal were not detected by any Antivirus product

Figure 10: No detection by any AV product on Virustotal

Figure 11: Low detection rate

Summary

OpenCV has been extensively used by organizations, government bodies, and research groups for real time capture, image manipulation, object detection and many other uses in new forms of Human-Computer interaction, security systems, driver-less cars among many others. OpenCV was also used by the Mars Rovers to send captured data back to Earth.

It is interesting to see the very code used in such significant projects also being used to track and spy on individuals being targeted and which can remain undetected by traditional security systems. Though ‘Rover’ is an unsophisticated malware lacking modern malware features, it seems to be successful in bypassing traditional security systems and fulfilling the objectives of the threat actor behind the campaign in exfiltrating information from the targeted victim. It is important to understand the techniques and tools being used by such threat actors to better defend and protect organizations from such threats.

Palo Alto Networks AutoFocus users can identify this threat using the Rover tag.

IOCs:

C2:
46.166.165.254

Downloader hosting links:
newsumbrella[.]net/ne3s/lat3st/w0rld/systemupdateAPI[.]exe
newsumbrella[.]net/ne3s/file[.]exe
newsumbrella[.]net/bla3k/extra7/systemupdateAPI[.]exe 

Filename File Type SHA 256
Appreciation_letter.doc RTF 6c9862a65741b56b849928300
aff310d60b815ee5f5f9f133469
e3b035e7e936
Questionnaire.doc RTF 5f656cf07a1d5e7c439aad4023
5dc78e47bac719c62e03728cc
40267383880bd
Terrorism.doc;India &amp RTF 6096ff941af95638944f2fcdf4a5
046aa028b803b010b1a2d000
028b1a4967bc
Appreciation_
letter.doc
RTF 7bf3a425be41ad9cc713e4821
6e061c788f36e2727de5d0b6b
6ac4f435fe1c06
RTF 06b12649dba7f61cb581f97797
bdfba3a7f057a36b448d4c91a3
a7d89fff8d54
WindowsSecurity
Service3.exe
PE 61a2935fcb0a385f9e67855ef6f
95bda5f09fdb7c1435f215ce18
b7b61993daa
file.exe PE a5e5571cda838e97a6beb1a65
acdfbaaf80027f60417aadb0d3
4292f19c0f3b3
WindowsSecurity
Service2.exe
PE 7757517ae6b4d513a57826f9ab
65bd070d99d25ac526cfae3e99
55c3c7cd457a
WindowsSecurity
Service3.exe
PE 3dc709a3bcaa82220d6a76ea47
374bd864c37817c7041c7e9f4e
e8ba42847f34

References

https://en.wikipedia.org/wiki/Afghanistan%E2%80%93India_relations
http://docs.opencv.org/3.1.0/#gsc.tab=0
http://docs.opencv.org/2.4/modules/highgui/doc/highgui.html
https://en.wikipedia.org/wiki/OpenAL
http://www.cs.uml.edu/~holly/teaching/91450/spring2013/bschroeder_vision_robotics1.pdf
https://ti.arc.nasa.gov/m/pub-archive/422h/0422%20(Pedersen).pdf

and

[Palo Alto Networks Blog]

Honeywell and Palo Alto Networks Collaborate on Industrial Cybersecurity Solutions

Today Palo Alto Networks and Honeywell announced a collaboration to offer and develop joint Industrial Cybersecurity Solutions. This is huge for both companies but even better for our joint customers. Here are some reasons our existing and potential end users will benefit from this exciting news.

Access to the Entire Platform, Solution Roadmap – Honeywell, a Palo Alto Networks NextWave partner, is now offering the entire Palo Alto Networks platform (Next-Generation Firewall, Threat Intelligence Cloud, Traps Advanced Endpoint Protection) to the global industrial automation community. Coming out of the gate, we have a next-generation Level 3.5 solution that will bring industrial IT-OT perimeter security to the modern posture needed to effectively address the rising ICS threat landscape. Using the Next-Generation Firewall, the solution will give our end users unprecedented Layer-7 visibility and “zero-trust” network segmentation at the very granular application-user-content level. It will also offer indispensable Threat Prevention capabilities needed to combat both known and unknown threats. As technology partners we are also working closely to develop a technology integration roadmap for industrial cybersecurity use-cases across the different layers of the Purdue Model including Level 3 and below. We look forward to sharing more on our upcoming solution development as things progress.

Better Time to Market and Operational Support – Organizations can certainly develop their own industrial cybersecurity architectures, but why not take advantage of the proven reference architectures from Honeywell and Palo Alto Networks? As a systems integrator partner, Honeywell will make sure that the Palo Alto Networks-based solutions are deployed and maintained properly, backed by our world class customer support. In addition, the joint solution makes Honeywell’s managed industrial cybersecurity services available to customers. This is huge for those companies lacking the dedicated staff to fully benefit from real-time security monitoring and analytics.

Leadership and Vision – Here you have two industry leaders and innovators attacking the problem from two different perspectives. Honeywell’s roots are in industrial automation and hence they have a keen eye for reliability and safety when it comes to deploying cybersecurity. Palo Alto Networks has been about next-generation cybersecurity from day one offering a very powerful yet flexible platform that can be used in a range of environments including industrial applications. We see the different baselines of viewpoints as a great thing. Overlay the two perspectives together and you get the best Industrial Control Systems (ICS) cybersecurity solution that the industry has to offer. As leaders in our fields, we are committed to continue delivering solutions that can be deployed in such a way that not only addresses the growing ICS cybersecurity requirements but also accommodates the unique uptime and safety considerations.

Read our solution brief and the press release to learn more about our collaboration with Honeywell.

[Palo Alto Networks Blog]

Pirated iOS App Store’s Client Successfully Evaded Apple iOS Code Review

Apple’s official iOS App Store is well known for its strict code review of any app submitted by a developer. This mandatory policy has become one of the most important mechanisms in the iOS security ecosystem to ensure the privacy and security of iOS users. But we recently identified an app that demonstrated new ways of successfully evading Apple’s code review. This post discusses our findings and potential security risks to iOS device users.

The app we identified is named “开心日常英语 (Happy Daily English),” and it has since been removed by Apple from the App Store. This app was a complex, fully functional third party App Store client for iOS users in mainland China. We also discovered enterprise signed versions of this application elsewhere in the wild. We had not identified any malicious functionality in this app, and as such we classified it as Riskware and have named it ZergHelper.

Figure 1: “Happy Daily English” available in the App Store

ZergHelper presents several security risks, include the following:

  • It provides installation of modified versions of iOS apps whose security can’t be ensured..
  • It abuses enterprises certificate and personal certificates to sign and distribute apps, which may include code that hasn’t been reviewed, or abuse private APIs.
  • It asks user to input an Apple ID while it also shares some Apple IDs to users. It will log in to an Apple server using these IDs to perform many operations in background.
  • Its author is trying to extend its capabilities via dynamic updating of its code, which could further bypass iOS security restrictions.
  • It uses some novel techniques that are sensitive and risky – techniques that could be used by other malware to attack the iOS ecosystem.

ZergHelper appears to have gotten by Apple’s app review process by performing different behaviors for users from different physical locations on earth. For users outside of China, it would act as what it claimed: an English studying app. However, when accessing the app from China, its real features would appear.

The app was made available in the App Store on October 30, 2015. However, nobody appeared to have noticed ZergHelper’s hidden functionality until February 19, 2016, when a user created a post in V2EX (a Chinese developer forum) to discuss it. We shared our findings with Apple on February 19, and Apple removed the app from the App Store later that day.

ZergHelper’s main functionality appeared to be to provide another App Store that includes pirated and cracked iOS apps and games. The app was developed by a company in China that named its main product “XY Helper”. ZergHelper was the non-jailbroken and “official App Store” version of this product.

In addition to its abuse of enterprise certificates, this riskware used some new and novel approaches to install apps on non-jailbroken devices. It re-implemented a tiny version of Apple’s iTunes client for Windows to login, purchase and download apps. It also implemented some functionalities of Apple’s Xcode IDE to automatically generate free personal development certificates from Apple’s server to sign apps in the iOS devices – which means the attacker has analyzed Apple’s proprietary protocols and abused the new developer program introduced eight months ago. ZergHelper also shares some valid Apple IDs with users so that they don’t need to use their own IDs.

ZergHelper’s code is complex and it’s still unclear whether it would steal account information and send it back to server or not. The app did send some device information automatically to a server for statistic tracking. The authors appeared to be trying to use the programming language Lua to make the app more extensible. Specifically, ZergHelper’s use of the framework means its code could be remotely updated without Apple’s further review.

We also identified over 50 ZergHelper apps that are signed by enterprise certificates. These apps were spread by authors in different channels.

ZergHelper’s Spreading and Functionality

ZergHelper was designed to be installed in this way: if an iOS user accessed XY Helper’s official website from China, the top advertisement banner would prompt a page saying that you could go to App Store to install their product “XY Apple Helper” (left of Figure 2). By clicking the button, the official App Store is automatically opened and the “Happy Daily English” app’s page is shown (right of Figure 2).

The original “Happy Daily English” app is open-sourced and hosted on OSChina as a project named “HappyEnglishSentences8k”. ZergHelper authors compiled it and embedded their own risky code. There appear to have been at least three people jointly developing it using the usernames of “xi”, “zhang” and “zhangzq”. The project’s internal name was XYFactory and the app’s internal name was “AppStore_4.0.1”.

Figure 2: Official website guides user to download ZergHelper from App Store

If you were to browse the app using the desktop browser or by iTunes client on any platform, the app’s name would be shown as “开心日常英语 (Happy Daily English)”. However, once it was installed on an iPhone or iPad, the name became “XY助手 (XY Helper)” with the same logo, just like the value of CFBundleDisplayName in the app’s Info.plist file (Figure 3). Our analysis suggests the authors inputted a different name when submitting the app to Apple through web form and Apple’s review process didn’t identify that inconsistency.

Figure 3: The app’s name is inconsistent with iTunes page

When the app launched, it would connect to the URL interface[.]xyzs.com immediately, and take different reactions based on result of the HTTP request (Figure 4). The webpage was configured to return a 404-not-found error if the access comes from an IP address outside of mainland China. In this situation, the app would only display an English study interface (left of Figure 5) – no other functionality was provided to users in these regions.

Figure 4: The app provices different functionality based on HTTP request result

Figure 5: Different interfaces will be showed for users from different locations

We don’t know where the App Store reviewers are located. If they are not located in mainland China, this method could trick them into seeing a legitimate app. Even if they’re in China, the author could just shut down that webpage during the review period so that reviewer could not see the actual functionality through an analysis of its behavior.

For users in China, the different user interfaces would appear (right of Figure 5). Then the app will guide to install two configuration profiles that it claims are for “resolving stability issues” but will actually install a device enrollment challenge and a web clip (Figure 6). These profiles were signed with a certificate of “xyzs.com” which was issued by Go Daddy Secure Certificate Authority on December 2, 2015. Note that the device enrollment challenge is used to enroll the device to related MDM (Mobile Device Management) system.

Figure 6: The app asks to install two profiles signed by certificate issued by GoDaddy

The app provided functionality of directly installing plenty of iOS apps and games to the device. It has pages for hot apps, hot games, top grossing apps, etc., just like the official App Store (Figure 7). The only difference is, all apps or games provided by ZergHelper are free, which means, they are likely pirated versions of the legitimate apps.

Figure 7: Main user interfaces

In the settings tab, for devices using pre-9.0 versions of iOS, a user could also input an Apple ID and password. The password would be remembered by the app. There’s another button used for “I don’t have an Apple ID. I would like to receive one for free” (Figure 8). We have not identified where these Apple IDs came from.

Figure 8: “I don’t have an Apple ID. I would like to receive one for free”

Novel Approach to Act as 3rd-party App Store on Non-jailbroken Devices

ZergHelper used unique ways to build a third-party App Store for non-jailbroken iOS devices. Each of them could be used to spread pirated or cracked iOS apps. Two of them are new methods of getting past App Store review that we haven’t previously observed.

Fake as Tiny iTunes Client

ZergHelper implemented the protocols between the iTunes client for PC and Apple’s App Store servers. To be more specific, these functionalities have been implemented in the app:

  • Log into the App Store, cache authentication data, and log out of the account
  • Click the term of service
  • Get an app’s information
  • Purchase an app (Figure 9)
  • Download the purchased app

When communicating with Apple’s server, ZergHelper used a User Agent like this:

  • iTunes/12.0.1 (Windows; Microsoft Windows 7 x64 Business Edition iTunes/12.0.1 (Windows; Microsoft Windows 7 x64 Business Edition

Hence the app is trying to act as an iTunes 12.0.1 client running on Windows 7 system.

Figure 9: Code to purchase an app by simulating the iTunes protocol

We’re still not very clear in which ways ZergHelper used these functionalities. It’s possible that they were used for the Apple ID given by users, or by the “free” Apple ID provided by the app itself.

Simulate Xcode to Apply Personal Development Certificate

The most surprising approach to installing apps on non-jailbroken devices is how ZergHelper abused free personal development certificates.

Previously, Apple only offered iOS development certificates for registered developers who paid an annual fee. This kind of certificate is necessary for anyone to sign an app and then run it on a physical device. From June 2015, Apple began to provide a new program that allows anyone with an Apple ID to receive a certificate for free. The functionality is embedded into Xcode since its 7.0 version and so far Xcode is the only official way to use this feature.

However, ZergHelper could have acted as Xcode to receive a valid personal development certificate from Apple’s authentication servers, too. Apple doesn’t disclose how this process works and how Xcode is implemented. Therefore, we think someone has reverse-engineered Xcode in detail to analyze this part of code so that they can implement exactly the same behaviors with Xcode – in effect, successfully cheating Apple’s server.

Figure 10: Login to Apple’s server

Figure 11: Fetch development certificate

Using the development certificate, ZergHelper could sign other iOS apps on iOS devices and then install them. There are limits on the number of iOS devices that can be authorized to use each certificate. Previously, people worried about whether the free certificates would be abused by someone to install pirated apps, but this technique shows abuse in a wide-ranging and automated way.

In the same week that we were analyzing ZergHelper, we observed someone selling source code that:

  • Automatically registers for Apple IDs by reversing protocols in phone and in PC
  • Offers app DRM authentication from PC for “helper utilities”
  • Automatically generates a personal development certificate by an Apple ID

The information was posted on a famous security forum in China in February 19, and was then deleted on February 20.

Figure 12: The deleted post of selling related source code (screenshot)

Authorize Pirated Apps from PC

For some pirated apps downloaded from ZergHelper’s server, the app asks the user to connect the iPhone or iPad to a PC for “authentication” with the help of the XY Helper’s Windows version. We have not reverse-engineered the Windows client. As far as we know, the purpose behind this is to implement the Windows client like an iTunes and to trick the iOS device into believing an iOS app has been authorized through the PC. (This attack technique has been in use with some tools for years.)

Abusing Enterprise Certificates

ZergHelper also abused enterprise certificates in a manner similar to other previously identified iOS malware, including WireLurker, YiSpecter and TinyV. In the app, these kinds of apps are tagged with “install in a second.” ZergHelper used the itms-service protocol for these apps’ installation. Compared with previous malware, the main difference in ZergHelper is that it would not only download itms-service plist file from C2 server, but it could also open a local port to install some apps onsite. This feature may have been designed for apps signed by personal certificates.

Figure 13: Enterprise signed apps’s PLIST files were hosted either on remote server or the local device

More ZergHelper Samples in the Wild

Apple’s App Store was just one “channel” through which ZergHelper was distributed. The authors also developed other versions that are all signed by different enterprise certificates. These versions were distributed through different channels and could be installed to non-jailbroken devices. For example, when you access XY Helper’s website, you could choose to install it from the App Store or directly from their server.

We found over 50 ZergHelper samples signed by nine different enterprise certificates. In their “xyChannelId.plist” files, the author specified 32 different channel IDs and 33 different channel names.

Figure 14: One of enterprise certificates being used to sign ZergHelper

Potential Security Risks

Apple’s Code Review

Previously there have been some malware (e.g., FindAndCall) or Proof-of-Concept apps (e.g.,Jekyll) that successfully made it into the official App Store. The most recent cases areXcodeGhost and InstaAgent. Compared with those, ZergHelper has more user interfaces and more significantly suspicious code characteristics. Apple typically doesn’t disclose any technical details regarding how its reviewers check apps to confirm they are not malicious. But ZergHelper demonstrates new techniques that can evade Apple reviewer scrutiny.

Enterprise Certificate

Since WireLurker, there have been more malware or evasive applications installed on iOS by abusing enterprise certificate. The biggest risk around this issue is the combination of enterprise certificate and private APIs. YiSpecter and Youmi have abused private APIs to collect private information on iOS. ZergHelper took another step to automatically generate development certificates for free. This is of concern because the abuse of these certificates may be the first step toward future attacks.

Apple ID

In the underground market for iOS tools, Apple IDs have become more and more important. In recent months, we’ve seen malware designed to steal Apple IDs (e.g., KeyRaider), take money from them (e.g., AppBuyer) and share them (e.g., YiSpecter). Some attackers ransom the stolen Apple IDs or phish for them. ZergHelper’s functionality also relied on valid Apple IDs. We’re still not certain whether ZergHelper could send stolen Apple IDs back to its server or not. Note that ZergHelper would provide free Apple IDs to its users, and we do not know from where these IDs originated. Use of Apple IDs only continues to grow, especially when we consider the amount of private data stored in iCloud and on iPhones and iPads.

Code Dynamic Loading

Apple requires every single update to an app in the App Store to be reviewed again before publishing. For ZergHelper, re-review increases the possibility of exposure. The authors appear to have tried to resolve this problem by using a scripting language.

ZergHelper used an open source project called wax, “a framework that lets you write native iPhone apps in Lua.” In the app, there’s a XYLib.lua file that only contains two functions so far. This Lua plugin will be loaded and executed when the app first launches. Through the wax library, this script could invoke many methods in the Objective-C runtime.

Figure 15: Lua plugin in ZergHelper

Apple disallows iOS app from dynamically loading new code or dynamically updating themselves. This is an important and useful security mechanism to mitigate the risk of some kinds of vulnerabilities and some malware. However, frameworks or SDKs like wax provide another way to bypass the restriction.

Dynamic code loading is a classic method used by malware to hide an author’s true intentions. In the last few years popular iOS SDKs that provide JavaScript, Lua or other script languages’ interface to Objective-C runtime have emerged. Considering how easy it is to write code in these languages, and how hard it is to analyze or to detect them, we think this approach may be adopted by more malware or PUAs in every popular platform (for example, the Android Trojan Xbot we recently revealed used JavaScript to implement part of its core functionality.)

Mitigation

We reported the issue to Apple on February 19 and Apple removed the app from the App Store on February 20.

For iOS users that have installed “开心日常英语” from App Store, or found “XY助手” in your devices, we suggest you uninstall it. We also suggest that users check profiles in their iOS devices (by Settings -> General -> Profiles & Device Management). If there’s any profile from “xyzs.com”, you should delete it immediately.

Acknowledgements

We greatly appreciate “i_82” for his help during the analysis. We also would like to thank the author of Surge for creating such awesome tool that greatly helped our analysis of ZergHelper. Last, we thank Ryan Olson and Chad Berndtson from Palo Alto Networks for assistance in developing this report.

IOCs

Samples of the App Store version (DRM stripped)

  • e618f19d3614063e3b0fbb1c7faee259e38bde8db8972d84a3b25a771db84ef3 EnglishStudy
  • b1943d0162765e22c0af9b571da2804e4f01d3a063421ee590cab862e8d712be EnglishStudy-v5.0.0.ipa

Samples of enterprise signed versions

  • 03448093b24cea1402a917e18eb08cab82c30a21d981f1b516368ff20c93197c
  • 1377d0c4e861e9f10010dd46806b48aef1c379f3aed28d24e839243f2f4d66da
  • 145688e80784e70112a46970683cae86a8b95b78440eb6a28fc45c60dd6f6ac6
  • 16b83e4babf013370005b42f5f8c12ac9551cd33d7125c33d52f67c1634d48d7
  • 1d9def398ad8d16a104ced4b022a54264d8dd20e91418aa81c941caf4c58ffd0
  • 1ea60e84825d4d70ac3ab9a894cb2b1c8013e18a8a29d108261fd3c0419597b7
  • 24a178b69499d418ab522f5a163bd01946ee73e55ba00a94944fba84cbf26ea0
  • 342520e57e77d81bfa79bafa31fc2f31bd57b1c0cd9bc6da5e4ffc148a807ee1
  • 3636d8e86138bd49bc50b44cf96c172cf99991d1ab28cf4a2559e95931f4a8dc
  • 3d00bd0034cb9a9c33d148c799ea9063221392f5227934dd7d700fdb55b53f4e
  • 3d97417399e3df6ecfda2b1e39b199e0db7594dd7c84488435c0cac14c26ad54
  • 40361936d118c7bcac7996b40055c11bd14376b6d96085aa2dd15139ab22e25b
  • 4229be2075f6077c568861ebef5259212bc08eb73f8008a64e35a854c7d01509
  • 48d4c62aaa60dcdda667583629e6fb8f0fcc7257a6e8b11bbb635f5bb6f21563
  • 4fa19e2a1356d9789d1ea016f1ef3515f8562f28864529676114c9b12dfe409b
  • 50812bb0ddb4081aa8c2e5446fad4d79f7d5ec2fc7b0ce0956d662f399df5d45
  • 55d7a24ec0e5d6e860c835bc51c7e6edd69f707645144386ba425da3f444dbde
  • 560dac5b05480520fd1663d5f4199de941a9831dc134c72b309893f0a350c2a7
  • 57a51f660a47742b59680d78d63fdccb85cf7e5d9ed2d92b2099792fc504f69d
  • 5ab7bd81ffc6841b1a2a35c5c7111bf0531f77016cbc1bf8217f173dcc56ef95
  • 5de9ae15cadd45c7dda974eddf79963e373bd8a73270decdc435e972e21ee983
  • 65b8a3305e9559fbcad8b9c9d66a26a32de26186b6d6a312988bfc79a1971dae
  • 677841c97136338965e34fbcb1dee5ba31489956ddf9c4d882c2546e541777fd
  • 69e725fb2ac26e8ab79d38713ac0ae31ac54f004679c20e4c29a91a7f9bff15e
  • 729d00476a1ee18e4b007ac9371d939124b76d1b7ced8a467d870831e2d776da
  • 741076d5e31fdec814994dc67e7211c707810fc298f3ab7795fed3e2ffe55ed9
  • 76a01170720f433ad5e74b015be4479cadc1abcdd746465150af7a2757ac1c1c
  • 7abbc150fc3c4031f1f79f4298f5c88350b73fa13c78b8ef942caf823ffe58f9
  • 7bb46f38e8ee13db399501f26b91c6aa115945b47e4981aa8b9b5a0f8af128b1
  • 7d789803ecc8af55793f2135462c562dddd8a7e168d175b931e0a109500ad1ce
  • 8683822006535a6f485f0b19d5c1c9bdc818569cd50166cdc9ba5f412dbdf0e2
  • 86dea3d6e9ec51e6df84726b9038fd2dbf0f6c9bc9d4e104f3116edc00d47358
  • 886a3056f2249e84c37e6a71c5127edd08176b8816d2b3ff89841c6200ba3828
  • 8a1daed530b6e922a15a03b0a0e42ff156a1dd46683de310abbdfda36a80df8d
  • 8e11487b4b750bcabfa519723dc3d220307d56d419f9545d82622a96cba726f3
  • 95a30c3ccfc6307dccc5525936ffa13c6ea41b7cd21fa0cf0d1017923de0e4e1
  • 9c69ce5aa40eb9c079a1948ea5dcadcda959c2d255d213b93a15e833a3d044a5
  • a29eb57d78cb005d33bc09cb9dca9c41fdbd18b1b4265549bb7a36a05141d71d
  • a48479b5af351902e76e8c3d7daa64f8fe9c471fb4d8ca9461ef5e912aae0e94
  • a625fa12829d11a280d94249cfa0ade257533b595afc0bd8a11fcb47f9aa9414
  • aca2a87ee21e0330b198175ba1184a808d9e429bec9113c26b741f4a1d830c6e
  • ae388c5e5082dd601bf4b971a47fa12d378d59a6fa753deba0750377c4002814
  • b00d515186ee2c477e100fc3c27c3bf604e03aa907b3f159d7f76a882863c04f
  • b55f265eb6cd87818715019745dc4210f4b9ed5897c9472ec9ef8305df68e09b
  • bc02100ffed4fa0ed57f0ce8bd4166d3525653f4a99b517c076e3cd4ebd9e50a
  • bc706f165b125d078753c8d8269894cfc6fd65fa451fa9d6187aea165f1b9ba1
  • bf13170116efca42592f8b1ef979231038c2150906a70c16b376ee3958e7b309
  • c6e697e73ecc381b73852881fe682664edc1e4cff8bd142323b88f99c57b86fc
  • d305044bceb293fd25e40d642666ebac089e659b4550fdae7ef8536bcab876f1
  • d8f82da11b7fb0ab5ca69c003d8ca626a1b3208ec2557521f6016738c13eda0c
  • da7d1de9cfb294d3402325daccc35f61764fbc8f0cb3cc7403cfe31fd77f690e
  • da871fcadb82bc3c4e366dd02580c7e017dc0d0a689a89cf2883c1bf02683c9d
  • db2afa588b41c50e1d7fa91f2ba5fe7dd1708a7600736a11e8b5fbf2ea7d665f
  • df26f3599ca2ce78de039df0b5f7c83f6c9c445fa126ac8acdfffd2e8b2c44b2
  • f125bfc07becff2614fac5601f2b2efd9cdde5b37329c6fac543ac2b5686b0ab
  • fee18c4c4a9f6827c084519d2f5fae11e66d9024c7711af2b0f5f66d8a98403f

Related domains

[Palo Alto Networks Blog]

English
Exit mobile version