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

Reverse & Inject - droidcon

Reverse & Inject - droidcon

Android reverse engineering & malware injection. As Android engineers, we often like tinkering with the platform and for us, it is much easier to recognize some patterns while analyzing malicious code which gives us a huge advantage. This talk aims to explore the basics of reverse engineering, trending tools. How to decompile, disassemble the application, how to find malicious code snippets, and what are the possible pitfalls. Difference between static and dynamic analysis. A little bit about Smali and DEX compilers.

Merab Tato Kutalia

December 14, 2020
Tweet

More Decks by Merab Tato Kutalia

Other Decks in Technology

Transcript

  1. Tools Static Analysis • JADX - Decompiler • ApkTool -

    Decompiler • Dex2Jar - Dex decompiler to Jar • JD-GUI - Java Decompiler Dynamic analysis • FRIDA Disassembler • GHIDRA • IDA PRO
  2. • AndroidManifest.xml • META-INF/ - java meta/signatures • classes.dex -

    dalvik bytecode • lib/ - native libs • assets/ - other Application Structure APK
  3. Java vs Smali Java public Boolean myStrMethod(byte mybyte, String str)

    smali .method public myStrMethod(B; Ljava/lang/String)Z – http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html https://github.com/JesusFreke/smali/wiki
  4. FRIDA Gadget vs FRIDA Server // Gadget - decompile APK

    - add FRIDA native library to lib/ - inject into bytecode - add permission - repackage - sign - install System.loadLibrary("frida-gadget") const-string v0, "frida-gadget" invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
  5. Scanned Apps - bypass otp/pin - client side check only

    - SQL injection - base64 decoding leading to app crash - mobile number / otp / pin / email enumeration - exposed client secrets - save sessionId in preferences - password reset does not kill the current session - leaking Google API keys - leaking test url and users in prod - leaking test features in production app
  6. Q&A