Lab · Hard · 3 hoursFree account
Android Malware Analysis
Analyse an Android malware sample: C2 extraction, permissions, and indicators.
On this page 8 sections
Before you start
Android malware often imitates a system app to collect permissions no real app needs. A spyware bundle reads SMS, contacts and location, encodes the data with a trivial XOR, then posts the lot to a command-and-control server over plain HTTP. Triage the APK with hashes, permissions and the signing certificate, decompile the DEX bytecode with jadx to recover the C2 endpoints, defeat the obfuscation, and write the indicators a SOC can use to find the next infected device.
What You'll Learn
- Triage a suspicious APK with hashes, permissions and manifest flags before running it
- Decompile DEX bytecode with
jadxand read Java source for malicious behaviour - Extract hardcoded URLs, IP addresses and C2 endpoints from code and resources
- Identify permission abuse patterns that indicate spyware, banking trojans or RATs
- Defeat simple string obfuscation and locate the decryption routine
- Map findings to indicators and write a short analyst report
This lab is a guided walk-through of example output. KaliRange gives no sample files and hosts no lab. The output comes from a fictional spyware sample called tracker.apk. To do the steps yourself, bring an APK that you may analyse: a suspicious sample that you handle safely on your own isolated machine, or a training app that you pick. Replace tracker.apk and the file names in the commands. Your output will differ. The method is the same for any sample.
Lab Setup
You analyse a practice malicious APK on your own emulator. The sample never touches a real device or a real network.
| Item | Requirement |
|---|---|
| Analysis machine | Kali Linux 2025.x or Ubuntu 22.04+ with 16 GB RAM |
| Emulator | Android emulator with a google_apis image (API 34), no Play Store build |
| Tools | jadx 1.5+, apktool 2.9+, apksigner, aapt2, dex2jar, jd-gui (optional) |
| Network | The emulator runs on host-only networking. No route to the internet |
| Sample | A practice malicious APK — use the MASTG UnCrackable apps, DIVA, or InsecureBankv2 |
Install the tools:
sudo apt update && sudo apt install -y apktool default-jdk
# jadx: download the latest release ZIP from the project's GitHub releases page
unzip jadx-*.zip -d /opt/jadx && export PATH=$PATH:/opt/jadx/binAuthorised scope only. Isolated lab network. Never on production.
Step 1: Triage the sample
Hash and identify
Before you open a single file, compute the hash and check the file type. The hash is the name of the sample in every note you write. The file type catches renamed executables.
sha256sum tracker.apk
file tracker.apke4a1f2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1 tracker.apk
tracker.apk: Zip archive data, at least v2.0 to extractAn APK is a ZIP. The file command confirms the format. Next, read the high-level metadata without unpacking:
aapt2 dump badging tracker.apk | head -15package: name='com.tracker.systemservice' versionCode='3' versionName='1.0.3' compileSdkVersion='33'
sdkVersion:'21'
targetSdkVersion:'33'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.READ_SMS'
uses-permission: name='android.permission.READ_CONTACTS'
uses-permission: name='android.permission.READ_CALL_LOG'
uses-permission: name='android.permission.ACCESS_FINE_LOCATION'
uses-permission: name='android.permission.RECEIVE_BOOT_COMPLETED'
uses-permission: name='android.permission.CAMERA'
uses-permission: name='android.permission.RECORD_AUDIO'
application-label:'System Service'Stop and read. The package name imitates a system component. The app requests SMS, contacts, call log, location, camera and microphone — the full set of a surveillance tool. RECEIVE_BOOT_COMPLETED means it starts on boot. targetSdkVersion:'33' means it uses modern APIs and must request dangerous permissions at runtime. These are strong leads before you read a single line of code.
Check the signature:
apksigner verify --verbose --print-certs tracker.apkVerifies
Verified using v2 scheme (APK Signature Scheme v2): true
Signer #1 certificate DN: CN=Unknown, O=Unknown
Signer #1 certificate SHA-256 digest: 1a2b3c...9f0eA certificate with CN=Unknown is a self-signed key with no identity. Legitimate developers use a real name. Record the certificate digest — it ties all versions of this malware family together.
Step 2: Read the manifest for attack surface
Decode the manifest
The manifest declares every component, permission and flag. Many findings come from this file alone, with no code review needed.
apktool d tracker.apk -o tracker_out
cat tracker_out/AndroidManifest.xml<manifest package="com.tracker.systemservice">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.READ_CALL_LOG"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<application android:allowBackup="true" android:debuggable="false"
android:label="System Service" android:usesCleartextTraffic="true">
<activity android:exported="true" android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<service android:exported="false" android:name=".MonitorService"/>
<receiver android:exported="true" android:name=".BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
</application>
</manifest>Build a checklist from the manifest:
| Finding | Detail |
|---|---|
| Surveillance permissions | SMS, contacts, call log, location, camera, microphone — no legitimate "System Service" needs all of these |
usesCleartextTraffic="true" | The app sends data over plain HTTP, which means you can read the C2 traffic |
BootReceiver exported | Starts on boot with no user action needed — persistence |
MonitorService | A background service named "Monitor" is a strong signal |
allowBackup="true" | The app's data, including any stolen material, can be pulled with adb backup |
Sign in to continue
5 more sections are for signed-in members. It is free: sign in with Google.