36
SESSION ID: Mobile Analysis Kung Fu, Santoku Style ANF-W03 Andrew Hoog CEO/Co-founder viaForensics @ahoog42 Sebastián Guerrero Mobile Security Analyst viaForensics @0xroot

Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

SESSION ID:

Mobile Analysis Kung Fu, Santoku Style

ANF-W03

Andrew Hoog CEO/Co-founder viaForensics @ahoog42

Sebastián Guerrero Mobile Security Analyst viaForensics @0xroot

Page 2: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Agenda

Santoku Intro

Mobile Forensics Kung Fu

Mobile Security Kung Fu

Mobile Malware Analysis Kung Fu

2

Page 3: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

Santoku Intro

Page 4: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Santoku – Why?

0200400600800

1000120014001600

2012 2017 (Projected)

Desktop PCPortable PCTabletSmartphone

4

Page 5: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

https://santoku-linux.com/ - It’s Free!

5

Page 6: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Santoku – What?

6

Page 7: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Santoku – How?

Install Lubuntu 12.04 (precise) x86_64

Santoku-ize it

7

Page 8: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

You should get (after reboot)

8

Page 9: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

Mobile Forensics Kung Fu

Page 10: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Forensic Acquisition Types

10

Page 11: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

iOS Logical

Connect device (Enter PIN if needed)

Ideviceback2 backup <backup dir>

Ideviceback2 unback <backup dir>

View backup|unpacked backup

11

Page 12: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

iOS Logical

12

Page 13: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

iPhone Backup Analyzer

13

Page 14: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Android Logical

AFLogical OSE (https://github.com/viaforensics/android-forensics)

Reads Content-Providers

Push to phone, run, store on SD-Card

Pull CSVs to Santoku for review

14

Page 15: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

AFLogical OSE

15

Page 16: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Install, run, extract

16

Page 17: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

viaExtract

17

Page 18: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

Mobile Security Kung Fu

Page 19: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero
Page 20: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

App Selection

Apps were selected based on popularity, number of downloads, or potential sensitivity of data

Approximately 80 apps have been reviewed and organized into categories

20

Page 21: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

2013 App testing result

81 tested apps, 32 iOS, 49 Android

21

0%20%40%60%80%

Failed MiTMor SSL

StoredPassword

(Plaintext orhashed)

Storedsensitive app

data onmemory

At least one'High risk'

rating

iOSAndroid

Page 22: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

22

Page 23: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Any.Do

Business and personal task management app iOS and Android

Millions of users

Many vulnerabilities, no response from company

https://viaforensics.com/mobile-security/security-vulnerabilities-anydo-android.html

23

Page 24: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Any.Do Analysis - Forensics

Locat Any.DO app directory

Adb pull /data/data/com.anydo

Examine database/binary files

Capture network traffic

24

Page 25: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Any.Do Analysis - Forensics

25

Page 26: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

Mobile Malware Analysis Kung Fu

Page 27: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

NQ Mobile

27

Page 28: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Bad News

Android Malware, masquerades as an innocent advertising network

Packaged in many legitimate apps, usually targeting Russian market

Has ability to download additional apps, and propmts the user to install them, posing as “Critical Updates”. Uses this mechanism to spread known malware, typically Premium Rate SMS fraud.

For more information see the report by Lookout: https://blog.lookout.com/blog/2013/04/19/the-bearer-of-badnews-malware-google-play/

28

Page 29: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

apktool Tool for reverse engineering

Android apk Dissasembles code to smali

files, also decodes resources contained into the apk.

It can also repackage the applications after you have modified them

We can run it on Badnews

Badnews Sample

29

Page 30: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

From apktool to smali

We can grep for known sensible method calls and strings

30

Page 31: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

From apktool to smali

We can manually analyze the disassembled smali coded provided by apktool

For example here we see a broadcast receiver that will listen for BOOT_COMPLETED intents and react to them starting a service in the application

31

Page 32: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Badnews sample – Dex2Jar - JDGui

32

Page 33: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Korean Banking Malware

33

Page 34: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Korean Banking Malware (Analysis)

34

Page 35: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

A little help fu, please

HOWTOs

New/existing tool development

.deb package maintenance

Forums, spreading the word

35

Page 36: Mobile Analysis Kung Fu, Santoku Style · SESSION ID: Mobile Analysis Kung Fu, Santoku Style . ANF-W03 . Andrew Hoog . CEO/Co-founder . viaForensics . @ahoog42 . Sebastián Guerrero

#RSAC

Q&A | Contact | Feedback

Thanks for listening…

@0xroot / @ahoog42

github/0xroot / github/viaforensics

[email protected] / [email protected]

36