Mactans: Injec,ng Malware into iOS Devices via Malicious - - PowerPoint PPT Presentation

mactans injec ng malware into ios devices via malicious
SMART_READER_LITE
LIVE PREVIEW

Mactans: Injec,ng Malware into iOS Devices via Malicious - - PowerPoint PPT Presentation

Mactans: Injec,ng Malware into iOS Devices via Malicious Chargers Billy Lau Yeongjin Jang Chengyu Song 1 Agenda iOS Security Mactans


slide-1
SLIDE 1

Mactans: ¡Injec,ng ¡Malware ¡into ¡iOS ¡ Devices ¡via ¡Malicious ¡Chargers ¡

Billy ¡Lau ¡ Yeongjin ¡Jang ¡ Chengyu ¡Song ¡

1 ¡

slide-2
SLIDE 2

Agenda ¡

  • iOS ¡Security ¡
  • Mactans ¡
  • Discussion ¡

2 ¡

slide-3
SLIDE 3

IOS ¡SECURITY ¡

an ¡overview ¡of ¡

3 ¡

slide-4
SLIDE 4

Apple ¡App ¡Store ¡

  • The ¡walled ¡garden ¡model ¡

– Acts ¡as ¡plaHorm ¡to ¡publish ¡apps ¡

  • The ¡only ¡place ¡to ¡purchase/download ¡apps ¡

– Completely ¡controlled ¡by ¡Apple ¡

  • All ¡apps ¡must ¡be ¡reviewed ¡by ¡Apple ¡before ¡release ¡
  • A ¡released ¡app ¡can ¡be ¡removed ¡from ¡the ¡store ¡if ¡it ¡

violates ¡policy ¡

4 ¡

slide-5
SLIDE 5

Code ¡Signing ¡in ¡iOS ¡

  • Enforces ¡the ¡integrity ¡of ¡the ¡boot ¡chain ¡and ¡

walled ¡garden ¡model ¡

  • Only ¡correctly ¡signed ¡apps ¡can ¡be ¡installed ¡and ¡

executed ¡

  • Signing ¡En,,es ¡

– Apple ¡App ¡Store ¡ – iOS ¡developers ¡

5 ¡

slide-6
SLIDE 6

App ¡Review ¡

  • APempts ¡to ¡determine ¡whether ¡the ¡submiPed ¡

app ¡complies ¡with ¡the ¡rules ¡

  • What ¡are ¡the ¡rules? ¡

– Largely ¡empirical ¡

  • Apps ¡that ¡make ¡use ¡of ¡private ¡APIs ¡are ¡rejected ¡and ¡

banned ¡

– Changing ¡constantly ¡

  • What ¡happens ¡during ¡app ¡review? ¡

– Sta,c ¡analysis ¡and ¡some ¡manual ¡tes,ng ¡(we ¡think) ¡

6 ¡

slide-7
SLIDE 7

iOS ¡Sandbox ¡

  • Process ¡isola,on ¡

– A ¡sandboxed ¡process ¡cannot ¡read ¡other ¡processes’ ¡ memory ¡ – Also ¡cannot ¡talk ¡to ¡other ¡processes ¡using ¡tradi,onal ¡IPC-­‑ like ¡APIs ¡

  • Filesystem ¡isola,on ¡

– Sandboxed ¡app ¡can ¡only ¡read/write ¡to ¡its ¡own ¡filesystem ¡

  • Can ¡also ¡read ¡(but ¡not ¡write ¡to) ¡some ¡public ¡files ¡
  • En,tlement ¡check ¡

– For ¡some ¡opera,ons ¡(e.g., ¡change ¡passcode, ¡execute ¡other ¡ apps), ¡iOS ¡enforces ¡app ¡En,tlements ¡

7 ¡

slide-8
SLIDE 8

Walled ¡Garden ¡Effec,veness ¡

  • The ¡walled ¡garden ¡model ¡is ¡assumed ¡to ¡be ¡

secure ¡

– All ¡apps ¡are ¡carefully ¡vePed ¡prior ¡to ¡release ¡

  • Compared ¡to ¡Android, ¡almost ¡no ¡in-­‑the-­‑wild ¡

