SlideShare une entreprise Scribd logo
1  sur  48
Télécharger pour lire hors ligne
Fruit vs Zombies:
Defeat Non-­jailbroken iOS Malware
Claud  Xiao
SHAKACON  2016
Who am I
2
• @claud_xiao
• 7  years  on  Antivirus  R&D
• Windows,  Android,  OS  X macOS, iOS
• Security  Researcher  at  Palo  Alto  Networks
• WildFire team
• Advanced  malware  research
• http://researchcenter.paloaltonetworks.com/author/claud-­xiao/
• Interests:  hardware  hacking,  retro  gaming,  cat…
iOS Malware? Seriously?
3
• FakeTor
• AdThief (SpAd)
• Unflod (SSLCreds)
• Mekir
• Paclsym (Ftuscl)
• Xsser
• AppBuyer
• Juhe
• WireLurker
• CloudAtlas (XAgent)
• Youmi
• Masque
• PawnStorm
• Oneclickfraud
• AppsBg (LockSaveFree)
• KeyRaider
• XcodeGhost
• YiSpecter
• Muda
• TinyV
• AdSage (iBackDoor)
• InstaAgent
• ZergHelper
• WhatsappStealer
• AceDeceiver
• Instealy
• Vpon
RED:  Non-­jailbroken
Italic:  was  in  App  Store
Trojan,  Adware,  Spyware,  Exploit,  Backdoor,  Riskware,  PUP  are  all  included.  
2014
2015
2016
4
We  are  talking  Non-­jailbroken iOS  malware  only  today.
Lifetime of iOS Malware
5
Produce
• Toolchain	
  Attack
• Risky	
  SDKs
• Repackaging
Distribute
• Enterprise	
  Dist.
• Ad-­‐hoc	
  Dist.
• App	
  Store
• USB Sideload
• FairPlay MITM
• MDM
Be	
  Evil
• Private	
  APIs
• Hot	
  Patching
• Hooking
• Design	
  Flaws
Profit
• Advertisement
• Accounts
• App	
  Promotion
• User	
  Privacy
To Avoid Confusions
6
• Risky  vs  Malicious
• Many  behaviors  are  not  so  significantly  malicious,  but  they’re  still  risky.
• We  use  the  term  “malware”  today  but  Riskware,  PUP,  etc.  are  included.
• In-­the-­Wild vs  Proof-­of-­Concept
• There’re  some  excellent  researches  of  PoC iOS  malware  since  2009.
• We  just  consider  ITW  ones  here.
• Interactive vs  Automate
• Most  iOS  malware  required  user  interactions  (e.g.,  to  be  installed/executed).
• Phishing  /  cheating  were  commonly  used.
To Avoid Confusions
7
• Regional vs  Worldwide
• Many  iOS  malware  affect  mainland  China.
• Some  of  them  still  spread  around  the  world.
• Some  techniques  were  adopted  by  more  malware  families  around  the  world.
• Design  Flaw vs  Coding  Vulnerability
• Tons  of  awesome  vulnerabilities  were  discovered.  That’s  a  big  topic.
• Vulnerabilities  may  have  been  used  by  unknown  advanced  malware.
• We  only  discuss  “boring”  design  flaws  today.  
Massively Produce iOS Malware
8
• By  Trojanize the  toolchain
• By  poison  3rd party  libraries
• By  repackage pirated  apps/games
Trojanize a Compiler
9
• An  old  idea  presented  by  Ken  Thompson  in  1983
• 2009:  Induc infected  Delphi  compiler
• 2010:  Stuxnet attacked  PLC  devices  toolchain
• How  easy  to  do  it  in  2010s  on  Xcode?  
Review the XcodeGhost
10
•7	
  versions
•6	
  months
•1	
  line	
  changing
Trojanize
Xcode
•Cloud	
  storage
•SEO/Forums
•P2P	
  poisoning?
Distribute
•CDN	
  failure
•Gatekeeper
Infect	
  Mac
•>	
  4,000	
  apps
•Vulnerability!
Infect	
  Apps
•abnormal	
  traffic
•C2 server	
  down
Discover
Trojanize a Compiler
11
• Motivation:  why  developers  used  Xcode from  unofficial  sources?
• Mitigation:  enable  Gatekeeper,  check  integrity
• Further  problems:
• Locally  infection  /  compiling  time  infection
• Toolchain  doesn’t  only  include  a  compiler!
Risky 3rd Party Code
12
• SDKs/libraries  are  not  always  transparent  to  developers
SDK Time Behaviors Techniques Affections
Juhe Oct	
  2014
Collecting	
  contacts	
  information,	
  IMEI,	
  
model,	
  locations,	
  etc.
None >=	
  2
Youmi Oct	
  2015
Collecting	
  app	
  list,	
  serial	
  number,	
  Apple	
  ID	
  
email
Private	
  APIs	
  +	
  
encryption
>	
  1,000
AdSage Nov	
  2015
Remotely	
  control,	
  multiple	
  sensitive	
  
functionalities
Private	
  APIs	
  	
  +	
  
JavaScript
>	
  2,800
Vpon June 2016
Upload audio,	
  video, screenshot,	
  location,	
  
internal	
  files,	
  contacts,	
  etc.	
  Open	
  URL.
JavaScript >=	
  49
Risky 3rd Party Code
13
• Kai  Chen  et  al.  Following  Devil’s  Footprints:  Cross-­Platform  Analysis  of  Potentially  
Harmful  Libraries  on  Android  and  iOS.  Oakland’16
Risky 3rd Party Code
14
• Why  those  SDKs  have  sensitive/risky  code?  
• Sandbox  isn’t  fine  grant  enough  to  split  app  code  and  3rd party  code
• Read/write  app’s  data
• Manipulate  app’s  code
• Resolve  the  issue?  
• Only  use  well  known,  trustworthy  SDKs/libraires
• Review  source  code  and  binary  code
Repackage Pirated Apps
15
• Most  Android  malware  samples  were  produced  by  repackaging.
• Repackage  an  iOS  app  for  non-­jailbroken  devices:
• For  fun:  https://github.com/KJCracks/yololib
Decrypt
app
•dumpdecrypted
•clutch
Add  
dylib
•init
•do	
  evil!
Patch  
Mach-­‐O
•LC_LOAD_DYLIB
•fix	
  header
Resign  
app
•cert
•codesign
Redist-­‐
ribute
•enterprise	
  dist
•USB	
  sideload
Repackage Pirated Apps
16
• Examples:  TinyV.b aka  ImgNaix
• Why  will  people  install  pirated  apps/games?
• “free”  apps/games
• “free”  in-­app-­purchase   items
• game  cheating
• ads-­free
• “awesome”  additional   functionalities
Distribute Malware to Devices
17
• Enterprise  Distribution
• Ad-­hoc  Distribution
• App  Store
• USB  Sideload
• MDM
Enterprise / Ad-­hoc Distribution
18
• Deploy  internal  apps  within  organization
• To  obtain  an  enterprise  certificate
• DUNS  number  +  documents  +  $299
• ~  1.5  bitcoins  in  “market”
• Signing-­as-­a-­Service
• Was  also  widely  used  by  pirated  app  
markets
Enterprise / Ad-­hoc Distribution
19
• WireLurker,  YiSpecter,  HackingTeam,  
Oneclickfraud,  Tracer
• itms-­‐services:// scheme
• Ads  network
• Dedicate  websites
• Compromised  websites
• Traffic  hijacking
• SNS  shared  HTML  files
• Embedded  in  apps
• openURL
YiSpecter was  spread  by  traffic  hijacking
Enterprise / Ad-­hoc Distribution
20
• Personal  development  certificate
• $99  -­>  $0
• <  100  devices
• ZergHelper
• Apply  personal  cert  from  Apple  in  background
Enterprise / Ad-­hoc Distribution
21
• Problem  Mitigations
• Manually  confirmation  via  prompted  dialog  (<  iOS  9)  or  
Settings  menu (>=  iOS  9.0)
• Revoke  abused  enterprise  certificate
• 3  to  7  days  OCSP  cache
• Not  immediately  effective  to  all  affected  devices
• Low  cost  to  get  another  one
• Delete  developer  ID
• Reduce  personal  certificate  valid  date
App Store: how to bypass vetting
22
• The  only  document  about  the  vetting:  https://developer.apple.com/app-­
store/review/guidelines/
• Static?  Dynamic?  Manually?  Automatically?  
App Store: how to bypass vetting
23
• Option  1.  “Jekyll”
• A  novel  idea  to  exploit  “backdoor”  in  
your  own  app  by  ROP
• “High-­tech”  for  some  attackers
• Tielei Wang  et  al.  Jekyll  on  iOS:  
When  Benign  Apps  Become  Evil.  
USENIX  Security  2013.
App Store: how to bypass vetting
24
• Option  2.  Code  Obfuscation
• Deal  with  static  analyses  during  vetting  
(if  there’s  any)
• reflection
• encrypting  sensitive  strings
• Deal  with  expert’s  manually  review  (if  
there’s  any,  I  doubt  so)
• Obfuscator-­LLVM
• Identifier  Mangling  (e.g.,  ios-­class-­
guard)
• Packers  (e.g.,  Safengine,  
strong.protect)
App Store: how to bypass vetting
25
• Option  3.  Target  specific  data
• E.g.,  steal  SNS  accounts
• InstaAgent,  Instealy,  …
• WhatsappStealer
• E.g.,  FakeTor
Images  from:  http://www.macrumors.com/2015/11/10/malicious-­
instaagent-­instagram-­app/
App Store: how to bypass vetting
26
• Option  4.  Environment  checking
• Think  Apple’s  manually  review  as  sandbox  
such  as  “Bouncer”  by  Google.
• Trigger  behaviors  by:
• Geolocation
• IP  address
• Device  language
• Date
• …
App Store: how to bypass vetting
27
• Option  5.  Just  do  it!
• Example:  ZergHelper
• Many  sensitive  APIs/strings  existed  in  
its  code  in  plaintext!
App Store: how to bypass vetting
28
• Problem  Mitigation
• Remove  the  app  from  App  Store
• Not  actually  removing,  but  just  hiding
• Existing  users  could  still  install  it  /  update  it
• Can’t  prevent  FairPlay MITM
• Lack  of  remote  killing
• More  strictly  code  review?
USB Sideload
29
• “Matcan”  attack
• Install  app  via  USB  cable
• Run  the  app  in  background
• ITW  case:  WireLurker,  AceDeceiver
• “BackStab”  attack
• Mitigation
FairPlay MITM
30
• The  FairPlay DRM  protocol
App	
  Store User	
  PC	
  w/	
  iTunes iOS	
  Devices
Purchase	
  app Install	
  app
(1)	
  afsync.rq	
  &	
  afsync.rq.sig
(2)	
  afsync.rs	
  &	
  afsync.rs.sig
FairPlay MITM
31
• Design  Flaws
• For  each  Apple  ID,  only  restricted  how  many  (5)  PCs/Macs  could  be  authorized,  no  
restriction  on  how  many  iPhone  could  be  used.
• DRM  protection  is  only  relevant  with  the  app  itself  – irrelevant  with  Apple  ID,  PC,  
Mac  or  iDevice
• Rely  security  on  1)  computer  authorization;;  2)  physical  connection  between  
computer  and  iDevice
• MITM  Attack
App	
  Store Attacker Victim	
  PC	
  w/
3rd party	
  client
iOS	
  Devices
Transfer	
  authPurchase	
  app Install	
  app
FairPlay MITM: AceDeceiver Case
32
App	
  Store
Win	
  Client
C2	
  Server
Victim	
  PC iOS	
  Devices
Attacker
1.	
  submit	
  app
2.	
  download	
  
app	
  &	
  auth
3.	
  embed	
  app
4.	
  deploy	
  auth
5.	
  install	
  client
6.	
  fetch	
  auth
7.	
  FairPlay	
  MITM
8.	
  upload	
  password
FairPlay MITM
33
• How  to  mitigate  it?
• Removing  from  App  Store  won’t  resolve  the  problem
• Fix  the  design  flaws  in  iTunes?  Consider  about  backward  compatible…
Abuse MDM
34
• Much  more  powerful  than  enterprise  
distribution
• Remotely  installing  apps/profiles
• Some  may  be  vulnerable.
• Some  has  been  abused.
• E.g.,  ZergHelper
Do something evil!
35
• Private  APIs
• Hot  Patching
• Runtime  Hooking
• Design  Flaws
Abusing Private APIs
36
• Undocumented  but  exposed  APIs
Abusing Private APIs
37
• Capabilities  (some  are  unavailable  in  recent  iOS  versions)
• Install  or  uninstall  apps
• Get  list  of  installed  apps,  running  apps,  front  most  app
• Launch  an  installed  app
• Send/receive  SMS
• Make  phone  call,  monitor  incoming  phone  call
• Get  device  ID,  Apple  ID,  ad  ID
• Take  photo
• ……
Abusing Private APIs
38
• Mitigations
• Re-­design  sensitive  resources’  handling  mechanisms
• Remove  unnecessary  APIs
• Require  entitlements to  access  sensitive  APIs
Hot patching
39
• Code  downloading/loading/updating  are  disallowed  by  Apple.
• Bypassed  by  scripts  (JavaScript,  Lua,  etc.)  +  Method  Swizzling
• Like  ROP,  scripts  act  as  data  to  drive  code  execution
• Hot  patching  frameworks:  JSPatch,  waxPatch
• Could  be  abused  to  implement:
• remotely  controlling
• sensitive  code  hiding
• two  stages  attacking:  loader  +  payloads
Runtime Manipulations
40
• Based  on  repackaging
• Won’t  affect  original  apps’  executing
• Cycript,  CaptainHook,  etc.  Or  customized  hooking  code.
• Manipulate  apps’  code,  access  their  data
• All-­in-­one  for  fun:  https://github.com/Urinx/iOSAppHook
More Runtime Manipulation
41
• Case:  Tracer (aka  Killmob)
• Commercial  Spyware  for  jailbroken  devices since  July  2013
• Repackaged  into  Facebook,  Skype,  Whatsapp,  Telegraph,  WeChat,  etc.  at  Mar  
2015  to  affect  non-­jailbroken  devices
• Exploit  Masque  vulnerability  (1-­day)
• Runtime  hook  chatting  app’s  APIs  to  steal  chatting  history
Design Flaws
42
• Collision  of  some  things that  supposed  to  be  unique:
• “Masque”  vulnerabilities:  bundle  ID  of  apps,  plugins,  extensions,  itms-­‐services
• URL hijacking:  URL  scheme
• IPC
• URL  scheme  hijacking
• Cross-­app  resource  access  attack
• Luyi Xing  et  al.  Unauthorized  Cross-­App  Resource  Access  on  MAC  OS  X  and  iOS
Make Profit
43
• Advertisement
• Account/Credentials
• App  Promotion
• Privacy  Data
Review the Approaches
44
Produce
• Toolchain	
  Attack
• Risky	
  SDKs
• Repackaging
Distribute
• Enterprise	
  Dist.
• Ad-­‐hoc	
  Dist.
• App	
  Store
• USB Sideload
• FairPlay MITM
• MDM
Be	
  Evil
• Private	
  APIs
• Hot	
  Patching
• Hooking
• Design	
  Flaws
Profit
• Advertisement
• Accounts
• App	
  Promotion
• User	
  Privacy
Take Away I
45
• Malware  (especially  on  iOS)  is  NOT  necessarily  to  be
• dedicated
• small  size
• malicious  functionalities  only
• transparent  to  victims
• non-­interactive  with  victims
• spread  automatically
• developed  by  individuals
• designed  to  attack  everyone
• …
Take Away II
46
• Practical  &  low  tech  methods  to  produce,  distribute,  attack  and  profit
• Some  techniques  have  been  mitigated;;  some  haven’t  yet  or  even  won’t  be.  
• Discover  more  malware  by  studying  motivations,  ecosystems  and  
implementations
Security Suggestions
47
• Avoid  installing  apps  from  any  third  party  or  signed  by  untrusted  certificates.
• Keep  iOS  system  update  to  date.
• Protect  PC  and  Mac  computers  by  proper  security  products.
• Protect  the  network  you’re  using  by  proper  security  products.
• For  developers:
• Protect  your  compiling  server/PC
• Check  toolchain  integrity
• Use  well  known,  trustworthy  3rd party  SDKs.  Download  them  from  official  websites.
• Perform  code  auditing  to  source  code  AND  binary  code  of  your  products.
Mahalo! Thank you!
48
• Special  thanks  to:
• Ming  Zheng  (@SparkZheng)
• CDSQ  (@wecdsq)
• Zhaofeng Chen
• Ryan  Olson  (@ireo),  Zhi Xu,  Richard  Wartell,  and  all  team  members  of  WildFire,  
IPS,  GSRT,  Unit  42  at  Palo  Alto  Networks
@claud_xiao
iclaudxiao@gmail.com

Contenu connexe

Tendances

Csw2016 chaykin having_funwithsecuremessengers_and_androidwear
Csw2016 chaykin having_funwithsecuremessengers_and_androidwearCsw2016 chaykin having_funwithsecuremessengers_and_androidwear
Csw2016 chaykin having_funwithsecuremessengers_and_androidwear
CanSecWest
 
Csw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelistingCsw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelisting
CanSecWest
 
TeelTech - Advancing Mobile Device Forensics (online version)
TeelTech - Advancing Mobile Device Forensics (online version)TeelTech - Advancing Mobile Device Forensics (online version)
TeelTech - Advancing Mobile Device Forensics (online version)
Mike Felch
 

