Android Village

Nullcon 2012 Goa, India
1 / 40
Slide 1 of Android Village
Slide 2 of Android Village
Slide 3 of Android Village
Slide 4 of Android Village
Slide 5 of Android Village
Slide 6 of Android Village
Slide 7 of Android Village
Slide 8 of Android Village
Slide 9 of Android Village
Slide 10 of Android Village
Slide 11 of Android Village
Slide 12 of Android Village
Slide 13 of Android Village
Slide 14 of Android Village
Slide 15 of Android Village
Slide 16 of Android Village
Slide 17 of Android Village
Slide 18 of Android Village
Slide 19 of Android Village
Slide 20 of Android Village
Slide 21 of Android Village
Slide 22 of Android Village
Slide 23 of Android Village
Slide 24 of Android Village
Slide 25 of Android Village
Slide 26 of Android Village
Slide 27 of Android Village
Slide 28 of Android Village
Slide 29 of Android Village
Slide 30 of Android Village
Slide 31 of Android Village
Slide 32 of Android Village
Slide 33 of Android Village
Slide 34 of Android Village
Slide 35 of Android Village
Slide 36 of Android Village
Slide 37 of Android Village
Slide 38 of Android Village
Slide 39 of Android Village
Slide 40 of Android Village

Abstract

A two-day Android Hacking Village workshop covering security from architecture fundamentals through malware analysis, ROM cooking, exploit techniques, and penetration testing methodologies.

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 Android Hacking Village at Nullcon 2012 was a two-day workshop run by a trainer team that included Ankur Bhargava and Mrigesh. Day one covered the basics: Android architecture, the file system, the security model, and hands-on application development. Day two went advanced: malware analysis, exploit surveys, ROM cooking, rooting, and an introduction to pentesting Android.

Summary

Day one opened with Android’s history: Android Inc. was founded in 2003 in Palo Alto by Andy Rubin, Rich Miner, Nick Sears and Chris White, acquired by Google in August 2005, and on November 5, 2007 the Open Handset Consortium released Android as its first product. The platform was presented as a software stack: a Linux-based kernel, middleware, C libraries and APIs, a Java application framework, and the custom Dalvik VM with a JIT compiler. The file system mapped the mounts that matter: / and /system read-only, /data read-write for installed packages, plus /proc, /mnt/sdcard, and /mnt/sdcard/asec for secure APK storage.

The security model was presented honestly in two halves. The good: traditional access control with idle-time or one-click locking, per-app sandboxing in unique Linux processes, a developer-configured and user-granted permission whitelist, X509 signing certificates with a 25 dollar market fee, and a remote kill switch. The bad: no hardware-backed encryption, no non-executable memory area, easy trojanization, a difficult environment for antivirus, long patch cycles, and security enforcement left to end users. Version updates moved the bar: Froyo added remote wipe and enterprise password options, Gingerbread added a non-executable stack and heap on ARMv6, Honeycomb added full filesystem encryption, and Ice Cream Sandwich brought face unlock, WiFi Direct, and Android Beam.

Application development covered the APK as a ZIP-formatted jar-based package, the component model of Activities, Services, Intents and Intent Filters, Broadcast Receivers, and Content Providers, plus the SDK’s Eclipse and ADT tooling with adb, DDMS, logcat and ProGuard. The pentest setup then listed proxy tooling with Echomirage and Autoproxy, debugging with adb and DDMS, and reversing with apktool, baksmali and dex2jar.

Day two started from the threat model: remote infection via market or browser, privilege escalation, user tracking, data stealing, and resource misuse against insecure storage, IPCs, component starting, and WebKit. Two malware families got detailed treatment: Android/DrdDream, which infected over 50 market apps, dropped an extra application into system/app, and used DES to encrypt data sent to the attacker; and the Android/DroidKungFu family, which shares DrdDream’s root exploit pair but encrypts it with AES and can load URLs and install additional software. Two exploits were dissected step by step: KillingInTheNameOf, which remaps the Android property space writable through the Ashmem vulnerability and toggles ro.secure so the ADB daemon runs as root; and RageAgainstTheCage, which exploits ADBd’s setuid behavior, forking shell-user processes until the NPROC limit is reached and restarting ADBd so it stays root. The ROM and root section compared custom and stock ROMs, walked three modding levels from GUI changes through decompiling to cross compiling and driver modding, and explained temporary versus permanent root with the SU and Superuser.apk pair, ending with demos at each level.

Key Themes

  • Platform fundamentals first: history, the software stack, and the file system layout give the base layer every later topic builds on.
  • A split security model: per-app sandboxing, permissions, signed provenance and a kill switch on one side; missing hardware encryption, weak obfuscation, trojanization risk, slow patches and user-dependent enforcement on the other.
  • Version drift: each release moved the bar, from Froyo’s remote wipe through Gingerbread’s non-executable memory to Honeycomb’s filesystem encryption and Ice Cream Sandwich’s new features.
  • Developers as targets: building a sample app teaches the APK structure, component model and SDK tools that later analysis depends on.
  • A concrete threat model: infection vectors and vulnerability classes pair with named malware families that used real root exploits and encryption.
  • Exploits as mechanics, not magic: KillingInTheNameOf and RageAgainstTheCage both end with ADB running as root, through property-space remapping and setuid failure respectively.
  • ROM modding in levels: simple, mid, and hardcore tiers take a device from app swaps to decompiling and driver modification, with rooting as the enabler.

Notable Points

  • The Open Handset Consortium formed on November 5, 2007 and released Android the same day.
  • Key mounts: / (read-only), /system (read-only core binaries and enforced APKs), /data (read-write installed packages), /proc, /mnt/sdcard, and /mnt/sdcard/asec for secure APK storage.
  • The good half of the security model: per-app VM and Linux process sandboxing, developer-configured and user-granted permissions, X509 signing with a 25 dollar market upload fee, and a remote kill switch.
  • The bad half: no hardware-backed encryption, no non-executable memory area, easy trojanization, weak antivirus conditions, long patch cycles, and security enforcement reliant on end users.
  • Version security updates: 2.2 Froyo added remote wipe and enterprise passwords, 2.3 Gingerbread added a non-executable stack and heap on ARMv6, 3.0 Honeycomb added full filesystem encryption, and 4.0 Ice Cream Sandwich added face unlock, WiFi Direct, and Android Beam over NFC.
  • Android/DrdDream infected over 50 Google market apps, installed an extra application in system/app, and used DES encryption for data sent to the attacker.
  • Android/DroidKungFu uses the same root exploit pair as DrdDream but encrypted with AES, and can load URLs and install additional software and updates.
  • KillingInTheNameOf affects Android 2.2 and below: the Ashmem implementation vulnerability lets applications remap the property space writable, toggle ro.secure to 0, and run the ADB daemon as root.
  • RageAgainstTheCage: ADBd starts as root and calls setuid to drop to the shell user; if the NPROC limit is reached the setuid fails, ADBd stays root, and the ADB shell inherits root.
  • Rooting basics: temporary root exploits an application for one boot, permanent root installs a backdoor, and SU with Superuser.apk governs access.

Notable Quotes

“Reports say that chances of an android phone being compromised is 2.5 times more than any other platform.”

“No process can access the resources of any other process.”

“Security enforcement reliant on end-users”

“Mobile threats already take advantage of exploits, employ botnet functionality, and even use rootkit features for stealth and permanence.”

“Maliciously modified apps are still a popular vector for infecting devices: Modify a legitimate app or game and users will download and install malware on their smartphones by themselves.”

“If setuid() fails, ADBd continues running as root”

Embed This Presentation

See Also