malware ¡instances ¡for ¡iOS ¡

8 ¡

slide-9
SLIDE 9

MACTANS ¡

a ¡step-­‑by-­‑step ¡introduc,on ¡to ¡

9 ¡

slide-10
SLIDE 10

Mactans ¡Concept ¡

  • Not ¡a ¡jailbreak ¡

– Does ¡not ¡require ¡a ¡jailbroken ¡device ¡

  • Automa,c ¡

– Simply ¡connec,ng ¡the ¡device ¡is ¡enough ¡ ¡

  • Stealthy ¡

– There ¡are ¡no ¡visible ¡clues ¡

  • Powerful ¡

– Does ¡malicious ¡things ¡other ¡apps ¡cannot ¡do ¡

10 ¡

slide-11
SLIDE 11

Anatomy ¡of ¡a ¡Mactans ¡Charger ¡

11 ¡

slide-12
SLIDE 12

Form ¡Factor ¡Alterna,ves ¡

  • Could ¡be ¡much ¡smaller… ¡

12 ¡

slide-13
SLIDE 13

Mactans ¡Steps ¡Overview ¡

  • 1. Pair ¡with ¡device ¡
  • 2. Obtain ¡device ¡UDID ¡
  • 3. Generate ¡and ¡install ¡provisioning ¡profile ¡
  • 4. Install ¡malicious ¡app ¡

13 ¡

slide-14
SLIDE 14

Pair ¡With ¡Device ¡

  • Once ¡an ¡iOS ¡device ¡is ¡USB-­‑connected, ¡

Mactans ¡will ¡try ¡to ¡pair ¡with ¡it ¡

  • Mactans ¡leverages ¡a ¡conceptual ¡iOS ¡pairing ¡

trust ¡assump,on ¡

– Device ¡can ¡be ¡paired ¡without ¡user’s ¡consent ¡while ¡ it ¡is ¡passcode-­‑unlocked ¡

  • Pairing ¡can ¡occur ¡if ¡device ¡is ¡unlocked ¡at ¡any ¡,me ¡(even ¡

briefly) ¡

– Once ¡paired, ¡exploita,on ¡is ¡possible ¡regardless ¡of ¡ whether ¡or ¡not ¡device ¡is ¡locked ¡

14 ¡

slide-15
SLIDE 15

Pair ¡With ¡Device ¡Cont’d ¡

  • Many ¡opera,ons ¡can ¡be ¡performed ¡via ¡USB ¡

– Obtain ¡device ¡informa,on ¡(e.g., ¡UDID, ¡serial ¡ number) ¡ – Install ¡and ¡remove ¡apps ¡and ¡provisioning ¡profiles ¡ – Backup ¡and ¡restore, ¡firmware ¡reset ¡(ipsw) ¡ – Debugging ¡

  • Mactans ¡can ¡be ¡used ¡to ¡perform ¡these ¡

func,ons ¡

15 ¡

slide-16
SLIDE 16

Universal ¡Device ¡Iden,fier ¡(UDID) ¡

  • A ¡40 ¡digit ¡hexadecimal ¡iden,fier ¡unique ¡to ¡a ¡

device ¡

  • Obtaining ¡device ¡UDID ¡is ¡trivial ¡via ¡USB ¡

connec,on ¡

16 ¡

slide-17
SLIDE 17

Provisioning ¡Profile ¡Details ¡

  • Types ¡of ¡provisioning ¡profiles ¡

– Individual ¡ – Enterprise ¡

  • Requirements ¡for ¡individual ¡profile ¡

– Ac,ve ¡developer’s ¡license ¡ – Device ¡UDID ¡ – Internet ¡connec,on ¡

17 ¡

slide-18
SLIDE 18

Provisioning ¡Profile ¡Details ¡Cont’d ¡

  • Allows ¡devices ¡to ¡run ¡apps ¡

signed ¡by ¡a ¡non-­‑Apple ¡en,ty ¡