Tendances (20)

Using GreyNoise to Quantify Response Time of Cloud Provider Abuse Teams
Using GreyNoise to Quantify Response Time of Cloud Provider Abuse TeamsUsing GreyNoise to Quantify Response Time of Cloud Provider Abuse Teams
Using GreyNoise to Quantify Response Time of Cloud Provider Abuse Teams
 
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteliDefcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
 
Csw2016 chaykin having_funwithsecuremessengers_and_androidwear
Csw2016 chaykin having_funwithsecuremessengers_and_androidwearCsw2016 chaykin having_funwithsecuremessengers_and_androidwear
Csw2016 chaykin having_funwithsecuremessengers_and_androidwear
 
Top 10 Threats to Cloud Security
Top 10 Threats to Cloud SecurityTop 10 Threats to Cloud Security
Top 10 Threats to Cloud Security
 
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malwareDefcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
 
Offensive Python for Pentesting
Offensive Python for PentestingOffensive Python for Pentesting
Offensive Python for Pentesting
 
Sticky Keys to the Kingdom
Sticky Keys to the KingdomSticky Keys to the Kingdom
Sticky Keys to the Kingdom
 
Heartbleed Overview
Heartbleed OverviewHeartbleed Overview
Heartbleed Overview
 
No Easy Breach DerbyCon 2016
No Easy Breach DerbyCon 2016No Easy Breach DerbyCon 2016
No Easy Breach DerbyCon 2016
 
Offence oriented Defence
Offence oriented DefenceOffence oriented Defence
Offence oriented Defence
 
Rat a-tat-tat
Rat a-tat-tatRat a-tat-tat
Rat a-tat-tat
 
Csw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelistingCsw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelisting
 
Infosecurity.be 2019: What are relevant open source security tools you should...
Infosecurity.be 2019: What are relevant open source security tools you should...Infosecurity.be 2019: What are relevant open source security tools you should...
Infosecurity.be 2019: What are relevant open source security tools you should...
 
Outlook and Exchange for the bad guys
Outlook and Exchange for the bad guysOutlook and Exchange for the bad guys
Outlook and Exchange for the bad guys
 
ShmooCon 2015: No Budget Threat Intelligence - Tracking Malware Campaigns on ...
ShmooCon 2015: No Budget Threat Intelligence - Tracking Malware Campaigns on ...ShmooCon 2015: No Budget Threat Intelligence - Tracking Malware Campaigns on ...
ShmooCon 2015: No Budget Threat Intelligence - Tracking Malware Campaigns on ...
 
TeelTech - Advancing Mobile Device Forensics (online version)
TeelTech - Advancing Mobile Device Forensics (online version)TeelTech - Advancing Mobile Device Forensics (online version)
TeelTech - Advancing Mobile Device Forensics (online version)
 
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure  BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
 
Visiting the Bear Den
Visiting the Bear DenVisiting the Bear Den
Visiting the Bear Den
 
Defcon 22-philip-young-from-root-to-special-hacking-ibm-main
Defcon 22-philip-young-from-root-to-special-hacking-ibm-mainDefcon 22-philip-young-from-root-to-special-hacking-ibm-main
Defcon 22-philip-young-from-root-to-special-hacking-ibm-main
 
What's in a Jailbreak? - BSides 2019 keynote
What's in a Jailbreak? - BSides 2019 keynoteWhat's in a Jailbreak? - BSides 2019 keynote
What's in a Jailbreak? - BSides 2019 keynote
 

En vedette

Faux Disk Encryption....by Drew Suarez & Daniel Mayer
Faux Disk Encryption....by Drew Suarez & Daniel MayerFaux Disk Encryption....by Drew Suarez & Daniel Mayer
Faux Disk Encryption....by Drew Suarez & Daniel Mayer
Shakacon
 
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
Shakacon
 
Making a Scalable Automated Hacking System by Artem Dinaburg
Making a Scalable Automated Hacking System by Artem DinaburgMaking a Scalable Automated Hacking System by Artem Dinaburg
Making a Scalable Automated Hacking System by Artem Dinaburg
Shakacon
 

En vedette (11)

Faux Disk Encryption....by Drew Suarez & Daniel Mayer
Faux Disk Encryption....by Drew Suarez & Daniel MayerFaux Disk Encryption....by Drew Suarez & Daniel Mayer
Faux Disk Encryption....by Drew Suarez & Daniel Mayer
 
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
 
Swift Reversing by Ryan Stortz
Swift Reversing by Ryan StortzSwift Reversing by Ryan Stortz
Swift Reversing by Ryan Stortz
 
Anti-Reversing: A Cake Full of Onions by Richard Wartell
Anti-Reversing: A Cake Full of Onions by Richard WartellAnti-Reversing: A Cake Full of Onions by Richard Wartell
Anti-Reversing: A Cake Full of Onions by Richard Wartell
 
Hunting Government Back Doors by Joseph Menn
Hunting Government Back Doors by Joseph MennHunting Government Back Doors by Joseph Menn
Hunting Government Back Doors by Joseph Menn
 
Windows Systems & Code Signing Protection by Paul Rascagneres
Windows Systems & Code Signing Protection by Paul RascagneresWindows Systems & Code Signing Protection by Paul Rascagneres
Windows Systems & Code Signing Protection by Paul Rascagneres
 
Let's Play Doctor....by Patrick Wardle
Let's Play Doctor....by Patrick WardleLet's Play Doctor....by Patrick Wardle
Let's Play Doctor....by Patrick Wardle
 
The Search for the Perfect Door - Deviant Ollam
The Search for the Perfect Door - Deviant OllamThe Search for the Perfect Door - Deviant Ollam
The Search for the Perfect Door - Deviant Ollam
 
Making a Scalable Automated Hacking System by Artem Dinaburg
Making a Scalable Automated Hacking System by Artem DinaburgMaking a Scalable Automated Hacking System by Artem Dinaburg
Making a Scalable Automated Hacking System by Artem Dinaburg
 
