TCM Security Academy Notes - by syselement
🏠 Home BlogGitHub📚 Buy Me a Book
  • TCM Security Academy Notes
  • Courses
    • TCM - Linux 101
      • 1. Introduction
        • Linux Distributions
        • Installing Linux
      • 2. Command Line
        • Intro to Command Line
        • Getting help on the Command Line
        • Command Line Arguments and Options
        • Reading Text Files
      • 3. File System
        • Filesystem Hierarchy Standard
        • Devices, Partitions and Mounting
        • Absolute and Relative Paths
        • Files and Directories
        • Paths, Filenames and Text Files
        • Filesystem Links
        • Archiving and Searching Files
      • 4. Users and Groups
        • Working with Users and Groups
        • File and Directory Permissions
        • Changing Users and Passwords
      • 5. Installing Software
        • Package Management
      • 6. Shells
        • Common Command Line Shells
        • Environment Variables & Startup Files
        • Input/Output Redirection
        • Command History & Substitution
      • 7. Utilities and File Editors
        • Searching and Processing Text
        • Networking at the Command Line
        • File Transfer
        • Text Editors and Converters
      • 8. Process Management
        • Process Information
        • Foreground and Background Processes
        • Managing Processes
        • Scheduling Processes
      • 9. Regular Expressions
        • Regular Expressions, Searching, Replacing, Building
      • 10. Bash Scripting
        • Bash Scripting Basics, Control Structures, Loops
      • 🌐Linux101 References
    • TCM - Mobile Application Penetration Testing
      • 1. Introduction & Mobile Pentesting
      • 2. Android Security
      • 3. Android Lab Setup
      • 4. Android Static Analysis
      • 5. Android Dynamic Analysis
      • 6. Android Bug Bounty
      • 7. iOS Security
      • 8. iOS Lab Setup
      • 9. iOS Static Analysis
      • 10. iOS Dynamic Analysis
      • 11. iOS Bug Bounty
      • 🌐MAPT References
    • TCM - Practical Ethical Hacking
      • 1. Introduction & Networking
      • 2. Lab Set Up, Linux & Python
        • Intro to Kali Linux
        • Intro to Python
      • 3. The Ethical Hacker Methodology
        • Information Gathering
        • Scanning & Enumeration
        • Vulnerability Scanning with Nessus
        • Exploitation Basics
        • Capstone Practical Labs
      • 4. Active Directory
        • Active Directory Lab
        • AD - Initial Attack Vectors
        • AD - Post-Compromise Enumeration
        • AD - Post-Compromise Attacks
        • AD - Additional Attacks
        • AD - Case Studies
      • 5. Post Exploitation
      • 6. Web Application
        • Web App Lab Setup
        • Web App - SQL Injection
        • Web App - XSS
        • Web App - Command Injection
        • Web App - Insecure File Upload
        • Web App - Authentication Attacks
        • Web App - XXE
        • Web App - IDOR
        • Web App - Capstone Practical Lab
      • 7. Wireless Attacks
      • 8. Legal Documentation & Report Writing
      • 🌐PEH References
  • 🏠syselement's Blog Home
Powered by GitBook
On this page
  • Android Architecture
  • Kernel
  • Hardware Abstraction Layer (HAL)
  • Native C vs Android Runtime
  • Java API Framework
  • System Application Layer
  • Signing Process

Was this helpful?

Edit on GitHub
  1. Courses
  2. TCM - Mobile Application Penetration Testing

2. Android Security

Previous1. Introduction & Mobile PentestingNext3. Android Lab Setup

Last updated 1 year ago

Was this helpful?

Android Architecture

is based on the Linux O.S.

Virtual Machine

  • Dalvik - original runtime VM, not used anymore

  • Android Runtime (ART) - modern runtime for executing app's bytecode into the device, within the app's own sandbox and isolated file system with a unique user

Android Identity and Access Management

User - owner of the application directory

  • UID 10000 to 999999 - username e.g. u0_a129 (with UID 10129)

  • Various app's directories

    • /data/app/com.example.basic - generic app data

    • /data/data/com.example.basic - runtime storage of data

    • /mnt/sdcard/Android/data/com.example.basic - external stored data for runtime

  • root (system level) user is necessary to access every application directory

Apps can communicate with each other either through granted permissions or, more commonly, by utilizing an exposed Content Provider / Broadcast Receiver (e.g. Open with option).

  • Profiles (work BYOD, personal, etc) - access system level functions, but can have isolated app's data, clipboard, contacts, etc

  • Primary User - first created user, removed only by factory reset

  • Secondary User - additional users

  • Guest User - guest access to the phone

  • Kid Mode - specific account for kids

Kernel

Android relies on a modified Linux Kernel with additional features, with key components such as the managed runtime (ART/Dalvik) for applications and Bionic, Android’s equivalent of glibc (GNU C library)

  • Support for various CPU types

    • Lower SDK/Android level can have more security vulnerabilities

    • The higher the SDK/API level, the better/more secure

  • Physical components are controlled by drivers

Hardware Abstraction Layer (HAL)

HAL is an interface between the operating system and hardware components, providing a standardized way for the OS to communicate with various manufacturer and type of hardware components.

  • HAL types: Automotive, iOT, Gaming peripherals, etc

Native C vs Android Runtime

C and C++ is the device's native language.

  • no VM required

  • Webkit, Libc, OpenMAX AL / OpenGL ES / Media (UI APIs)

Java API Framework

A collection of predefined classes and methods provided by Java for building applications, offering a standardized set of functionalities.

  • Content Providers - for data sharing to other apps via a specific directory

  • View System - App's UI

  • Managers - Notifications, Package management, Telephony, Location, Activity, etc

System Application Layer

The layer of software that includes essential system applications and services, Google and vendor specific pre-installed applications.

Signing Process

Android apps can be decompiled (reverse-engineered), rebuilt, re-signed and re-run.

DEX Bytecode ➡️ SMALI ➡️ Decompiled JAVA

📌 Android Applications need to be signed to run on Android devices.


Linux file permission model (e.g. drwxr-xr-x) -

Apps run on specific Android Runtime/API version (minSDKVersion) - Check for Android API Levels -

Java / are preferred over Native C, due to their portability and compatibility across various devices.

Tools for reverse engineering Android apps - ,

involves the use of cryptographic signatures, including additional features like Google Play Signing, to verify the authenticity and integrity of an Android app.

Signing Tools - (Generate a private key), (apk signing), (zip & optimize apk).

Chmod Calculator
Android Architecture
https://apilevels.com/
Kotlin
apktool
jadx / jadx-gui
Android application signing
keytool
jarsigner
zipalign
Android
The Android software stack - https://developer.android.com/guide/platform
Android build process
APK validation process v4 - source.android.com