– Provisioning ¡profile ¡must ¡be ¡ signed ¡by ¡Apple ¡

  • For ¡enterprises ¡to ¡distribute ¡in-­‑

house ¡apps ¡

  • For ¡individual ¡developers ¡to ¡

perform ¡beta ¡tes,ng ¡

– Provisioning ¡profile ¡must ¡ match ¡device ¡and ¡app ¡

18 ¡

slide-19
SLIDE 19

Provisioning ¡Profile ¡Details ¡Cont’d ¡

  • A ¡device ¡must ¡be ¡registered ¡to ¡run ¡a ¡

developer’s ¡app ¡

– Individual ¡developer ¡license ¡allows ¡up ¡to ¡100 ¡ devices ¡

  • Cannot ¡remove ¡devices ¡once ¡registered ¡

– UDID ¡registra,on ¡via ¡developer.apple.com

19 ¡

slide-20
SLIDE 20

Genera,ng ¡a ¡Provisioning ¡Profile ¡

  • Can ¡be ¡easily ¡automated ¡by ¡browser ¡automa,on ¡tools ¡

– No ¡CAPTCHA ¡

20 ¡

slide-21
SLIDE 21

Genera,ng ¡Profile ¡Cont’d ¡

  • A ¡Mactans ¡charger ¡must ¡add ¡a ¡UDID ¡to ¡a ¡

provisioning ¡profile ¡over ¡the ¡Internet ¡

– How? ¡

  • Use ¡available ¡Internet ¡connec,on ¡

– A ¡Mactans ¡charger ¡has ¡a ¡built-­‑in ¡Wi-­‑Fi ¡antenna ¡ – Can ¡also ¡be ¡equipped ¡with ¡SIM ¡card ¡module ¡for ¡ cellular ¡data ¡connec,on ¡

  • Crea,on ¡via ¡Apple’s ¡website ¡is ¡fully ¡automatable ¡

– Submit ¡UDID, ¡check ¡for ¡and ¡receive ¡generated ¡profile ¡

21 ¡

slide-22
SLIDE 22

Installing ¡an ¡App ¡

  • Once ¡obtained, ¡a ¡provisioning ¡profile ¡can ¡be ¡

installed ¡without ¡user’s ¡consent ¡(or ¡knowledge) ¡

– Apps ¡owned ¡by ¡provisioning ¡profile ¡owner ¡can ¡then ¡be ¡ installed ¡via ¡USB ¡

  • Run,me ¡environment ¡assump,ons ¡

– The ¡device ¡is ¡not ¡jailbroken ¡

  • uid=501 ¡(mobile), ¡not ¡root ¡

– The ¡app ¡is ¡sandboxed ¡

  • Cannot ¡access ¡another ¡app’s ¡filesystem ¡and ¡memory ¡
  • Hiding ¡the ¡app ¡becomes ¡necessary ¡to ¡prevent ¡

unwanted ¡dele,on ¡

22 ¡

slide-23
SLIDE 23

Hiding ¡an ¡App ¡

  • There ¡are ¡some ¡hidden ¡apps ¡on ¡the ¡stock ¡iPhone ¡

– /Applica,ons/DemoApp.app ¡ – /Applica,ons/FieldTest.app ¡

  • Info.plist ¡for ¡these ¡apps ¡reveals ¡a ¡common ¡field ¡
  • This ¡property ¡hides ¡the ¡app ¡on ¡the ¡main ¡screen ¡and ¡in ¡

the ¡task ¡manager ¡

23 ¡

slide-24
SLIDE 24

Hidden ¡App ¡Capabili,es ¡

  • iOS ¡background ¡execu,on ¡

– App ¡can ¡run ¡without ¡user ¡knowledge ¡ – iOS ¡limits ¡background ¡execu,on ¡to ¡10 ¡minutes ¡ – Limit ¡can ¡be ¡extended ¡by ¡several ¡methods ¡

  • Terminate ¡and ¡restart ¡before ¡10 ¡minute ¡deadline ¡
  • Register ¡as ¡VoIP ¡app ¡and ¡setKeepAliveTimeout:600 ¡