Appium & Jenkins
Appium & JenkinsAppium & Jenkins
Appium & Jenkins
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 

Similaire à Fruit vs Zombies: Defeat Non-jailbroken iOS Malware by Claud Xiao

I haz you and pwn your maal
I haz you and pwn your maalI haz you and pwn your maal
I haz you and pwn your maal
Harsimran Walia
 
михаил дударев
михаил дударевмихаил дударев
михаил дударев
apps4allru
 
Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013
Stephan Chenette
 

Similaire à Fruit vs Zombies: Defeat Non-jailbroken iOS Malware by Claud Xiao (20)

Hacking your Android (slides)
Hacking your Android (slides)Hacking your Android (slides)
Hacking your Android (slides)
 
Mobile platform security models
Mobile platform security modelsMobile platform security models
Mobile platform security models
 
Smart Bombs: Mobile Vulnerability and Exploitation
Smart Bombs: Mobile Vulnerability and ExploitationSmart Bombs: Mobile Vulnerability and Exploitation
Smart Bombs: Mobile Vulnerability and Exploitation
 
I haz you and pwn your maal
I haz you and pwn your maalI haz you and pwn your maal
I haz you and pwn your maal
 
SmartDevCon - Katowice - 2013
SmartDevCon - Katowice - 2013SmartDevCon - Katowice - 2013
SmartDevCon - Katowice - 2013
 
I haz you and pwn your maal
I haz you and pwn your maalI haz you and pwn your maal
I haz you and pwn your maal
 
Malware cryptomining uploadv3
Malware cryptomining uploadv3Malware cryptomining uploadv3
Malware cryptomining uploadv3
 
Outsmarting SmartPhones
Outsmarting SmartPhonesOutsmarting SmartPhones
Outsmarting SmartPhones
 
Yow connected developing secure i os applications
Yow connected   developing secure i os applicationsYow connected   developing secure i os applications
Yow connected developing secure i os applications
 
михаил дударев
михаил дударевмихаил дударев
михаил дударев
 
Droidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensicsDroidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensics
 
Mobile Apps Security
Mobile Apps SecurityMobile Apps Security
Mobile Apps Security
 
Hacking Mobile Apps
Hacking Mobile AppsHacking Mobile Apps
Hacking Mobile Apps
 
Ten security product categories you've (probably) never heard of
Ten security product categories you've (probably) never heard ofTen security product categories you've (probably) never heard of
Ten security product categories you've (probably) never heard of
 
The Android vs. Apple iOS Security Showdown
The Android vs. Apple iOS Security Showdown The Android vs. Apple iOS Security Showdown
The Android vs. Apple iOS Security Showdown
 
Hacking your Droid (Aditya Gupta)
Hacking your Droid (Aditya Gupta)Hacking your Droid (Aditya Gupta)
Hacking your Droid (Aditya Gupta)
 
Reading Group Presentation: Why Eve and Mallory Love Android
Reading Group Presentation: Why Eve and Mallory Love AndroidReading Group Presentation: Why Eve and Mallory Love Android
Reading Group Presentation: Why Eve and Mallory Love Android
 
iOS Application Security.pdf
iOS Application Security.pdfiOS Application Security.pdf
iOS Application Security.pdf
 
Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013
 
Cracking the Mobile Application Code
Cracking the Mobile Application CodeCracking the Mobile Application Code
Cracking the Mobile Application Code
 

Plus de Shakacon

Pwned in Translation - from Subtitles to RCE
Pwned in Translation - from Subtitles to RCEPwned in Translation - from Subtitles to RCE
Pwned in Translation - from Subtitles to RCE
Shakacon
 
Oversight: Exposing spies on macOS
Oversight: Exposing spies on macOS Oversight: Exposing spies on macOS
Oversight: Exposing spies on macOS
Shakacon
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
Shakacon
 
Reviewing the Security of ASoC Drivers in Android Kernel
Reviewing the Security of ASoC Drivers in Android KernelReviewing the Security of ASoC Drivers in Android Kernel
Reviewing the Security of ASoC Drivers in Android Kernel
Shakacon
 

Plus de Shakacon (20)

Web (dis)assembly
Web (dis)assemblyWeb (dis)assembly
Web (dis)assembly
 
Macdoored
MacdooredMacdoored
Macdoored
 
I can be apple and so can you
I can be apple and so can youI can be apple and so can you
I can be apple and so can you
 
Cloud forensics putting the bits back together
Cloud forensics putting the bits back togetherCloud forensics putting the bits back together
Cloud forensics putting the bits back together
 
Pwned in Translation - from Subtitles to RCE
Pwned in Translation - from Subtitles to RCEPwned in Translation - from Subtitles to RCE
Pwned in Translation - from Subtitles to RCE
 
Oversight: Exposing spies on macOS
Oversight: Exposing spies on macOS Oversight: Exposing spies on macOS
Oversight: Exposing spies on macOS
 
Modern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layerModern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layer
 
Shamoon
ShamoonShamoon
Shamoon
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
 
Honey, I Stole Your C2 Server: A Dive into Attacker Infrastructure
Honey, I Stole Your C2 Server:  A Dive into Attacker InfrastructureHoney, I Stole Your C2 Server:  A Dive into Attacker Infrastructure
Honey, I Stole Your C2 Server: A Dive into Attacker Infrastructure
 
Dock ir incident response in a containerized, immutable, continually deploy...
Dock ir   incident response in a containerized, immutable, continually deploy...Dock ir   incident response in a containerized, immutable, continually deploy...
Dock ir incident response in a containerized, immutable, continually deploy...
 
Reviewing the Security of ASoC Drivers in Android Kernel
Reviewing the Security of ASoC Drivers in Android KernelReviewing the Security of ASoC Drivers in Android Kernel
Reviewing the Security of ASoC Drivers in Android Kernel
 
