Copyrighted Material
Total Page:16
File Type:pdf, Size:1020Kb
Index SYMBOLS tool, 63 %n format specifi er, 403 ADBI framework, 492 Add Native Support menu item, A 226–227 abootimg tool, 330 addresses Abstract Namespace Socket, 165 address lines, unexposed, 482 access control mechanisms address space layout (kernels), 350 (mitigations), 407–408 extracting (Linux kernel), 350–352 Access Point Name (APN), 137 adjacency (networking), 137–139 Activities (Android applications), Adleman, Leonard, 413 36–37 ADT Bundle, 213 Activities (IPC endpoint), 89–90 ADT plug-in (Eclipse), 226, 486 ActivityManager, 193–194 Adventures in Bouncerland, 152 ad networks (attack surfaces), 146–147 adware, 147 ADB (Android Debugging Bridge) Aedla, Jüri, 78 access via TCP/IP, 140 agent-proxy program, 346 ADB binaries, 227–228 ahh_setuid module, 324 ADB daemon, physical attacks via, AIDL (Android Interface Defi nition 173 COPYRIGHTED MATERIALLanguage), 51–52 adb restore command race alephzain, 80 condition, 80 allocated blocks, controlling heap adb root command, 218 with (Android browser), 289–290 adbd daemon, 69 AllWinner SoC ARM core, basics, 46–47 503 monitoring Android phones with, am command, 231 386 AndBug debugger, 112–113 523 524 Index ■ A–A Androguard framework, 95–96, controlling heap with free blocks, 493–494 288–289 Android CVE-2011-3068 bug, 284–287 Android on Intel Architecture Android Developer Tools (ADT) (Android-IA) project, 10 bundle, 486–487 Android Secure Container (ASEC) plug-in, 212 fi les, 47 Android ecosystem Android Studio, 487 company history, 2 Android-centric fork (Linux kernel), compatibility requirements, 17–18 49–50 complexities of, 15–16 AndroidManifest.xml fi le, 30, 35 device pool, 4–6 Android.Troj.mdk Trojan, 151 fragmentation of, 16 application packages (APKs), 35 open source components, 7 application Support Library, 17 public disclosures, 22–23 applications, 34–39 security vs. openness, 21–22 building from source, 67 stakeholders. See stakeholders, Compatibility Defi nitions, 63 Android Device Monitor, 212 update issues, 18–21 dlmalloc allocator (heap version history, 2–4 exploitation), 269–271 Android Framework emulator, 86 basics, 39–40 exposed UART on, 426–428 licensing, 12 GDB binary, 245 overview of, 26 heap debugging, 248–249 Android telephony stack IDs (AIDs), 27–28 basics, 370–371 Interface Defi nition Language customization of, 371–372 (AIDL), 51–52 AndroProbe, 246 logging system architecture, 53 Anonymous Shared Memory Native Development Kit (NDK), 486 (ashmem) (Linux kernel), 52, 167 Software Development Kit (SDK), anti-reversing epoxies, 482 93–94, 485–486 aobj ARSCParser object, 106 system architecture, 25–27 AOSP (Android Open Source Project) Update Alliance, 21 custom kernels for AOSP-supported Android 4.0.1 linker case study (ROP) devices, 325–326 executing arbitrary code from new getting kernel source, 317–319 mapping, 303–307 Git repositories, 501–502 overview of, 300–301 indexes of AOSP source code, 510 pivoting stack pointer, 301–303 initializing, 215 Android browser exploitation native code debugging with, 227–233 controlling heap with allocated native code debugging with non- blocks, 289–290 AOSP devices, 241–243 controlling heap with CSS, 287–288 Nexus devices supported by, 5 Index ■ A–A 525 prebuilts directory, 229 ARM ABI (Application Binary Apache Ant, 223 Interface), 295 Apache HTTP client libraries, 39 ARM Linux debugger, 207–208 Apache Software License, 7 ARM9TDMI implementation, 292 API permissions, 32 licensing and designs, 10 apktool (Java tool), 94, 494 ROP on. See ROP on ARM app markets, 13 separate instructions and data app permissions, 27, 84–86 caches, 292–294 Application Framework components SOC families in ARM devices, 11 (RIL), 371 subroutine calls (ROP on ARM), application layer (OSI model), 136 295–297 application processor (smartphones), arm-eabi compiler, 322 369 ARP spoofi ng, 138 application security ashmem (Anonymous Shared app permission issues, 84–86 Memory) (Linux kernel), 52 information leakage through logs, ASLR (Address Space Layout 88–89 Randomization) insecure data storage, 87–88 basics, 398–400 insecure transmission of sensitive overcoming, 418–419 data, 86 asroot exploit, 74 mobile security (app case study). See Asus mobile security app (case study) ASUS Transformer Prime, overview of, 83–84 79 SIP client (case study). See SIP client open source repositories, 506 (case study) stock fi rmware (kernels), 312 unsecured IPC endpoints, 89–91 attack phase (mobile security app), application testing tools, 496 117–120 app-locked device screen, 120 attack surfaces (Android) app.provider.query module, 125 basics, 131–132 apps classifying, 134 debugging with NDK, 222–226 local attack surfaces. See local attack malicious, 149 surfaces Verify Apps feature (Google), 150– physical. See physical attack surfaces 151 physical adjacency, 154–161 web-powered mobile (attacks), remote. See remote attack surfaces 145–146 surface properties, 133 argv array, 281–282 third-party modifi cations, Arithmetic Logic Unit (ALU) status 174 fl ags, 341 attacks ARM architecture attack vectors, 130–131 ABI rules used on, 264 overview of, 129–130 526 Index ■ B–B root access. See root access attack Block View tool, 461 history blown debug interfaces, 480 automating Bluetooth (attack surfaces), 157–158 GDB client, 235 BluetoothOppService, 38 on-device tasks, 233–234 Board Support Packages (BSPs), 502–503 B boot command, 332 Babel fi sh, JTAG, 437 boot images back-porting, 20 creating, 329–331 backtrace GDB command, 252 extracting kernels from, 315 Baker, Mike, 74 boot loaders Baksmali disassembler, 493 boot partition (NAND fl ash Barra, Hugo, 20 memory), 58 Baseband Attacks: Remote Exploitation locked/unlocked, 62–65 of Memory Corruptions inCellular passwords/hot keys/silent terminals, Protocol Stacks, 480 480–481 baseband communication, rild rooting with locked/unlocked, 65–69 interaction with, 375 U-Boot, 468–469 baseband interface (smartphones), 167 unlock tools, 70 baseband processors (attack surfaces), boot partitions 156–157 fl ashing, 333 basebands (smartphones), 369 getting images of, 310–311 Bassel, Larry, 410 NAND fl ash memory, 58 BCM3349 series chip, 447 recovery partition and, 314, 329–330 Beagle device (Total Phase), 464 writing directly to, 334–335 Beagle I2C (Total Phase), 498 boot process, 60–62 Beagle USB (Total Phase), 498 booted systems, gaining root access beaming data, 159 on, 69 Bergman, Neil, 88 boot.img fi le, 315 bin arrays, 270 booting binaries, altering (exploit mitigations), custom kernels, 331–336 416–417 customized boot sequences, 481–482 Binder driver (Linux kernel) Borgaonkar, Ravi, 142 attack surfaces, 166–167 Bouncer system (attack surfaces), basics, 50–52 151–152 IPC and, 310 break command (AndBug), 116 Binwalk, 487 breakpoints binwalk tool, 316, 475 interdependent, 250 Bionic C runtime library (Android), setting in “Hello World” module, 248 347–348 Bionic library, 42 Broadcast Receivers Index ■ C–C 527 basics, 37 fuzzing. See fuzzing Chrome for fuzz testing. See fuzzing Broadcast Android Receivers Google Play updates for, 144–145 handling implicit Intent messages client-side attack surfaces, 143–148 with, 89 coalescing with blocks, 270–271 onReceive method and, 101 code browser attack surfaces, 143–145 behind sockets, fi nding, 165–166 browser exploitation, Android. See Code Aurora forum (Qualcomm), 23 Android browser exploitation Code Division Multiple Access BrowserFuzz, 188, 193–194, 197 (CDMA), 154 Bus Pirate device, 465–468, 497 code signing, 392–394, 422 bus resets (USB devices), 198 Common Attack Pattern Enumeration busybox binary, 165–166, 491 and Classifi cation (CAPEC), 130 BusyBox tool, 231 Common Vulnerabilities and Butler, Jon, 190 Exposures (CVE) project, 23, 352– 353 C Common Vulnerability Scoring The C ++ Programming Language System (CVSS), 130 (Addison Wesley), 272 company history (Android), 2 C++ virtual function table pointers, Compatibility Defi nition Document 271–273 (CDD), 327 caches compatibility requirements (Android), cache partition (NAND fl ash 17–18 memory), 59 Compatibility Test Suite (CTS), 349 instructions and data (ARM), 292– Complex Instruction Set Computing 294 (CISC), 299 calloc function, 395 components, identifying hardware, canhazaxs tool, 162–163 456–458 carriers (stakeholders), 12 CONFIG_KALLSYMS confi guration Case, Justin, 87 option, 350 cat binary on Android, 400 CONFIG_SEC_ RESTRICT_FORKK kernel CDD (Compatibility Defi nition option, 412 Document), 18 CONFIG_SEC_RESTRICT_SETUID cellular modem (smartphones), kernel option, 412 369 CONFIG_STRICT_MEMORY_RWX kernel certifi cate pinning, 146 confi guration, 410–411 Chainfi re SuperSU, 66 confi gurations chip passwords, 480 confi guring kernel, 321–322, 349 Chip Quik, 472, 498 confi guring parameters for enabling chips, removing, 471–474 KGDB, 344 Chrome for Android browser and defenses (networking), 136–137 528 Index ■ D–D Package on Package (PoP), 458 building, 325–329 Conover, Matthew, 394 confi guring kernel, 321–322 consumers, features desired by, 14 creating boot images, 329–331 ContainerNode HTML element, 257 obtaining source code, 316–320 Content Providers setting up build environment, basics, 38–39 320–321 discovery of URIs (SIP client), 121– using custom kernel modules, 122 322–325 exported attribute of, 413 custom recovery images, 63–65 vulnerability of, 89 custom ROMs, 13–14 Cook, Kees, 409, 421 customized boot sequences, 481 core services CVE-2011-3068 bug (Android browser), Android Debugging Bridge (ADB), 284–287 46–47 CyanogenMod, 13 debuggerd, 46 Cydia Substrate for Android, 493 init command, 42–44 other services,