– With ¡these ¡methods, ¡app ¡can ¡effec,vely ¡run ¡ indefinitely ¡

24 ¡

slide-25
SLIDE 25

Hidden ¡App ¡Capabili,es ¡Cont’d ¡

  • Taking ¡screen ¡shots ¡

– Using ¡a ¡Private ¡API ¡call, ¡a ¡ background ¡app ¡can ¡take ¡a ¡ screenshot ¡of ¡current ¡ ‘foreground’ ¡screen ¡

25 ¡

slide-26
SLIDE 26

Hidden ¡App ¡Capabili,es ¡Cont’d ¡

  • Simula,ng ¡screen/buPon ¡presses ¡

– Xcode ¡instrumenta,on ¡

  • Can ¡be ¡automated ¡via ¡Javascript ¡

– Simula,on ¡can ¡also ¡be ¡done ¡outside ¡Xcode ¡ – DeveloperDisk ¡

  • Has ¡UIAutoma,on.framework ¡
  • Try ¡dlopen(), ¡call ¡APIs ¡there ¡

26 ¡

slide-27
SLIDE 27

iOS ¡Trojan ¡Horse ¡

  • Surrep,,ously ¡replace ¡exis,ng ¡app ¡with ¡Trojan ¡

– Obtain ¡a ¡set ¡of ¡original ¡apps ¡(Facebook, ¡Skype) ¡ – Repackage ¡apps ¡with ¡Info.plist ¡that ¡has ¡SBAppTags/ hidden ¡property ¡ – Sign ¡app ¡and ¡Info.plist ¡with ¡aPacker-­‑owned ¡developer ¡ key ¡and ¡load ¡into ¡Mactans ¡charger ¡ – Aoer ¡pairing ¡

  • Replace ¡original ¡app ¡with ¡repackaged, ¡hidden ¡version ¡
  • Install ¡new, ¡malicious ¡app ¡with ¡icon ¡of ¡replaced ¡app ¡
  • When ¡launched, ¡new ¡app ¡performs ¡malicious ¡ac,ons, ¡then ¡

executes ¡repackaged ¡(hidden) ¡app ¡

27 ¡

slide-28
SLIDE 28

Trojan ¡Horse ¡Workflow ¡

Main ¡Screen ¡Shows ¡Trojan ¡ User ¡Launches ¡Trojan ¡ Trojan ¡Launches ¡Real, ¡ ¡ Hidden ¡App ¡

28 ¡

slide-29
SLIDE 29

APack ¡Scenarios ¡

  • General ¡

– Use ¡enterprise ¡provisioning ¡profile ¡to ¡setup ¡public ¡ charging ¡sta,ons ¡(e.g., ¡at ¡airports, ¡libraries) ¡

  • Targeted ¡

– Exchange ¡or ¡provide ¡charger ¡to ¡target ¡ – Use ¡a ¡priori ¡knowledge ¡to ¡selec,vely ¡modify ¡ environment ¡(e.g., ¡specific ¡airplane ¡seat, ¡hotel ¡ room) ¡

29 ¡

slide-30
SLIDE 30

DISCUSSION ¡

30 ¡

slide-31
SLIDE 31

Problem ¡#1 ¡

  • Incorrect ¡trust ¡model ¡for ¡pairing ¡

– Any ¡host ¡is ¡implicitly ¡trusted ¡if ¡the ¡phone ¡is ¡not ¡ passcode ¡protected ¡ – Once ¡pairing ¡is ¡established, ¡it ¡is ¡permanent ¡

31 ¡

slide-32
SLIDE 32

Fix ¡for ¡Problem ¡#1 ¡

32 ¡

  • Use ¡explicit ¡authoriza,on ¡

– Coming ¡to ¡iOS ¡7 ¡

  • Trusted ¡host ¡management ¡

– Synonymous ¡with ¡Wi-­‑Fi ¡ management ¡

slide-33
SLIDE 33

Problem ¡#2 ¡

  • No ¡visual ¡cues ¡to ¡differen,ate ¡a ¡charger ¡versus ¡

a ¡compu,ng ¡device ¡

– iOS ¡only ¡has ¡an ¡indicator ¡for ¡synchroniza,on, ¡and ¡

  • nly ¡shows ¡that ¡indicator ¡during ¡synchroniza,on ¡

33 ¡

slide-34
SLIDE 34

Fix ¡for ¡Problem ¡#2 ¡

  • Visual ¡indicator ¡to ¡differen,ate ¡charge ¡mode ¡

and ¡pair ¡mode ¡

– Fix ¡for ¡Problem ¡#1 ¡also ¡fixes ¡this ¡problem ¡ – Android ¡generates ¡a ¡no,fica,on ¡when ¡the ¡phone ¡ is ¡connected ¡to ¡a ¡host ¡and ¡always ¡shows ¡the ¡ indicator ¡

34 ¡

slide-35
SLIDE 35

Problem ¡#3 ¡

  • Provisioning ¡profile ¡abuse ¡

– Apple ¡pays ¡lots ¡of ¡aPen,on ¡to ¡app ¡signing, ¡but ¡ liPle ¡aPen,on ¡to ¡provisioning ¡profile ¡signing ¡

35 ¡

slide-36
SLIDE 36

Fix ¡for ¡Problem ¡#3 ¡

  • Add ¡procedures ¡to ¡prevent ¡provisioning ¡profile ¡

genera,on ¡

– Use ¡CAPTCHA ¡ – Implement ¡mechanisms ¡to ¡detect ¡suspicious ¡ developer ¡ac,vity ¡

36 ¡

slide-37
SLIDE 37

Problem ¡#4 ¡

  • Over-­‑privileged ¡default ¡capabili,es ¡for ¡USB ¡

– Obtain ¡device ¡informa,on ¡(e.g., ¡UDID, ¡serial ¡ number) ¡ – Install ¡and ¡remove ¡apps ¡and ¡provisioning ¡profiles ¡ – Backup ¡and ¡restore, ¡firmware ¡reset ¡(ipsw) ¡ – Debugging ¡

37 ¡

slide-38
SLIDE 38

Fix ¡for ¡Problem ¡#4 ¡

  • Tighten ¡default ¡USB ¡connec,on ¡serngs ¡

– Reduce ¡default ¡connec,on ¡mode ¡privileges ¡ – Require ¡explicit ¡authoriza,on ¡for ¡provisioning ¡ profile ¡installa,on ¡

38 ¡

slide-39
SLIDE 39

Problem ¡#5 ¡

  • Third ¡party ¡hidden ¡apps ¡considered ¡harmful ¡

– Few ¡or ¡no ¡legi,mate ¡uses ¡ – High ¡abuse ¡poten,al ¡

39 ¡

slide-40
SLIDE 40

Fix ¡for ¡Problem ¡#5 ¡

  • Restrict ¡the ¡ability ¡to ¡set ¡hidden ¡property ¡

– Only ¡allow ¡apps ¡developed ¡by ¡Apple ¡to ¡use ¡this ¡ property ¡

40 ¡

slide-41
SLIDE 41

One ¡more ¡thing ¡… ¡

  • You ¡do ¡not ¡need ¡a ¡malicious ¡charger ¡to ¡bypass ¡

the ¡protec,ons ¡of ¡the ¡walled ¡garden ¡model ¡

– Jekyll ¡on ¡iOS: ¡When ¡Benign ¡Apps ¡Become ¡Evil. ¡ Tielei ¡Wang, ¡Kangjie ¡Lu, ¡Long ¡Lu, ¡Simon ¡Chung, ¡ and ¡Wenke ¡Lee, ¡Georgia ¡Ins,tute ¡of ¡Technology. ¡ – To ¡appear ¡in ¡proceedings ¡of ¡the ¡2013 ¡USENIX ¡ Security ¡Conference, ¡August ¡14-­‑16, ¡2013. ¡

41 ¡

slide-42
SLIDE 42

Please ¡fill ¡out ¡your ¡ ¡ feedback ¡forms. ¡

42 ¡

slide-43
SLIDE 43

Ques,ons? ¡

43 ¡