Nullcon Extreme Android

Nullcon 2017 Goa, India
1 / 77
Slide 1 of Nullcon Extreme Android
Slide 2 of Nullcon Extreme Android
Slide 3 of Nullcon Extreme Android
Slide 4 of Nullcon Extreme Android
Slide 5 of Nullcon Extreme Android
Slide 6 of Nullcon Extreme Android
Slide 7 of Nullcon Extreme Android
Slide 8 of Nullcon Extreme Android
Slide 9 of Nullcon Extreme Android
Slide 10 of Nullcon Extreme Android
Slide 11 of Nullcon Extreme Android
Slide 12 of Nullcon Extreme Android
Slide 13 of Nullcon Extreme Android
Slide 14 of Nullcon Extreme Android
Slide 15 of Nullcon Extreme Android
Slide 16 of Nullcon Extreme Android
Slide 17 of Nullcon Extreme Android
Slide 18 of Nullcon Extreme Android
Slide 19 of Nullcon Extreme Android
Slide 20 of Nullcon Extreme Android
Slide 21 of Nullcon Extreme Android
Slide 22 of Nullcon Extreme Android
Slide 23 of Nullcon Extreme Android
Slide 24 of Nullcon Extreme Android
Slide 25 of Nullcon Extreme Android
Slide 26 of Nullcon Extreme Android
Slide 27 of Nullcon Extreme Android
Slide 28 of Nullcon Extreme Android
Slide 29 of Nullcon Extreme Android
Slide 30 of Nullcon Extreme Android
Slide 31 of Nullcon Extreme Android
Slide 32 of Nullcon Extreme Android
Slide 33 of Nullcon Extreme Android
Slide 34 of Nullcon Extreme Android
Slide 35 of Nullcon Extreme Android
Slide 36 of Nullcon Extreme Android
Slide 37 of Nullcon Extreme Android
Slide 38 of Nullcon Extreme Android
Slide 39 of Nullcon Extreme Android
Slide 40 of Nullcon Extreme Android
Slide 41 of Nullcon Extreme Android
Slide 42 of Nullcon Extreme Android
Slide 43 of Nullcon Extreme Android
Slide 44 of Nullcon Extreme Android
Slide 45 of Nullcon Extreme Android
Slide 46 of Nullcon Extreme Android
Slide 47 of Nullcon Extreme Android
Slide 48 of Nullcon Extreme Android
Slide 49 of Nullcon Extreme Android
Slide 50 of Nullcon Extreme Android
Slide 51 of Nullcon Extreme Android
Slide 52 of Nullcon Extreme Android
Slide 53 of Nullcon Extreme Android
Slide 54 of Nullcon Extreme Android
Slide 55 of Nullcon Extreme Android
Slide 56 of Nullcon Extreme Android
Slide 57 of Nullcon Extreme Android
Slide 58 of Nullcon Extreme Android
Slide 59 of Nullcon Extreme Android
Slide 60 of Nullcon Extreme Android
Slide 61 of Nullcon Extreme Android
Slide 62 of Nullcon Extreme Android
Slide 63 of Nullcon Extreme Android
Slide 64 of Nullcon Extreme Android
Slide 65 of Nullcon Extreme Android
Slide 66 of Nullcon Extreme Android
Slide 67 of Nullcon Extreme Android
Slide 68 of Nullcon Extreme Android
Slide 69 of Nullcon Extreme Android
Slide 70 of Nullcon Extreme Android
Slide 71 of Nullcon Extreme Android
Slide 72 of Nullcon Extreme Android
Slide 73 of Nullcon Extreme Android
Slide 74 of Nullcon Extreme Android
Slide 75 of Nullcon Extreme Android
Slide 76 of Nullcon Extreme Android
Slide 77 of Nullcon Extreme Android

Abstract

A comprehensive two-day Android exploitation lab covering APK reverse engineering, SSL pinning bypass, root detection evasion, dynamic instrumentation with Xposed and Frida, and Android fuzzing techniques.

AI Generated Summary

AI Generated Content Disclaimer

Note: This summary is AI-generated and may contain inaccuracies, errors, or omissions. If you spot any issues, please contact the site owner for corrections. Errors or omissions are unintended.

This deck belongs to the two day “Xtreme Android Exploitation Lab” training delivered at Nullcon 2017, co-trained with Anto Joseph, who is listed as a Security Engineer at Intel. The training is scenario based and hands-on, moving from APK reverse engineering, obfuscated code, Dalvik/ART internals, traffic interception, SSL pinning and root detection bypass, and HTML5 application analysis on Day 1, to dynamic analysis, automated frameworks, Xposed and Frida instrumentation, and Android fuzzing on Day 2, closing with a CTF challenge.

Summary

The deck opens with both trainer introductions and the lab philosophy: attendees learn how things work and use references to solidify the theory afterwards, with the entire lab designed as scenario based situations where the class performs the same attacks an attacker would use. Workshop setup uses VirtualBox with two trainer VMs, the Genymotion VM and Android Tamer (nullcon Edition). The Day 1 outline runs from application code and the OWASP Mobile Top 10 through decompilation, obfuscation, Dalvik, traffic interception, root detection bypass, HTML5 analysis, and static analysis.

The OWASP Mobile Top 10 (2014) is shown in full, with a note that the 2016 candidate list brings large changes, and the course is explicitly not OWASP Top 10 focused (“In Short NO”). Application code is modified Java that decompiles to Java or Smali; an APK is a ZIP/JAR containing classes.dex and encrypted XMLs, decoded with dex2jar or enjarify and apktool. Android Tamer’s custom apk2java script automates this, producing Java from two decompilers, jad and jadx. Obfuscation techniques covered are control flow manipulation, string encryption, renaming and reflection; obfuscation defers application analysis and should not replace best practices.

The Dalvik/ART section explains register based bytecode, dex versus device optimized odex/oat, dalvik-cache, and ART eliminating JIT. Traffic interception covers Burp, Charles or ZAP setup. The PKI section declares PKI is broken: the system trusts all CAs in the trust store, any CA can issue certificates for any website (citing Diginotar, Trustwave and NIC), revocation is hell, and OCSP runs over port 80. HTTPS breaking is done by importing the proxy’s ROOT CA into Android. Certificate pinning validates via the app’s own checks and is defeated by modifying the APK or with the Xposed module JustTrustMe. Root detection is blacklist based, defeated by hiding binaries or overloading the checking system calls. HTML5 hybrid apps leak source in assets/www and suffer DOM XSS, SSL misconfiguration, storage leakage and easy repackaging. Static analysis uses Mobilizer and droidscan.sh, and the decompile-modify-recompile workflow runs apktool d, apktool b, keytool and jarsigner.

Day 2 moves to dynamic analysis with adb, ddms/Android Monitor and pidcat, inspecting app data and sdcard locations for leakage, then to automated frameworks in WIP status: MobSF, Marvin, cuckoo-droid, drozer and Qark. Hooking and dynamic instrumentation modify runtime behavior without recompilation, from a custom Xposed module to Frida, which injects JavaScript into native apps; the hands-on uses Anto Joseph’s frida-android-hooks. Fuzzing is introduced as the way to find issues beyond what tools report, covering intent and C binary fuzzing toward the next Stagefright, with a setup exercise using DroidFuzzer. The coverage slide shows M2 through M10 covered with M1 deferred to the Xtreme Web Hacking course, and a CTF challenge closes the class.

