Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DroidCon Poland - Secure Development with Android

DroidCon Poland - Secure Development with Android

Presentation at the DroidCon Poland 2015

Enrique López Mañas

December 05, 2015
Tweet

More Decks by Enrique López Mañas

Other Decks in Programming

Transcript

  1. Agenda • Introduction • Securing network communications • File Storage

    • Reverse Engineering and Obfuscation • Demo
  2. HTTP Sniffing with Chuck • HTTP proxies: • Charles (Mac)

    • Fiddler (Windows) • Great for debugging dodgy backends • Great for simulating dodgy connections • Works with SSL
  3. External Storage vs Internal Storage • getExternalStorageDirectory() is like parking

    your car on the street • All apps can access your files • Files may not be removed on uninstall • SD Card can be removed • getFilesDir() is like parking in your own garage • Other apps are generally not able to get in your sandbox • Rooted phones and emulators can access it
  4. File Encryption • Facebook Conceal encryption • Simple • Secure

    out of the box (AES-GCM) • Small payload (85kb) • https://github.com/facebook/conceal
  5. File Encryption • IOCypher and SQLCypher • Great for encrypting

    a complete filesystem or database • More complicated in terms of setup, keygen and error handling
  6. Why Java? • Java is partially compiled, and then interpreted

    • JVM and opcodes are fixed • Few instructions • No real protection
  7. Why Android? • APKs are easily downloadable • Obfuscation does

    not happen by default • APK to Jar Translation is easy
  8. Legal issues recipes • Don’t decompile, recompile, and pass it

    off as your own • Don’t try to sell it as your own • If License Agreement forbids decompiling, do not decompile • Don’t decompile to remove protection mechanisms
  9. Legal issues recipes YES • Understand interoperatibility • Create a

    program interface NO • Create a copy and sell it
  10. Obtain APKs • Pulling from device • Using GooglePlay Python

    API • Alternative sources • Sniffer transfers
  11. Protecting against Reverse Engineering 1. Writing two versions of the

    app 2. Obfuscation (When obfuscation is outlawed, only outlaws will sifjdifdm wofiefiemfeifm) 3. Webservices 4. FingerPrinting code 5. Native methods for storing strings