introduction to mobile security testing
play

Introduction to Mobile Security Testing Approaches and Examples - PowerPoint PPT Presentation

Introduction to Mobile Security Testing Approaches and Examples using OWASP MSTG OWASP German Day 20.11.2018 Carlos Holguera $ whoami Carlos Holguera [olera] Security Engineer working at ESCRYPT GmbH since 2012 Area of expertise:


  1. Introduction to Mobile Security Testing Approaches and Examples using OWASP MSTG OWASP German Day 20.11.2018 Carlos Holguera

  2. $ whoami Carlos Holguera [olˈɣera]  Security Engineer working at ESCRYPT GmbH since 2012  Area of expertise: – Mobile & Automotive Security Testing – Security Testing Automation @grepharder

  3. Index 1 Why? 2 From the Standard to the Guide 3 Vulnerability Analysis 4 Information Gathering 6 Penetration Testing 7 Final Demos

  4. 1 Why?

  5. Why? Online videos, articles, trainings ??  Trustworthy sources?  Right Methodology?  Latest Techniques?  MASVS is the WHAT  MSTG is the HOW

  6. 2 From the Standard to the Guide

  7. From the Standard to the Guide

  8. From the Standard to the Guide OWASP Mobile Application Security Verification Standard Open on GitHub Read it on GitBook

  9. From the Standard to the Guide OWASP Mobile Application Security Verification Standard OS agnostic How? MSTG

  10. From the Standard to the Guide OWASP Mobile Application Security Verification Standard fork & customize Get from GitHub dep. on target

  11. From the Standard to the Guide OWASP Mobile Security Testing Guide Open on GitHub Read it on GitBook

  12. From the Standard to the Guide OWASP Mobile Security Testing Guide GitHub Search or clone & grep MASVS Refs. on each chapter

  13. 3 Vulnerability Analysis

  14. Vulnerability Analysis Static Analysis (SAST) Dynamic Analysis (DAST) Manual Code Review Testing and evaluation of apps   grep & line-by-line examination Real-time execution  Manual  expert code reviewer proficient in both  Automatic language and frameworks Automatic Code Analysis Examples of checks  Speed up the review  disclosure of data in transit  Predefined set of rules or industry best  authentication and authorization issues practices  server configuration errors.  False positives! A security professional must always review the results.  False negatives! Even worse … Recommendation: SAST + DAST + security professional

  15. Vulnerability Analysis Based on MASVS * OWASP, Mobile Security Testing Guide, 2018 (0x05d-Testing-Data-Storage.html) What to verify & how. Incl. References to MASVS Requirements

  16. Vulnerability Analysis Demo App The MSTG Hacking Playground App Open on GitHub

  17. Vulnerability Analysis Manual Code Review Example: Android origin inal al source code

  18. Vulnerability Analysis Manual Code Review Example: Android decompile ledsource code

  19. Vulnerability Analysis Manual Code Review Example: iOS orig iginal inal source code * OWASP iGoat A Learning Tool for iOS App Pentesting and Security, 2018 (iGoat)

  20. Vulnerability Analysis Manual Code Review Example: iOS disas assemble led “source code”

  21. Vulnerability Analysis Automatic Code Analysis Exam ample le: Static ic Analy lyzer must be always evaluated by a professional

  22. 4 Information Gathering

  23. Information Gathering Information Gathering Identifies  General Information  Sensitive Information … on the target that is publically available. E.g. about the OS and its APIs Evaluates the risk by understanding  Existing Vulnerabilities  Existing Exploits … especially from third party software.

  24. Information Gathering * OWASP, Mobile Security Testing Guide, 2018 (0x05a-Platform-Overview.html)

  25. Information Gathering Exam ample le: Open OMTG_DATAST_011_Memory.j .jav ava and and observe the decryptSt String im imple lementat atio ion.

  26. Information Gathering Let me google gle that for you…

  27. Information Gathering Got all original crypto code inclusive crypto params.

  28. 5 Penetration Testing

  29. Penetration Testing Preparation Intelligence Gathering Coordination with the client Environmental info  Goals and intended use (e.g. Flashlight)  Define scope / focus  What if compromised?  Request source code  Release and debug apps  Understand customer worries Architectural Info  Runtime protections (jailbreak, Identifying Sensitive Data emulator..?)  Which OS (old versions?)  at rest: file  Network Security  in use: address space  Secure Storage (what, why, how?)  in transit: tx to endpoint, IPC

  30. Penetration Testing Mapping Exploitation  Exploit the vulnerabilities identified Based on all previous information during the previous phase  Use the MSTG  UNDERSTAND the target  Find the true positives  LIST potential vulnerabilities  DRAW sensitive data flow  DESIGN a test plan , use MASVS Reporting Complement with automated scanning and manually exploring the app  Essential to the client  Not so fun?  It makes you the bad guy  Security not integrated early enough in the SDLC?

  31. Penetration Testing * OWASP, Mobile Security Testing Guide, 2018 (0x04b-Mobile-App-Security-Testing.html)

  32. Penetration Testing Penetration Testing is conducted in four phases* * NIST, Technical Guide to Information Security Testing and Assessment, 2008

  33. Penetration Testing However  Multiple attack vectors  Multiple steps  Different combinations give different full attack vectors So penetration testing usually looks more like this …

  34. Penetration Testing Demo Spoiler Replicate crypto operations in java Download the app Patch smali unpack it Re-package javac get smali It’s android, be happy! Re-sign run Dex to jar Re-install Make the app debuggable decompile google logcat debug Find stuff: keys, cipherText, Inspect the code Read the classes logs What do you want? The plain text  The plain text? hooking

  35. Penetration Testing Techniques decompilation fuzzing traffic interception method tracing code injection tampering disassembly hooking traffic root detection dump man-in-the-middle dynamic binary instrumentation debugging binary patching

  36. Penetration Testing One for Android, one for iOS. All happy 

  37. Penetration Testing * OWASP, Mobile Security Testing Guide, 2018 (0x05c-Reverse-Engineering-and-Tampering.html)

  38. Penetration Testing * OWASP, Mobile Security Testing Guide, 2018 (0x05c-Reverse-Engineering-and-Tampering.html)

  39. Penetration Testing Example Scenario Automotive-Mobile Testing  03 2X XX XX XX X5 55  04 FX XX XX XX XF FF CAN Bluetooth Mobile Apps 03 2X XX XX XX X5 55 04 FX XX XX XX XF FF

  40. 6 Demo 1 Mobile Penetration Testing Let‘s decrypt that encrypted string!

  41. Demo 1 App: MSTG-Hacking-Playground(011_MEMORY)

  42. Demo 1 Replicate crypto operations in java Download the app Patch smali unpack it Re-package javac get smali It’s android, be happy! Re-sign run Dex to jar Re-install Make the app debuggable decompile google logcat debug Find stuff: keys, cipherText, Inspect the code Read the classes logs What do you want? The plain text  The plain text? hooking

  43. Demo 1 Download the app unpack it It’s android, be happy! Dex to jar decompile google Find stuff: keys, cipherText, Inspect the code classes What do you want? The plain text  The plain text? hooking

  44. Demo 1

  45. Demo 1

  46. 6 Demo 2 Mobile Penetration Testing Let‘s get the crypto keys!

  47. Demo 2 App: MSTG-Hacking-Playground(001_KEYSTORE)

  48. Demo 2 Download the app Patch smali Re-package unpack it get smali It’s android, be happy! Re-sign Dex to jar Re-install Make the app debuggable decompile google debug Inspect the code Find stuff: keys, classes What do you want? The crypto keys  The crypto keys hooking

  49. Demo 2 Download the app unpack it It’s android, be happy! Dex to jar decompile google Inspect the code Find stuff: keys, classes What do you want? The crypto keys  The crypto keys hooking

  50. Demo 2

  51. Demo 2

  52. Demo 2

  53. Takeaways  Read the MSTG  Use the MASVS  Play with Crackmes  grep harder  Learn  Learn  Contribute!  Have fun :)

  54. References RTFM STG

  55. References  OWASP Mobile Security Testing Guide https://mobile-security.gitbook.io/mobile-security-testing-guide https://github.com/OWASP/owasp-mstg  OWASP Mobile Application Security Verification Standard https://mobile-security.gitbook.io/masvs/ https://github.com/OWASP/owasp-masvs  OWASP iGoat - A Learning Tool for iOS App Pentesting and Security https://github.com/OWASP/igoat  OWASP MSTG-Hacking-Playground Android App https://github.com/OWASP/MSTG-Hacking-Playground  OWASP MSTG Crackmes https://github.com/OWASP/owasp-mstg/tree/master/Crackmes

  56. Thank you, any questions?

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