Android App Pentesting Checklist by @Hrishikesh7665
Android App Pentesting Checklist by @Hrishikesh7665
@Hrishikesh7665
Welcome to the "Android App Penetration Testing Checklist" Repository!
Explore the ultimate companion for Android app penetration testing, meticulously crafted to identify
vulnerabilities in network, data, storage, and permissions effortlessly. This repository merges a
comprehensive checklist of tasks and cutting-edge techniques, providing security professionals with a
robust framework for a thorough security assessment of Android applications.
Static analysis: reviewing the app's source code and resources for potential vulnerabilities
Dynamic analysis: analyzing the app's behavior and interactions with the device and network during
runtime
Network analysis: analyzing the app's communication with servers and other external resources over
the network
Permission analysis: reviewing the app's requested permissions and assessing whether they are
appropriate and secure
Cryptographic analysis: reviewing the app's use of cryptography and ensuring that it is implemented
securely
Data storage analysis: analyzing the app's handling of sensitive data, including how it is stored and
transmitted
This checklist is intended as a starting point for penetration testers and bug bounty hunters to
identify common security issues in Android applications. It is not a comprehensive guide to all
possible security issues and should be used in conjunction with other resources and best practices.
Table of Content
Android Applications Penetration Testing Checklist (v1.1)
Important Tools
Tools Installation/Setup
Prerequisites
Hardware requirements
Software/Tools prerequisites
1. Java (Jdk)
2. Python/Python3
3. Genymotion
4. Docker
5. Android Debug Bridge (adb)
6. Magisk
Mobile Security Framework (MobSF)
MobSF Installation on Docker
MobSF Installation on Physical Machine
Drozer (on desktop)
APKLeaks
Apktool
APKToolGUI
JADX
JD-GUI
Dex2Jar
Objection
Burp Suite
Postman
Radare2
Nuclei
Zipalign
DB Browser for SQLite
Frida Tools
Frida Server (Magisk-Frida)
Always Trust User Certs & Burp-cert Magisk Modules
Fridump
Useful Commands & Tools Usage
ADB Commands
Frida Commands
Objection Commands
Drozer Commands
Terminology's
SSL Pinning
KeyStore
Memory Dump
Important Links
Intentionally Vulnerable Applications For Practice
Android Applications Penetration Testing Checklist (v1.1)
[] []
1 Missing Root Detection
[] []
1 Missing Emulator Detection
1 Check the manifest file for the receiver tag and the [] []
exported attribute if it is True and if there is no other
C11 Broadcast Receivers Discovered Undiscovered
permission is set. It can be exploited.
Checks for all possible the possible test cases that’s are
1 applicable on API Check (Use a comprehensive API [] []
checklist)
5 Fuzzing [] []
N/A
C- Some Other Checks Discovered Undiscovered
NB: This list does not follow the OWASP vulnerability indexing order.
Important Tools
Mobile Security Framework (MobSF) (Link)
Runtime Mobile Security (RMS) (Link)
Pen-Andro (Link)
Burp Suite (Link)
Postman (Link) for API's
Yaazhini (Link)
House (Link)
Apktool (Link)
Easyapktool (Link) Discontinued
APKToolGUI(New) (Link) Easyapktool Alternative
Genymotion (Link)
Frida (Link)
Magisk (Link)
Magisk-Frida (Link)
Frida-tools (Link)
Drozer (Link)
Objection (Link)
JD-GUI (Link)
JADX (Link)
Dex2Jar (Link)
ApkLeaks (Link)
Fridump (Link)
Sqlite Browser (Link)
Radare2 (Link)
Nuclei (Link)
XMLStarlet (Link)
ADB (Link)
zipalign (Link)
Tools Installation/Setup
[!WARNING] As you explore this repository further, please be aware that certain actions, such as
bootloader unlocking, Magisk installation, and rooting techniques, come with inherent risks. Your
device's warranty may be voided, and there's a potential for data loss, instability, or even
"bricking" your device.
Rooting exposes your device to security risks, and it may no longer receive official updates,
leaving it vulnerable. This information is shared for educational purposes only, and I take no
responsibility for any damage, data loss, or malfunctions that may occur.
By proceeding, you acknowledge and accept all risks involved, and it is advisable to fully
understand the consequences before implementing any changes.
Prerequisites
Hardware requirements
Software/Tools prerequisites
Before you start testing Android apps, make sure to install the necessary tools on both your computer
(Linux/Windows) and the Android device itself.
3. Genymotion (Link)
4. Docker (Link)
NB: If you are using other than Debian or Ubuntu based Linux, read this instruction to install docker
according to your operating system.
wget -c https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip platform-tools-latest-linux.zip
cd platform-tools
chmod +x ./adb
chmod +x ./fastboot
./adb version
Download adb-setup.zip
Extract the downloaded zip
Double click on adb-setup-1.4.3.exe
In CMD window select Y for all options
Install the Google USB driver. (The installer will automatically run once the fastboot setup is
complete)
6. Magisk (Link)
Pre-requirement:
Download a custom recovery for your Android device, such as TWRP / OrangeFox /
PitchBlack onto your desktop.
Run this command to check your device is connected or not with proper access
adb devices
N.B: If you encounter an 'unauthorized' message after seeing your device number, follow the
steps below. Ensure you perform these commands. Allow usb debugging authorization on
your Android device when prompted also check Always allow from this computer checkbox.
Select 'File Transfer' in USB mode.
adb kill-server
adb start-server
adb devices
Run command to check your device is properly connected in fastboot mode or not
Install Magisk
Pre-requirement:
Docker (Link)
let's assume your docker engine up and running let's continue with MobSF installation
Install MobSF:
Run MobSF:
Pre-requirement:
Python/Python3(Link)
let's assume you have installed Python/Python3 let's continue with MobSF installation on your
desktop
# run MobSF
./run.sh
# run setup.bat
setup.bat
# run MobSF
run.bat
Congratulation your MobSF is installed and running navigate to localhost:8000 using your preferred
web browser.
Docker (Link)
let's assume your docker engine up and running let's continue with Drozer installation on your
desktop
Install Drozer:
Run Drozer:
Congratulation your Drozer is installed on your desktop now we need to install Drozer Agent Apk
agent-debug.apk
APKLeaks
Pre-requirement:
Docker (Link)
let's assume your docker engine up and running let's continue with APKLeaks installation
Install APKLeaks:
Run APKLeaks:
Apktool
Pre-requirement:
Java (Link)
let's assume you have installed Java JDK let's continue with Apktool installation on your desktop
Open the link on your browser right click and save the file as 'apktool.bat' (Link)
Download latest version of apktool (Link)
Move both apktool.jar and apktool.bat to your Windows directory. (Usually C://Windows)
Run Apktool:
apktool
APKToolGUI
Pre-requirement:
Java (Link)
let's assume you have installed Java JDK let's continue with APKToolGUI installation on your desktop
****N.B:**** Please note that APKToolGUI is currently only available for Windows OS.
JADX
Pre-requirement:
Java (Link)
let's assume you have installed Java JDK let's continue with JADX installation on your desktop
cd ./JADX/bin
# Give executable permission to jadx and jadx-gui script
chmod +x jadx && chmod +x jadx-gui
JD-GUI
Pre-requirement:
Java (Link)
let's assume you have installed Java JDK let's continue with JD-GUI installation on your desktop
# Run jd-gui
jd-gui
Dex2Jar
Pre-requirement:
Java (Link)
let's assume you have installed Java JDK let's continue with Dex2Jar installation on your desktop
Objection
Pre-requirement:
Python/Python3 (Link)
let's assume Python/Python3 is installed let's continue with objection installation on your desktop
Burp Suite
Pre-requirement:
Java (Link)
let's assume you have installed Java JDK let's continue with Burp Suite installation on your desktop
Go to the Burp Suite official website, pick either Burp Suite Professional or Burp Suite
Community, and download the JAR file(Link)
Postman
Go to the Postman official website, and download the tar.gz file for linux & the exe for the
windows (Link)
# Install dependencies
sudo apt-get -y install libgconf-2-4 openssl
# Extract the archive
tar zxf /path/to/downloaded/archive/Postman-linux-xXX-X.XX.X.tar.gz
# Move postman to apps
sudo mv Postman /opt/apps/
# Create shortcut
sudo ln -s /opt/apps/Postman/Postman /usr/local/bin/postman
postman
Radare2
Install Radare2 (Linux):
radare2 -h
.\radare2\bin\r2.bat
Nuclei
Pre-requirement:
Docker (Link)
let's assume your docker engine up and running let's continue with Nuclei installation
Install Nuclei:
Run Nuclei:
nuclei -h
Zipalign
Install Zipalign (Linux):
zipalign
zipalign.exe
sqlitebrowser
Frida Tools
Pre-requirement:
Python/Python3 (Link)
let's assume Python/Python3 is installed let's continue with Frida Tools installation on your desktop
Magisk (Link)
let's assume Magisk is installed on your Android device let's continue with Frida Server installation
Open your Magisk Manager App, go to module section, Click on 'Install from storage'
Refer to Picture
Magisk (Link)
let's assume Magisk is installed on your Android device let's continue with Always Trust User Certs &
Burp-cert Magisk Modules installation
Refer to Picture
Fridump
Pre-requirement:
Python/Python3 (Link)
Frida (Link)
Frida Server (Link)
let's assume Python/Python3, Frida is installed on your desktop and Frida Server is installed on your
android device let's continue with Fridump installation
python3 fridump.py -h
python fridump.py -h
ADB Commands
Start the adb server:
adb start-server
adb kill-server
adb devices
adb reboot
# For a full device backup, including certain apps, system data, and files
adb backup -apk -obb -shared -all -system -f <some_file_name>.ab
# e.g.:
# adb backup -f testbackup.ab
# adb backup -nosystem -noapk -noshared -f diva_backup.ab jakhar.aseem.diva
# adb backup -apk -obb -shared -all -system -f testbackup_full.ab
# Other Options
# -f <filename> specify filename default: creates backup.ab in the current directory
# -apk|noapk enable/disable backup of .apks themself default: -noapk
# -obb|noobb enable/disable backup of additional files default: -noobb
# -shared|noshared backup device's shared storage / SD card contents default: -noshared
# -all backup all installed applications
# -system|nosystem include system applications default: -system
# <packages> a list of packages to be backed up (e.g. jakhar.aseem.diva) (not needed if -all i
# e.g.:
# adb restore testbackup_full.ab
[!NOTE] Keep in mind that, restoring sensitive information or user logged-in sessions after
restoring a backup taken via ADB could be considered a potential vulnerability.
# Use this command when you already connected to a device using USB
adb tcpip <desired_port_number>
# e.g.:
# adb tcpip 5555
# adb connect 192.168.50.23:5555
adb shell
adb shell su
# Other options:
# -f: see their associated file
# -d: filter to only show disabled packages
# -e: filter to only show enabled packages
# -s: filter to only show system packages
# -3: filter to only show third party packages
# -i: see the installer for the packages
# -U: also show the package UID
Find an android package:
# e.g.:
# adb shell pm list packages 'diva' | cut -d ':' -f2
# e.g.:
# adb shell ps | jakhar.aseem.diva
# e.g.:
# adb install diva.apk
# adb install -s diva.apk
# e.g.:
# adb shell monkey -p jakhar.aseem.diva -c 1
# adb shell dumpsys package jakhar.aseem.diva
N.B:
Monkey tool method means pretending to be a user and starting the app by clicking on its icon.
Monkey tool method will only worked when Main activity is exported in the
AndroidManifest.xml.
Launch an apk activity directly using adb:
# e.g.:
# adb shell am start -n jakhar.aseem.diva/.MainActivity
# e.g.:
# adb uninstall jakhar.aseem.diva
# adb uninstall -k jakhar.aseem.diva
[!NOTE] Keep in mind that, when using ADB, empty directories will not be copied from or to an
Android device.
Frida Commands
List android packages using Frida:
# e.g.:
# frida-ps -Uai | grep -i 'diva'
[!TIP] -D : Use this flag Connect Frida to the specific device (the device identifier you gate by
running adb devices command)
N.B: Here tee command part is optional, I recommended this for display and also save the
output in a file which may required letter.
# e.g.:
# frida-trace -p 852
# frida-trace -p 852 -i 'log*'
[!TIP] You can use -i flag multiple times as per your needs.
For example: frida-trace -p 852 -i 'log*' -i 'recv*' -i 'send*'
# e.g.:
# frida --no-pause --codeshare dzonerzy/fridantiroot -f jakhar.aseem.diva
# e.g.:
# frida --no-pause --codeshare pcipolloni/universal-android-ssl-pinning-bypass-with-frida
# e.g.:
# frida --no-pause -l emulator_detection_bypass.js -f jakhar.aseem.diva
# e.g.:
# frida --no-pause --codeshare dzonerzy/fridantiroot --codeshare pcipolloni/universal-andr
N.B: Frida automatically paused the target app when attaching. Using
--no-pause to prevent this, allowing the app to start normally while Frida injected the scripts.
Objection Commands
Connect an app to Objection:
# e.g.:
# objection --gadget jakhar.aseem.diva explore
import <some_frida_script_file>
objection --gadget <package_name_of_the_apk> explore --startup-script <some_frida_script_file>
# e.g.:
# import emulator_detection_bypass.js
# objection --gadget jakhar.aseem.diva explore --startup-script emulator_detection_bypass.js
# Some interesting information like passwords, paths could be find inside the environment.
env
#e.g.:
# objection --gadget jakhar.aseem.diva explore --startup-command 'android sslpinning disable -
#e.g.:
# objection --gadget jakhar.aseem.diva explore --startup-command 'android root disable --quiet
# List activities
android hooking list activities <package_name_of_the_apk>
# List services
android hooking list services <package_name_of_the_apk>
# List receivers
android hooking list receivers <package_name_of_the_apk>
# e.g.:
# android hooking list activities jakhar.aseem.diva
# android hooking list services jakhar.aseem.diva
# android hooking list receivers jakhar.aseem.diva
# e.g.:
# memory list modules | grep 'diva'
# e.g.:
# memory dump all 'all_memory.dmp'
#memory dump from_base 0x77bbc000 4096 'all_memory.dmp'
# e.g.:
# memory search 'api' --string
[!TIP] Base address can be obtain by running memory list modules command.
The size_to_dump is the amount of memory to extract, in bytes (e.g., 4096 for 4 KB).
# e.g.:
# android hooking search classes 'jakhar.aseem.diva'
List declared Methods of a class with their parameters in the current application:
# e.g.:
# android hooking list class_methods jakhar.aseem.diva.MainActivity
# e.g.:
# android hooking search classes jakhar.aseem.diva MainActivity
# Read source code in static analysis face to aware about function names
android hooking watch class_method <package_name_of_the_apk>.<activity_or_class_name>.<functio
# e.g.:
# android hooking watch class_method jakhar.aseem.diva.MainActivity.xyz --dump-args --dump-bac
# e.g.:
# android hooking watch class jakhar.aseem.diva.MainActivity --dump-args --dump-args --dump-re
Alter boolean return value of a function:
# From the source code you can determine which function returns a boolean, and make the functi
android hooking set return_value <package_name_of_the_apk>.<activity_or_class_name>.<function_
# e.g.:
# android hooking set return_value jakhar.aseem.diva.MainActivity.xyz false
List instances of a specific Java class inside current app using Objection:
# e.g.:
# android heap print_instances MainActivity
# First identify current app database(s) location, then go to the location and connect to the
sqlite connect <sqlite_database_location_and_file_name>
# Get the database schema for the currently connected SQLite database
sqlite execute schema
# e.g.:
# sqlite connect credentials.db
# sqlite execute query select * from data
[!NOTE] The sqlite command utility in Objection allows you to connect to a SQLite database.
On connecting to a remote device database Objection copy the remote database file to a local
temporary directory. When a user executes any SQL query, it is initially performed on the cached
database file locally. If the user employs the sqlite sync command, the file is then validated.
Once the local cached SQLite database is validated, it is synchronized with the remote database.
Drozer Commands
Connect to Drozer:
# e.g.:
drozer console connect --server 192.168.100.5
# e.g.:
# run app.package.list -f adb shell pm list packages 'diva'
# e.g.:
# run app.package.info -a jakhar.aseem.diva
# e.g.:
# run app.package.manifest jakhar.aseem.diva
# e.g.:
# run app.package.attacksurface jakhar.aseem.diva
run app.package.backup
run app.package.debuggable
# List activities
run app.activity.info -a <package_name_of_the_apk>
# List booth
run app.activity.info -i -a <package_name_of_the_apk>
# e.g.:
# run app.activity.info -a jakhar.aseem.diva
# run app.activity.info -i jakhar.aseem.diva
# run app.activity.info -i -a jakhar.aseem.diva
# e.g.:
# run app.activity.start --component jakhar.aseem.diva jakhar.aseem.diva.MainActivity
List exported and unexported content providers of an android package using Drozer:
# e.g.:
# run app.provider.info -a jakhar.aseem.diva
# run app.provider.info -u -a jakhar.aseem.diva
Investigate Android package content providers for potential vulnerabilities using Drozer:
# e.g.:
# run scanner.provider.finduris jakhar.aseem.diva
Investigate Android package content providers for potential SQL Injections vulnerabilities using
Drozer:
# e.g.:
# run scanner.provider.injection jakhar.aseem.diva
Find tables accessible through SQL injection in a Android package using Drozer:
# e.g.:
# run scanner.provider.sqltables jakhar.aseem.diva
Investigate Android package content providers for basic directory traversal vulnerabilities using
Drozer:
run scanner.provider.traversal <package_name_of_the_apk>
# e.g.:
# run scanner.provider.traversal jakhar.aseem.diva
Investigate Android package for browsable activities that can be invoked from the web browser
using Drozer:
# e.g.:
# run scanner.activity.browsable jakhar.aseem.diva
Investigate Android package native components for potential vulnerabilities using Drozer:
# e.g.:
# run scanner.misc.native jakhar.aseem.diva
Investigate Android package for secret codes that can be used from the dialer using Drozer:
# e.g.:
# run scanner.misc.secretcodes jakhar.aseem.diva
Terminology's
SSL Pinning
SSL (Secure socket layer) pinning in Android is a security measure where a mobile app validates a
server's SSL certificate against a pre-defined certificate or public key embedded within the app. This
helps prevent man-in-the-middle attacks by ensuring a secure and trusted connection.
KeyStore
In Android, a keystore is a secure storage system used to store and manage cryptographic keys and
certificates. It provides a secure environment for tasks like SSL/TLS pinning, app authentication, and
data encryption, enhancing the overall security of Android applications.
Memory Dump
In Android, a memory dump is a snapshot of the device's current system memory. It captures the
contents of RAM, including running processes and their data. Check memory dump for any sensitive
information stored in memory.
Important Links
https://book.hacktricks.xyz/mobile-pentesting/android-checklist
learnfrida.info
codeshare.frida.re
https://github.com/dweinstein/awesome-frida
https://github.com/interference-security/frida-scripts
https://github.com/m0bilesecurity/Frida-Mobile-Scripts
https://github.com/WithSecureLabs/android-keystore-audit
https://owasp.org/www-project-mobile-security-testing-guide/
https://github.com/B3nac/Android-Reports-and-Resources
https://github.com/wtsxDev/android-security-list
https://mobile-security.gitbook.io/mobile-security-testing-guide/
https://github.com/ashishb/android-security-awesome
https://androidsdkoffline.blogspot.com/p/android-sdk-build-tools.html