the android security jungle
play

The Android security jungle: pitfalls, threats and survival tips - PowerPoint PPT Presentation

The Android security jungle: pitfalls, threats and survival tips Scott Alexander-Bown @scottyab The Jungle Ecosystem Googles protection Threats Risks Survival Network Data protection (encryption) App/device


  1. The Android security jungle: pitfalls, threats and survival tips Scott Alexander-Bown @scottyab

  2. The Jungle • Ecosystem • Google’s protection • Threats • Risks

  3. Survival • Network • Data protection (encryption) • App/device integrity • App binary security • Testing

  4. Scott Alexander-Bown • Lead Android Dev (remote) at Intohand • Co-Author - Android Security Cookbook • Co-Founder of SWmobile

  5. 1.4 Billion users

  6. OpenSignals.com

  7. Security Services • Google Play Approval process (human approval since 2015) • Developer security notifications • Android Bouncer • • Android device manager (Device security) • Safety net (intrusion detection) • Android at Work

  8. Slide Adrian Ludwig’s - Android Security State of the Union

  9. Newer version of Android are more secure 1.5 stack buffer, integer overflow protection 2.3+ null pointer dereference mitigation, NX 4.0+ ASLR 4.1+ ASLR strengthened 4.3 Security-Enhanced Linux 5.0 Security-Enhanced Linux - enforcing Updatabled Webview (via playstore)

  10. Threats

  11. Threats: App Hijacking • Taking an app and adding malware • Concerns • Reversing Android apps is easy • No need for certificate authority • Sideload

  12. “I ain’t got time to (heart)bleed”

  13. OWASP • Mobile Security Project • iOS and Android • Top 10 risks • attack vectors • threat agents • impacts

  14. OWASP top 10 risks • M1: Weak Server Side • M6: Broken Cryptography Controls • M7: Client Side Injection • M2: Insecure Data Storage • M8: Security Decisions Via • M3: Insufficient Transport Untrusted Inputs Layer Protection • M9: Improper Session Handling • M4: Unintended Data Leakage • M10: Lack of Binary Protections • M5: Poor Authorization and Authentication

  15. Survival kit

  16. Survival tips 1. Harden the network communications 2. Protect stored data (encryption) 3. Validate the device and app integrity 4. Increase binary security

  17. Network communications • Use SSL / TLS! • Use the platform SSL/TLS validation (i.e don’t disable it!) • Use only strong cipher suites (128bit+) and TLS versions (TLS v1.2) • OkHttp 2.1 - https://publicobject.com/2014/11/12/okhttp-2-1/

  18. Looks like you’re not using SSL pinning? • Devices ship with 100+ Certificate Authorities (CA) and users can install their own • Pinning limits the trusted root CA’s • Two types • Certificate pinning • Public Key pinning

  19. Public key pinning

  20. Patch against SSL exploits • Google Play Services provides a dynamic security provider • ProviderInstaller.installIfNeeded(getContext()); • https://developer.android.com/training/articles/security-gms- provider.html#patching

  21. Tips

  22. Code in a slide :’( Password based encryption

  23. Encryption libraries • Conceal • https://facebook.github.io/conceal • SQL cipher https://www.zetetic.net/sqlcipher/sqlcipher-for-android/ • Secure-Preferences (or Hawk) • https://github.com/scottyab/secure-preferences

  24. Hardcoded encryption key

  25. Verifying App integrity • Debuggable check • Apk Checksum • Signing certificate verification

  26. Signing Certificate Verification Build-time Runtime 3. Get the Signature from the 1. Get you certificate signature PackageManager $keytool -list -v -keystore your_app.keystore 4. Hash the Signature 2. Embed in app 5. Compare the signature hashes strings String CERTIFICATE_SHA1 = “71920AC9486E087DCBCF5C7F6F…”;

  27. Verifying device integrity • Emulator check • https://github.com/strazzere/a nti-emulator • Google SafteyNet test • https://github.com/scottyab/sa fetynethelper

  28. root@android:/ # • Root apps / Dangerous apps • Suspect system properties • SU/BusyBox binaries • RW /system • https://github.com/scottyab/rootbeer

  29. Obfuscation

  30. ProGuard • Java code obfuscator • Part of the Android SDK • Free as in Beer! • ReTrace - Supported by Error handling services such as Crashlytics

  31. DexGuard • Commercial version of ProGuard • Designed for Android and protection • Useful security utils - SSL Pinning, Root check, logging removal etc • My favourite features • String Encryption • API hiding

  32. Quick Android Review Kit (Quak) • Python script • Works with .apk or source code • Automated tests • weaknesses • exploits • Creates exploit .apks • https://github.com/linkedin/qark

  33. Click here for more! • 42+ Secure mobile development tips http://bit.ly/viafor42 • OWASP Mobile security risks http://bit.ly/owaspmobile • Android security cookbook [book] http://bit.ly/MscEFu • Android security internals [book] http://bit.ly/andsecint • Droidsec (whitepapers) droidsec.org/wiki

  34. Thanks • @gotocph • @intohand • 20th Century Fox • Android security team

  35. Questions? dev@scottyab.com @scottyab github.com/scottyab Please Remember to rate this session Thank you

  36. WebView • Before • getSettings().setJavaScriptEnabled(false) • getSettings().setAllowFileAccess(false) • During • WebViewClient.shouldOverrideUrlLoading() • enforce local content or Https • Whitelisted hosts/urls • .shouldInterceptRequest() to intercept XmlHttpRequests • After • webview.clearCache(true)

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend