Xtreme Android Exploitation Lab

Nullcon 2015

04 February 2015

Objective

The Android Exploitation Lab is a 2 day action-packed class of extreme Android Security and Exploitation. We will have a look at the internals of the Android platform, understand it’s weakness, analyze and reverse applications, find vulnerabilities and exploit them.

The class is developed in a hands-on and CTF approach, where each attendee gets to have their hands dirty with exploiting real world Android applications and binaries. The training will be done on an Android Tamer distribution prepared exclusively for the Nullcon training.

The two trainers have put a lot of research in order to come up with this training for the first time @ Nullcon 2015. Attendees will also get full access to the automated cloud based app security assessment framework AppWatch after the training.

Course Outline Day wise

Android Basics

Android Security Model

Intro to application development

Setting up the Pentesting Environment

App Kung-Fu

Exploiting Logic and Code flaws in applications

Arm Basics

Dex Labs

Automated Analysis & Exploitation

Leveraging Dynamic Instrumentation frameworks

Further Exploitation

Android Forensics & Malware Analysis

Being secure

What to bring?

Prerequisites

Who Should Attend?

What to expect?

What not to expect?

To be an Android Hacking Expert/Ninja in a matter of 2 days. Even though this training would take you to a considerably high level in Android Security/Exploitation, and impart you with all the necessary skills needed, you need to work on your own and use the skills learnt in the training class to continue your Android Security explorations.

About the Trainers

Anant Shrivastava (@anantshri)

Anant Shrivastava is an experienced information security professional with 6 yrs of corporate experience with expertise in Mobile, Web application and Linux Security.

He has developed his expertise in mobile security over years and has successfully executed multiple mobile application security assessment projects. He has trained 100+ delegates on Android Security at various conferences (Nullcon - 2012, g0s - 2013, c0c0n - 2013). He has created Android Tamer a Linux environment specially designed for Android Testing. He has also delivered talks at various security conferences on Android Operating System and Web application technologies. He holds various industry recognized certifications such as SANS GWAPT (GIAC Certified Web Application Testing), CEH (Certified Ethical Hacker) and RHCE (RedHat certified Engineer).

He is one of the co-author for OWASP Testing Guide v4. His whitepaper on “Web Application Fingerprinting” is referred as authority reference in OWASP Testing Guide. He has written multiple tools for web application and android testing, which are listed in his Github profile. He has credited with multiple responsible public disclosures. His tool named SVN Extractor is warmly received by penetration testing community. He has built a security solutions repository for WordPressCMS which contains open source code snippets to provide protection against known attack patterns. He is also a lead for project named as Code Vigilant, which aims to identify security, issues in open source software’s and currently holds 150+ vulnerability disclosures.He can be contact at anant@anantshri.info

Aditya Gupta (@adi1391)

Aditya Gupta is the founder and trainer of Attify, a mobile security firm, and leading mobile security expert and evangelist. Apart from being the lead developer and co-creator of Android framework for exploitation - a framework for exploitation of Android applications, he has done a lot of in-depth research on the security of mobile devices, including Android, iOS, and Blackberry, as well as BYOD Enterprise Security.

He is also the author of the popular Android security book “Learning Pentesting for Android” selling over 5000+ copies, since the time of launch in March 2014. He has also discovered serious web application security flaws in websites such as Google, Facebook, PayPal, Apple, Microsoft, Adobe, Skype, and many more.

In his previous work at Rediff.com, his main responsibilities were to look after web application security and lead security automation. He also developed several internal security tools for the organization to handle the security issues.

He has also previously spoken and trained at numerous international security conferences including BlackHat, Syscan, OWASP AppSec, Toorcon, Clubhack, Nullconetc, along with many other corporate trainings on Mobile Security. He has also recently launched a cloud based automated mobile application security scanning solution for enterprises, called “AppWatch”. He could be contacted at adi@attify.com.

https://archive.nullcon.net/website/goa-15/training/xtreme-android-exploitation-lab.php

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.

The “Xtreme Android Exploitation Lab” was a two-day training at Nullcon 2015 co-delivered by Anant Shrivastava and Aditya Gupta, founder of Attify and author of Learning Pentesting for Android. The course covers Android internals and the security architecture, application development basics, penetration testing setup with Android Tamer, and the complete OWASP Mobile Top 10. It continues through reverse engineering, traffic interception, rooting fundamentals, application exploitation techniques, automated exploitation with Drozer, dynamic instrumentation via Introspy and Cydia Substrate, and ARM-based exploitation.

Summary

The lab ran four sessions per day. Day 1 covered Android basics, the Android security model, and application development basics, then pentesting environment setup, “App Kung-Fu”, and exploiting logic and code flaws in applications. Day 2 moved to ARM basics and Dex labs, automated analysis and exploitation leveraging dynamic instrumentation frameworks, further exploitation with Android forensics and malware analysis, and a closing session on being secure. Fundamentals started with history and market weight (84.4% smartphone share per IDC 2014 Q3) and the layered security architecture combining Linux kernel protections with Android-specific features. The permission model requests everything in AndroidManifest.xml with all-or-none user acceptance, stored at /data/system/packages.xml, with bypass routes of third-party exposed intents and rooting.

Application development basics introduced Activities, Intents, and Services, the NDK for C/C++ components, and SDK tooling including the emulator, DDMS, ADB, and fastboot. The class environment was Android Tamer, first launched December 2011 at Clubhack 2011, with all tools on the command line and updatable via apt-get, paired with VirtualBox and Genymotion. The methodology contrasted blackbox and whitebox testing, noting that since apps are written in Java, partial source audit is possible via reversing; core analysis angles were data at rest, data in transit, entry points, and logic flaws. Reverse engineering treated the APK as a zip-style archive using unzip, apktool, dex2jar, and JD-GUI or jad. Traffic interception ran passive (tcpdump, Shark for Android, netcat streaming into Wireshark) and active (proxy settings), with SSL interception adding Burp Suite’s CA certificate, and the hands-on exercise was intercepting netchal1.apk.

Rooting fundamentals framed the goal as id=0 access through kernel-level local privilege escalation, Android system vulnerabilities, suid applications, and OEM-specific apps. The OWASP Mobile Top 10 section gave each risk real examples: insecure data storage, insufficient transport layer protection, unintended data leakage, poor authorization and authentication, broken cryptography, client side injection, security decisions via untrusted inputs, improper session handling, and lack of binary protections since most applications decompile trivially. The exploitation block demonstrated content provider queries, SQL injection through exposed intents, drive-by attacks (NotCompatible), tapjacking, LFI and directory traversal in content providers, HTML5 attacks on Cordova-family apps, WebView JavaScript interface exploitation below 4.1.1 running native commands, and backup-based vulnerabilities demonstrated on LastPass using adb backup, abe extraction, and adb restore.

The closing instrumentation and automation sessions covered manual hooking by adding Log.d calls to interesting methods, Introspy running on Cydia Substrate with introspy.db analysis, and Drozer, driven through its app.package, app.provider, and scanner modules with drozer_check for automated analysis, plus the Attify AppWatch API. Supporting tooling included sqlite3 dumps, AndroidAuditTools’ fsdiff.rb for before/after filesystem diffs, the native-code world-readable-writable file vulnerability found by Tavis Ormandy, and insecure file storage examples in Twitter Vine and older WhatsApp versions.

Key Themes

Notable Points

Notable Quotes

“FastPaced Hands-On approach mixed with Theory”

“To be an Android Hacking Expert/Ninja in a matter of 2 days.”

“APK is simply a Jar == TAR == ZIP”

“Android allows backups and restoration of its data [without root]”

“Remember click-jacking”

“Too easy to decompile.”