mobile vulnerability and exploitation john sawyer ... · mobile vulnerability and exploitation john...

60
Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Upload: dodang

Post on 21-Jul-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Mobile Vulnerability and Exploitation

John Sawyer – InGuardians Tom Eston – SecureState

Kevin Johnson – Secure Ideas

Page 2: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

John Sawyer !  InGuardians, Inc. - Senior Security Analyst !  DarkReading.com - Author/Blogger

!  1@stplace - Retired CTF packet monkey

"  winners DEFCON 14 & 15

!  Avid Mountain Biker…in Florida.

Page 3: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Tom Eston

! Manager, SecureState Profiling & Penetration Team

! Blogger – SpyLogic.net !  Infrequent Podcaster –

Security Justice/Social Media Security

!  Zombie aficionado !  I like to break new technology

Page 4: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Kevin Johnson

!  Father of Brenna and Sarah ! Secure Ideas, Senior Security

Consultant ! SANS Instructor and Author

"  SEC542/SEC642/SEC571 ! Open-Source Bigot

"  SamuraiWTF, Yokoso, Laudanum etc ! Ninja

Page 5: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

What are we talking about today?

! What’s at risk? !  Tools, Testing and Exploitation ! Common vulnerabilities found in popular apps

(this is the fun part)

Page 6: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

What are Smart Bombs? ! We’ve got powerful technology in the

palm of our hands! ! We store and transmit sensitive data ! Mobile devices are being used by:

" Major Businesses (PII) "  Energy Companies (The Grid) "  The Government(s) " Hospitals (PHI) "  Your Mom (Scary)

Page 7: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

That’s right…your Mom

Page 8: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Testing Mobile Apps ! What are the 3 major areas for testing?

"  File System

What are apps writing to the file system? How is data stored?

" Application Layer How are apps communicating via HTTP and Web Services? SSL?

"  Transport Layer How are apps communicating over the network? TCP and Third-party APIs

Page 9: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

OWASP Top 10 Mobile Risks

1. Insecure Data Storage 2. Weak Server Side Controls 3. Insufficient Transport Layer Protection 4. Client Side Injection 5. Poor Authorization and Authentication

Page 10: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

OWASP Top 10 Mobile Risks

6. Improper Session Handling 7. Security Decisions Via Untrusted Inputs 8. Side Channel Data Leakage 9. Broken Cryptography 10. Sensitive Information Disclosure

Page 11: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

OWASP Mobile Security Project

! You should get involved! !  https://www.owasp.org/index.php/OWASP_Mobile_Security_Project

Page 12: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Other Issues

! Privacy of your data! " Mobile apps talk to many third party APIs

(ads) " What’s collected by Google/Apple/Microsoft?

Page 13: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Common Tools

! SSH ! VNC server ! A compiler (gcc / agcc) ! Android SDK (adb!) ! XCode !  Jailbroken iDevice ! Rooted Android Device

Page 14: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Forensics & Incident Response

!  Filesystem artifacts !  Timeline analysis !  Log analysis !  Temp files

Page 15: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Forensic Tools

! Mobile Forensic Tools "  EnCase, FTK, Cellebrite

!  Free and/or Open Source "  file, strings, less, dd, md5sum "  The Sleuthkit (mactime, mac-robber)

Page 16: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Timelines

!  Timelines are awesome "  Anyone know log2timeline?

!  Filesystem " mac-robber " mactime

!  Logs "  Application- & OS-specific

Page 17: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Filesystem Timelines

! mac-robber " C app "  free & open source " must be compiled to run on devices

! mactime "  Part of The Sleuthkit "  runs on Mac, Win, Linux

Page 18: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Compiling mac-robber

! Android "  Install arm gcc toolchain " Compile & push via adb

"  I used Ubuntu, this can be done on MobiSec

Page 19: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Compiling mac-robber

!  iOS (jailbroken) " Download & Install libgcc onto device "  Install iphone-gcc " Download & Install C headers/libraries

Page 20: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Running mac-robber

!  iOS & Android via SSH

! Android via adb

!  Then, process each with mactime

Page 21: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Filesystem Timelines

Page 22: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Where is the data?

Page 23: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Temp Files

Page 24: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Gallery Lock Lite

!  “Protects” your images

Page 25: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 26: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Viewing & Searching Files

!  cat, less, vi, strings, grep ! SQLite files

" GUI browser, API (Ruby, Python, etc) ! Android apps

"  ashell, aSQLiteManager, aLogViewer

Page 27: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Application Layer - HTTP

!  Tools Used: "  Burp Suite "  Burp Suite "  oh yeah Burp Suite!

Page 28: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Why Look at the App Layer?

! Very common in mobile platforms ! Many errors are found within the

application "  And how it talks to the back end service

! Able to use many existing tools

Page 29: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Launching Burp Suite

! Memory!

Page 30: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Misunderstanding Encryption

Page 31: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Want Credentials?

Page 32: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Transport Layer - TCP

!  Tools Used: " Wireshark "  Tcpdump " Network Miner

Page 33: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Why look at the transport layer?

! Check to see how network protocols are handled in the app

! Easily look for SSL certificate or other communication issues

Page 34: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

NetworkMiner

! Extracts files/images and more ! Can pull out clear txt credentials ! Quickly view parameters

Page 35: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 36: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

TCP Lab Setup

! Run tcpdump directly on the device

! Run Wireshark by sniffing traffic over

wireless AP or network hub setup (lots of ways to do this)

!  Import PCAPs into NetworkMiner

Page 37: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

App Vulnerabilities

! Several examples that we’ve found ! Many from the Top 25 downloaded apps

Page 38: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Evernote

! Notebooks are stored in the cloud ! But…caches some files on the device… ! OWASP M1: Insecure Data Storage

Page 39: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 40: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

MyFitnessPal

! Android app stores sensitive data on the device (too much data)

Page 41: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 42: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Password Keeper “Lite”

! PIN and passwords stored in clear-text SQLite database

! So much for the security of your passwords…

Page 43: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 44: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 45: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 46: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Draw Something

! Word list stored on the device ! Modify to mess with your friends

Page 47: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

LinkedIn

! SSL only for authentication ! Session tokens and data sent over HTTP !  Lots of apps do this ! M3: Insufficient Transport Layer Protection

Page 48: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Auth over SSL

Data sent over HTTP

Page 49: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 50: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Pandora

! Registration over HTTP ! User name/Password and Registration

info sent over clear text ! Unfortunately…lots of apps do this

Page 51: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 52: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Hard Coded Passwords/Keys !  Major Grocery Chain “Rewards” Android app !  Simple to view the source, extract private key !  OWASP M9: Broken Cryptography !  Do developers really do this?

Page 53: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Why yes, they do!

Page 54: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Privacy Issues

! Example: Draw Something App (Top 25) ! UDID and more sent to the following

third-party ad providers: "  appads.com " mydas.mobi "  greystripe.com "  tapjoyads.com

Page 55: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

What is UDID?

! Alpha-numeric string that uniquely identifies an Apple device

Page 56: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 57: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Pinterest and Flurry.com

Page 58: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas
Page 59: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Conclusions

! Mobile devices are critically common ! Most people use them without thinking

of security ! Developers seem to be repeating the

past ! We need to secure this area

Page 60: Mobile Vulnerability and Exploitation John Sawyer ... · Mobile Vulnerability and Exploitation John Sawyer – InGuardians Tom Eston – SecureState Kevin Johnson – Secure Ideas

Contact Us

!  John Sawyer !  Tom Eston

"  Twitter: @agent0x0 "  [email protected]

! Kevin Johnson "  Twitter: @secureideas "  [email protected]