Key Themes

  • Workshop Setup and Philosophy: VirtualBox with two trainer-provided VMs (Android Tamer nullcon Edition and Genymotion), credentials android/tamer, and a scenario based hands-on philosophy that prioritizes performing real attacker techniques over theory.
  • Understanding Android Application Code: APKs are modified Java packages structurally similar to ZIP/JAR files with classes.dex, resources and binary-encoded XMLs, decompilable to Java (readable, sometimes inaccurate) or Smali (accurate bytecode), decoded with dex2jar/enjarify and apktool and automated through Android Tamer’s apk2java.
  • Obfuscation and Its Limits: control flow manipulation, string encryption, renaming and reflection, read with Simplify and JEB modules; obfuscation defers application analysis and should not replace best practices.
  • Dalvik and ART Internals: register based bytecode, dex versus odex/oat, Dalvik dexopt and dalvik-cache, system apps as odex/OAT, ART removing JIT, and Oat2dex for Lollipop apps.
  • Traffic Interception and PKI Weaknesses: proxy setup for Burp, Charles and ZAP; the PKI slide catalogs trust store weaknesses, CA mis-issuance (Diginotar, Trustwave, NIC), revocation hell and OCSP over port 80.
  • Certificate Pinning and Root Detection Bypass: pinning validates via the app’s own checks and is defeated by APK modification or Xposed with JustTrustMe; root detection is blacklist based (/usr/bin/su, which, superuser.apk) and defeated by hiding binaries or overloading system calls.
  • HTML5, Static Analysis and Recompilation: hybrid apps leak source in assets/www and suffer DOM XSS, SSL misconfiguration, storage leakage and repackaging; static scanning via Mobilizer and droidscan.sh; the apktool d, edit, apktool b, keytool, jarsigner re-signing workflow.
  • Dynamic Analysis, Instrumentation and Fuzzing: manual runtime analysis with adb, ddms and pidcat; automated frameworks MobSF, Marvin, cuckoo-droid, drozer and Qark; Xposed modules and Frida JavaScript injection (frida-android-hooks); intent and C binary fuzzing with DroidFuzzer toward finding the next Stagefright, capped by a CTF challenge.

Notable Points

  1. Lab environment: two VMs in VirtualBox, Android Tamer (nullcon Edition) and Genymotion; credentials username android, password tamer; connectivity verified by pinging google.com from Tamer and the Tamer IP from Android.
  2. The course is explicitly not OWASP Top 10 focused (“In Short NO”); it maps exercises to the 2014 Mobile Top 10 with M2 through M10 covered and M1 (Weak Server Side Controls) deferred to the Xtreme Web Hacking course.
  3. apk2java is a custom Android Tamer script: apk2java package.apk decrypts all XML files and outputs Java decompiled via two decompilers (jad and jadx) plus Smali; APK retrieval runs adb shell pm list packages -f, adb shell pm path, then adb pull.
  4. Proxy interception steps: start proxy in Tamer noting IP and port, set proxy in the device WiFi settings, verify with HTTP browser traffic; exercises include intercepting OKVolleyHTTPSample traffic.
  5. ROOT CA import for HTTPS interception: adb push rootca.pem /mnt/sdcard/Downloads/ or import via browser.
  6. JustTrustMe bypass sequence: root your device, install Xposed Framework, install JustTrustMe module, enable it, reboot.
  7. Root detection checks the /usr/bin/su binary, uses which to detect commands, and looks for the superuser.apk controller; bypasses hide binaries or overload the checking system calls.
  8. Recompile and re-sign commands: apktool d <apk>, apktool b <folder>, keytool -genkey -v -keystore my-release-key.keystore (RSA, 2048-bit, validity 10000), jarsigner -verbose -sigalg SHA1withRSA.
  9. Dynamic analysis inspection locations: /data/data/, /sdcard/ and /sdcard1/, using adb, ddms/Android Monitor and pidcat; exercises include finding flaws in a base CRM app and analyzing TripCase for leaked data; automated frameworks covered are MobSF (Ajin), Marvin, cuckoo-droid, drozer and Qark.
  10. Frida hands-on uses github.com/antojoseph/frida-android-hooks covering root detection bypass, debugger check bypass, WebView logging, device ID spoofing, certificate pinning bypass and login screen bruteforce; the fuzzing chain generates a dataset, runs it against the target, and writes the glue and log collection scripts with DroidFuzzer, and CTF solutions were submitted by email to anant@anantshri.info cc antojoseph007@gmail.com.

Notable Quotes

“We can either spend time doing theory about android or we can learn how things work and can then use references to get theory side of it solid.”

“The entire lab is designed in a scenario based situation where we will perform the same attacks that an attacker can do to gain access.”

“PKI is broken”

“ART : No More JIT”

“How to find next stagefright”

“Fuzzzzzzzzzzzzzzz”

Embed This Presentation

See Also