Silent Protest: A Wearable Protest Network
Silent Protest:  A Wearable Protest NetworkSilent Protest:  A Wearable Protest Network
Silent Protest: A Wearable Protest Network
 
WiFi-Based IMSI Catcher
WiFi-Based IMSI CatcherWiFi-Based IMSI Catcher
WiFi-Based IMSI Catcher
 
Sad Panda Analysts: Devolving Malware
Sad Panda Analysts:  Devolving MalwareSad Panda Analysts:  Devolving Malware
Sad Panda Analysts: Devolving Malware
 
reductio [ad absurdum]
reductio [ad absurdum]reductio [ad absurdum]
reductio [ad absurdum]
 
XFLTReat: a new dimension in tunnelling
XFLTReat:  a new dimension in tunnellingXFLTReat:  a new dimension in tunnelling
XFLTReat: a new dimension in tunnelling
 
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
 
0Day Hunting A.K.A. The Story of a Proper CPE Test by Balazs Bacsay
0Day Hunting A.K.A. The Story of a Proper CPE Test by Balazs Bacsay0Day Hunting A.K.A. The Story of a Proper CPE Test by Balazs Bacsay
0Day Hunting A.K.A. The Story of a Proper CPE Test by Balazs Bacsay
 
Richard wartell malware is hard. let's go shopping!!
Richard wartell   malware is hard.  let's go shopping!!Richard wartell   malware is hard.  let's go shopping!!
Richard wartell malware is hard. let's go shopping!!
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Fruit vs Zombies: Defeat Non-jailbroken iOS Malware by Claud Xiao

  • 1. Fruit vs Zombies: Defeat Non-­jailbroken iOS Malware Claud  Xiao SHAKACON  2016
  • 2. Who am I 2 • @claud_xiao • 7  years  on  Antivirus  R&D • Windows,  Android,  OS  X macOS, iOS • Security  Researcher  at  Palo  Alto  Networks • WildFire team • Advanced  malware  research • http://researchcenter.paloaltonetworks.com/author/claud-­xiao/ • Interests:  hardware  hacking,  retro  gaming,  cat…
  • 3. iOS Malware? Seriously? 3 • FakeTor • AdThief (SpAd) • Unflod (SSLCreds) • Mekir • Paclsym (Ftuscl) • Xsser • AppBuyer • Juhe • WireLurker • CloudAtlas (XAgent) • Youmi • Masque • PawnStorm • Oneclickfraud • AppsBg (LockSaveFree) • KeyRaider • XcodeGhost • YiSpecter • Muda • TinyV • AdSage (iBackDoor) • InstaAgent • ZergHelper • WhatsappStealer • AceDeceiver • Instealy • Vpon RED:  Non-­jailbroken Italic:  was  in  App  Store Trojan,  Adware,  Spyware,  Exploit,  Backdoor,  Riskware,  PUP  are  all  included.   2014 2015 2016
  • 4. 4 We  are  talking  Non-­jailbroken iOS  malware  only  today.
  • 5. Lifetime of iOS Malware 5 Produce • Toolchain  Attack • Risky  SDKs • Repackaging Distribute • Enterprise  Dist. • Ad-­‐hoc  Dist. • App  Store • USB Sideload • FairPlay MITM • MDM Be  Evil • Private  APIs • Hot  Patching • Hooking • Design  Flaws Profit • Advertisement • Accounts • App  Promotion • User  Privacy
  • 6. To Avoid Confusions 6 • Risky  vs  Malicious • Many  behaviors  are  not  so  significantly  malicious,  but  they’re  still  risky. • We  use  the  term  “malware”  today  but  Riskware,  PUP,  etc.  are  included. • In-­the-­Wild vs  Proof-­of-­Concept • There’re  some  excellent  researches  of  PoC iOS  malware  since  2009. • We  just  consider  ITW  ones  here. • Interactive vs  Automate • Most  iOS  malware  required  user  interactions  (e.g.,  to  be  installed/executed). • Phishing  /  cheating  were  commonly  used.
  • 7. To Avoid Confusions 7 • Regional vs  Worldwide • Many  iOS  malware  affect  mainland  China. • Some  of  them  still  spread  around  the  world. • Some  techniques  were  adopted  by  more  malware  families  around  the  world. • Design  Flaw vs  Coding  Vulnerability • Tons  of  awesome  vulnerabilities  were  discovered.  That’s  a  big  topic. • Vulnerabilities  may  have  been  used  by  unknown  advanced  malware. • We  only  discuss  “boring”  design  flaws  today.  
  • 8. Massively Produce iOS Malware 8 • By  Trojanize the  toolchain • By  poison  3rd party  libraries • By  repackage pirated  apps/games
  • 9. Trojanize a Compiler 9 • An  old  idea  presented  by  Ken  Thompson  in  1983 • 2009:  Induc infected  Delphi  compiler • 2010:  Stuxnet attacked  PLC  devices  toolchain • How  easy  to  do  it  in  2010s  on  Xcode?  
  • 10. Review the XcodeGhost 10 •7  versions •6  months •1  line  changing Trojanize Xcode •Cloud  storage •SEO/Forums •P2P  poisoning? Distribute •CDN  failure •Gatekeeper Infect  Mac •>  4,000  apps •Vulnerability! Infect  Apps •abnormal  traffic •C2 server  down Discover
  • 11. Trojanize a Compiler 11 • Motivation:  why  developers  used  Xcode from  unofficial  sources? • Mitigation:  enable  Gatekeeper,  check  integrity • Further  problems: • Locally  infection  /  compiling  time  infection • Toolchain  doesn’t  only  include  a  compiler!
  • 12. Risky 3rd Party Code 12 • SDKs/libraries  are  not  always  transparent  to  developers SDK Time Behaviors Techniques Affections Juhe Oct  2014 Collecting  contacts  information,  IMEI,   model,  locations,  etc. None >=  2 Youmi Oct  2015 Collecting  app  list,  serial  number,  Apple  ID   email Private  APIs  +   encryption >  1,000 AdSage Nov  2015 Remotely  control,  multiple  sensitive   functionalities Private  APIs    +   JavaScript >  2,800 Vpon June 2016 Upload audio,  video, screenshot,  location,   internal  files,  contacts,  etc.  Open  URL. JavaScript >=  49
  • 13. Risky 3rd Party Code 13 • Kai  Chen  et  al.  Following  Devil’s  Footprints:  Cross-­Platform  Analysis  of  Potentially   Harmful  Libraries  on  Android  and  iOS.  Oakland’16
  • 14. Risky 3rd Party Code 14 • Why  those  SDKs  have  sensitive/risky  code?   • Sandbox  isn’t  fine  grant  enough  to  split  app  code  and  3rd party  code • Read/write  app’s  data • Manipulate  app’s  code • Resolve  the  issue?   • Only  use  well  known,  trustworthy  SDKs/libraires • Review  source  code  and  binary  code
  • 15. Repackage Pirated Apps 15 • Most  Android  malware  samples  were  produced  by  repackaging. • Repackage  an  iOS  app  for  non-­jailbroken  devices: • For  fun:  https://github.com/KJCracks/yololib Decrypt app •dumpdecrypted •clutch Add   dylib •init •do  evil! Patch   Mach-­‐O •LC_LOAD_DYLIB •fix  header Resign   app •cert •codesign Redist-­‐ ribute •enterprise  dist •USB  sideload
  • 16. Repackage Pirated Apps 16 • Examples:  TinyV.b aka  ImgNaix • Why  will  people  install  pirated  apps/games? • “free”  apps/games • “free”  in-­app-­purchase   items • game  cheating • ads-­free • “awesome”  additional   functionalities
  • 17. Distribute Malware to Devices 17 • Enterprise  Distribution • Ad-­hoc  Distribution • App  Store • USB  Sideload • MDM
  • 18. Enterprise / Ad-­hoc Distribution 18 • Deploy  internal  apps  within  organization • To  obtain  an  enterprise  certificate • DUNS  number  +  documents  +  $299 • ~  1.5  bitcoins  in  “market” • Signing-­as-­a-­Service • Was  also  widely  used  by  pirated  app   markets
  • 19. Enterprise / Ad-­hoc Distribution 19 • WireLurker,  YiSpecter,  HackingTeam,   Oneclickfraud,  Tracer • itms-­‐services:// scheme • Ads  network • Dedicate  websites • Compromised  websites • Traffic  hijacking • SNS  shared  HTML  files • Embedded  in  apps • openURL YiSpecter was  spread  by  traffic  hijacking
  • 20. Enterprise / Ad-­hoc Distribution 20 • Personal  development  certificate • $99  -­>  $0 • <  100  devices • ZergHelper • Apply  personal  cert  from  Apple  in  background
  • 21. Enterprise / Ad-­hoc Distribution 21 • Problem  Mitigations • Manually  confirmation  via  prompted  dialog  (<  iOS  9)  or   Settings  menu (>=  iOS  9.0) • Revoke  abused  enterprise  certificate • 3  to  7  days  OCSP  cache • Not  immediately  effective  to  all  affected  devices • Low  cost  to  get  another  one • Delete  developer  ID • Reduce  personal  certificate  valid  date
  • 22. App Store: how to bypass vetting 22 • The  only  document  about  the  vetting:  https://developer.apple.com/app-­ store/review/guidelines/ • Static?  Dynamic?  Manually?  Automatically?  
  • 23. App Store: how to bypass vetting 23 • Option  1.  “Jekyll” • A  novel  idea  to  exploit  “backdoor”  in   your  own  app  by  ROP • “High-­tech”  for  some  attackers • Tielei Wang  et  al.  Jekyll  on  iOS:   When  Benign  Apps  Become  Evil.   USENIX  Security  2013.
  • 24. App Store: how to bypass vetting 24 • Option  2.  Code  Obfuscation • Deal  with  static  analyses  during  vetting   (if  there’s  any) • reflection • encrypting  sensitive  strings • Deal  with  expert’s  manually  review  (if   there’s  any,  I  doubt  so) • Obfuscator-­LLVM • Identifier  Mangling  (e.g.,  ios-­class-­ guard) • Packers  (e.g.,  Safengine,   strong.protect)
  • 25. App Store: how to bypass vetting 25 • Option  3.  Target  specific  data • E.g.,  steal  SNS  accounts • InstaAgent,  Instealy,  … • WhatsappStealer • E.g.,  FakeTor Images  from:  http://www.macrumors.com/2015/11/10/malicious-­ instaagent-­instagram-­app/
  • 26. App Store: how to bypass vetting 26 • Option  4.  Environment  checking • Think  Apple’s  manually  review  as  sandbox   such  as  “Bouncer”  by  Google. • Trigger  behaviors  by: • Geolocation • IP  address • Device  language • Date • …
  • 27. App Store: how to bypass vetting 27 • Option  5.  Just  do  it! • Example:  ZergHelper • Many  sensitive  APIs/strings  existed  in   its  code  in  plaintext!
  • 28. App Store: how to bypass vetting 28 • Problem  Mitigation • Remove  the  app  from  App  Store • Not  actually  removing,  but  just  hiding • Existing  users  could  still  install  it  /  update  it • Can’t  prevent  FairPlay MITM • Lack  of  remote  killing • More  strictly  code  review?
  • 29. USB Sideload 29 • “Matcan”  attack • Install  app  via  USB  cable • Run  the  app  in  background • ITW  case:  WireLurker,  AceDeceiver • “BackStab”  attack • Mitigation
  • 30. FairPlay MITM 30 • The  FairPlay DRM  protocol App  Store User  PC  w/  iTunes iOS  Devices Purchase  app Install  app (1)  afsync.rq  &  afsync.rq.sig (2)  afsync.rs  &  afsync.rs.sig
  • 31. FairPlay MITM 31 • Design  Flaws • For  each  Apple  ID,  only  restricted  how  many  (5)  PCs/Macs  could  be  authorized,  no   restriction  on  how  many  iPhone  could  be  used. • DRM  protection  is  only  relevant  with  the  app  itself  – irrelevant  with  Apple  ID,  PC,   Mac  or  iDevice • Rely  security  on  1)  computer  authorization;;  2)  physical  connection  between   computer  and  iDevice • MITM  Attack App  Store Attacker Victim  PC  w/ 3rd party  client iOS  Devices Transfer  authPurchase  app Install  app
  • 32. FairPlay MITM: AceDeceiver Case 32 App  Store Win  Client C2  Server Victim  PC iOS  Devices Attacker 1.  submit  app 2.  download   app  &  auth 3.  embed  app 4.  deploy  auth 5.  install  client 6.  fetch  auth 7.  FairPlay  MITM 8.  upload  password
  • 33. FairPlay MITM 33 • How  to  mitigate  it? • Removing  from  App  Store  won’t  resolve  the  problem • Fix  the  design  flaws  in  iTunes?  Consider  about  backward  compatible…
  • 34. Abuse MDM 34 • Much  more  powerful  than  enterprise   distribution • Remotely  installing  apps/profiles • Some  may  be  vulnerable. • Some  has  been  abused. • E.g.,  ZergHelper
  • 35. Do something evil! 35 • Private  APIs • Hot  Patching • Runtime  Hooking • Design  Flaws
  • 36. Abusing Private APIs 36 • Undocumented  but  exposed  APIs
  • 37. Abusing Private APIs 37 • Capabilities  (some  are  unavailable  in  recent  iOS  versions) • Install  or  uninstall  apps • Get  list  of  installed  apps,  running  apps,  front  most  app • Launch  an  installed  app • Send/receive  SMS • Make  phone  call,  monitor  incoming  phone  call • Get  device  ID,  Apple  ID,  ad  ID • Take  photo • ……
  • 38. Abusing Private APIs 38 • Mitigations • Re-­design  sensitive  resources’  handling  mechanisms • Remove  unnecessary  APIs • Require  entitlements to  access  sensitive  APIs
  • 39. Hot patching 39 • Code  downloading/loading/updating  are  disallowed  by  Apple. • Bypassed  by  scripts  (JavaScript,  Lua,  etc.)  +  Method  Swizzling • Like  ROP,  scripts  act  as  data  to  drive  code  execution • Hot  patching  frameworks:  JSPatch,  waxPatch • Could  be  abused  to  implement: • remotely  controlling • sensitive  code  hiding • two  stages  attacking:  loader  +  payloads
  • 40. Runtime Manipulations 40 • Based  on  repackaging • Won’t  affect  original  apps’  executing • Cycript,  CaptainHook,  etc.  Or  customized  hooking  code. • Manipulate  apps’  code,  access  their  data • All-­in-­one  for  fun:  https://github.com/Urinx/iOSAppHook
  • 41. More Runtime Manipulation 41 • Case:  Tracer (aka  Killmob) • Commercial  Spyware  for  jailbroken  devices since  July  2013 • Repackaged  into  Facebook,  Skype,  Whatsapp,  Telegraph,  WeChat,  etc.  at  Mar   2015  to  affect  non-­jailbroken  devices • Exploit  Masque  vulnerability  (1-­day) • Runtime  hook  chatting  app’s  APIs  to  steal  chatting  history
  • 42. Design Flaws 42 • Collision  of  some  things that  supposed  to  be  unique: • “Masque”  vulnerabilities:  bundle  ID  of  apps,  plugins,  extensions,  itms-­‐services • URL hijacking:  URL  scheme • IPC • URL  scheme  hijacking • Cross-­app  resource  access  attack • Luyi Xing  et  al.  Unauthorized  Cross-­App  Resource  Access  on  MAC  OS  X  and  iOS
  • 43. Make Profit 43 • Advertisement • Account/Credentials • App  Promotion • Privacy  Data
  • 44. Review the Approaches 44 Produce • Toolchain  Attack • Risky  SDKs • Repackaging Distribute • Enterprise  Dist. • Ad-­‐hoc  Dist. • App  Store • USB Sideload • FairPlay MITM • MDM Be  Evil • Private  APIs • Hot  Patching • Hooking • Design  Flaws Profit • Advertisement • Accounts • App  Promotion • User  Privacy
  • 45. Take Away I 45 • Malware  (especially  on  iOS)  is  NOT  necessarily  to  be • dedicated • small  size • malicious  functionalities  only • transparent  to  victims • non-­interactive  with  victims • spread  automatically • developed  by  individuals • designed  to  attack  everyone • …
  • 46. Take Away II 46 • Practical  &  low  tech  methods  to  produce,  distribute,  attack  and  profit • Some  techniques  have  been  mitigated;;  some  haven’t  yet  or  even  won’t  be.   • Discover  more  malware  by  studying  motivations,  ecosystems  and   implementations
  • 47. Security Suggestions 47 • Avoid  installing  apps  from  any  third  party  or  signed  by  untrusted  certificates. • Keep  iOS  system  update  to  date. • Protect  PC  and  Mac  computers  by  proper  security  products. • Protect  the  network  you’re  using  by  proper  security  products. • For  developers: • Protect  your  compiling  server/PC • Check  toolchain  integrity • Use  well  known,  trustworthy  3rd party  SDKs.  Download  them  from  official  websites. • Perform  code  auditing  to  source  code  AND  binary  code  of  your  products.
  • 48. Mahalo! Thank you! 48 • Special  thanks  to: • Ming  Zheng  (@SparkZheng) • CDSQ  (@wecdsq) • Zhaofeng Chen • Ryan  Olson  (@ireo),  Zhi Xu,  Richard  Wartell,  and  all  team  members  of  WildFire,   IPS,  GSRT,  Unit  42  at  Palo  Alto  Networks @claud_xiao iclaudxiao@gmail.com