Skip to content

69 — Malware Analysis: References

Annotated. Every entry says why you would open it, not merely that it exists.

This chapter cites no real malware family as evidence, quotes no hash of a real sample, and invents no indicator of compromise. Where a technique is described, it is described generically and the reader is pointed at the class of public reporting that covers it. Vendor naming and attribution are commercial products; two vendors will give the same code two names.


1. Frameworks and taxonomies

Resource Why
MITRE ATT&CK for Mobile The technique taxonomy this chapter maps to in §5.7. Organised around TTPs rather than indicators, which is exactly right for Android: a TTP survives repackaging and a hash does not. Identifiers are revised, so consult the live matrix rather than quoting an ID from a blog post
MITRE ATT&CK — Mobile Tactics The tactic list: Initial Access, Execution, Persistence, Privilege Escalation, Defense Evasion, Credential Access, Discovery, Lateral Movement, Collection, Command and Control, Exfiltration, Impact. Use these as the section headings of a behavioural write-up
OWASP MASVS The control categories. MASVS-PLATFORM is where almost all of section 3 lands; MASVS-RESILIENCE covers section 3.17
OWASP MASTG The testing procedures. Its platform-interaction and resilience tests are the closest published analogue to sections 8 and 7
OWASP Mobile Top 10 Useful as a report vocabulary; less useful as an analysis method

2. AOSP source paths

Paths, not line numbers. Paths are stable across releases; line numbers are not.

Path What is there
frameworks/base/core/java/android/app/ActivityThread.java handleBindApplication() → makeApplication() → installContentProviders() → callApplicationOnCreate(). The ordering guarantee that makes provider persistence work, in one method
frameworks/base/core/java/android/content/ContentProvider.java attachInfo(), which is what actually calls onCreate()
frameworks/base/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java Reads Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES and binds each named component. The binding is why the system keeps the process alive
frameworks/base/services/accessibility/java/com/android/server/accessibility/AccessibilityServiceConnection.java The per-service connection; where the capability flags are enforced per call
frameworks/base/core/java/android/accessibilityservice/AccessibilityServiceInfo.java Parses the <accessibility-service> XML: canRetrieveWindowContent, canPerformGestures, packageNames, accessibilityEventTypes. Read this to know what the descriptor attributes actually do
frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java NotificationListeners, the bind registry, and the fan-out of every posted notification to every bound listener
frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java addWindow() and the window-type validation for TYPE_APPLICATION_OVERLAY
frameworks/base/services/core/java/com/android/server/appop/AppOpsService.java OP_SYSTEM_ALERT_WINDOW. The app-op model is why overlay access is revocable without uninstalling
frameworks/base/core/java/android/view/View.java onFilterTouchEventForSecurity() — the obscured-touch protection, and confirm that it is opt-in per view
frameworks/base/services/core/java/com/android/server/pm/PackageInstallerService.java createSession() records the calling UID. This is why initiatingPackageName is hard to forge and installerPackageName is not
frameworks/base/core/java/android/content/pm/InstallSourceInfo.java The installing / initiating / originating triple returned by getInstallSourceInfo()
frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Active admins, and the uninstall refusal that gives device admin its persistence property
frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java Broadcast dispatch, the protected-broadcast list, and the STOPPED-state rule that forces droppers to ship a launcher icon
frameworks/base/core/java/android/app/job/JobScheduler.java and services/core/java/com/android/server/job/ The persistence arm that survives am force-stop
bionic/linker/linker.cpp soinfo::call_constructors() — DT_INIT then DT_INIT_ARRAY, inside dlopen, before it returns
art/runtime/jni/java_vm_ext.cc JavaVMExt::LoadNativeLibrary() — dlopen, and only then dlsym("JNI_OnLoad"). Read this beside linker.cpp and the spawn-gating requirement becomes obvious
art/runtime/jni/jni_internal.cc RegisterNatives — the call that destroys the Java-to-native mapping
frameworks/base/core/java/android/app/admin/DeviceAdminReceiver.java onEnabled, onDisableRequested — the callback ransomware used as a trigger

3. Official Android documentation

Resource Why
AccessibilityService The API reference. Read the flags section, not the overview
Accessibility service configuration What each descriptor attribute means, from the platform's own documentation
NotificationListenerService Note cancelNotification and cancelAllNotifications — the calls that turn reading into suppressing
Device administration overview Including the deprecation notices, which are the story
Package visibility filtering The API 30 change that made target enumeration a declared capability
Background execution limits API 26. Why watchdogs need a foreground service
Foreground service types are required API 34. Why the declared type is now a checkable claim
Restricted settings The API 33 mitigation, from the user-facing side. Read it to understand exactly what a social engineer has to talk somebody through
APK Signature Scheme v2 The signing block layout apk-triage.py parses
APK Signature Scheme v3 Signing certificate rotation and lineage. Chapter 38 measured 6 of 198 installed packages carrying a lineage, so any self-verification reading signatures[0] is wrong on real devices
Play Protect What the platform's own scanner does, and where its coverage ends
Android Security Bulletins The authoritative CVE source for platform issues. Cite from here, never from memory

4. Standards

Resource Why
RFC 2606 — Reserved Top Level DNS Names Why every indicator in this chapter is under .invalid: the TLD is reserved permanently and can never resolve
RFC 6761 — Special-Use Domain Names Formalises the same reservations in the IANA registry
FIPS 197 — AES The specification config-decrypt.py's AES implementation is checkable against, line by line. Its known-answer vectors are what verified it
RFC 5280 — X.509 The certificate structure the triage tool's minimal DER parser walks
ELF gABI DT_INIT_ARRAY, DT_NEEDED, and the dynamic section layout

5. Where public malware-analysis writeups live

Named as sources, not as attributions. This chapter has not independently verified any specific report and does not cite one as evidence for a specific claim.

Source What it is good for
Vendor threat-intelligence blogs — ESET, Kaspersky, Check Point, Zimperium, Lookout, Cleafy, ThreatFabric, Group-IB The most detailed public Android banking-malware analyses. The technical sections are usually excellent and reproducible
Google's Android Security and Privacy Year in Review Platform-side telemetry and the reasoning behind hardening decisions
Virus Bulletin conference proceedings Long-form, peer-reviewed-ish, and often the first place a technique is described properly
Black Hat / DEF CON / REcon / Botconf archives Tooling and unpacking methodology
Koodous, MalwareBazaar, VirusTotal community Corpus and community annotation. Read the terms before creating an account
Academic: the Pileup paper (IEEE S&P 2014) Privilege escalation through OS updates; still the reference for that class

How to read vendor reporting. Treat it as a primary source about the sample and a secondary source about the actor. The malware naming is a commercial product: two vendors will give the same code two names, and a name in a report is a marketing artefact as much as a technical one. When you cite a report, cite the technique it describes, not the family label it applies.


6. This chapter's own artefacts

File What it is
../scripts/apk-triage.py One pass over an APK answering identity, provenance, capability, persistence, native and loading. Standard library only. Prints signals, never a verdict
../scripts/config-decrypt.py Offline config recovery: layer peeling, DEX key harvesting by shape, AES (CBC/ECB, 128/192/256), repeating-key XOR with crib-dragging and statistical recovery from the ciphertext alone. Includes a FIPS-197-checkable AES so no pip install is needed
../examples/inert-sample/ The teaching sample. Sources only; the APK is built out of tree by build.sh. No payload, no C2, no exfiltration, no evasion
../examples/triage-writeup-inert-sample.md The model write-up, with real measured tool output
../labs/lab-01-first-triage.md Build it, triage it, read every line
../labs/lab-02-config-and-capability.md Recover both configs; adjudicate the capability profile
../labs/lab-03-attribution-and-its-limits.md Full triage ending in your own written analysis
../labs/lab-04-ctf-the-quiet-sample.md CTF

7. Tooling this chapter defers to rather than restaging

Tool Owned by Use it for
manifest-audit.py 32-Manifest The deep manifest audit: exported components, provider grant posture, permission protection levels, the targetSdk version matrix
apk-container-triage.py 10-APK-Internals Container attack classes: duplicate entries, LFH/CDFH divergence, trailing bytes, signing-block smuggling
parse_axml.py 10-APK-Internals The teaching AXML parser; apk-triage.py carries an operational copy and honours the declared attribute stride because of 10's lab
static-sweep.py 52-StaticAnalysis The grep catalogue with confidence scoring and validators. Ranked leads, no verdict
validate-lead.sh 52-StaticAnalysis Turning one lead into evidence or killing it
blindspot-recorder.js 52-StaticAnalysis Hooks registerReceiver, Method.invoke, every class loader, System.loadLibrary and art::JNI::RegisterNatives — the recovery for the mapping a static read cannot get
session-recorder.sh 51-DynamicAnalysis Bracket an exercise window with two device snapshots and report the delta across nine channels
coverage-reporter.py 51-DynamicAnalysis What you actually reached. The denominator must come from the static pass, not from the device
trace-app-startup.js 09-App-Internals Timestamps attachBaseContext, every provider onCreate and Application.onCreate. For a sample, the provider lines are the persistence finding
watch-identity-and-files.js 09-App-Internals Catches naive package-name, installer-attribution and signature checks
so-triage.sh 15-Native-Code Ninety seconds of native triage before any GUI. Works with or without readelf
elf-inspect.py 15-Native-Code The full ELF read, including --init for the constructor array
elf-harden-check.py 15-Native-Code Hardening flags across a whole APK
native-map.js 15-Native-Code Live mapping, exports, GOT slots, and which pages are writable and executable at once — which packers routinely create
frida-classloader-dump.js 40-Obfuscation Catches a packer handing the real DEX to the runtime and writes it to disk
frida-dexdump-lite.js 40-Obfuscation Carves DEX out of process memory, validated against header invariants
frida-string-decryptor.js 40-Obfuscation Hooks String.<init>([B)/([C), so it catches every decryptor regardless of cipher — the answer when the key is derived
annotate-smali-strings.py 40-Obfuscation Writes recovered strings back into the Smali at the call sites that produced them
dump-strings.py 04-Java A full MUTF-8 DEX string extractor, tested against an astral emoji and an embedded NUL. Use it when the strings themselves must be exactly right
dex-diff.py 12-DEX-Internals Index-table diff — is this the same code as that sample?
receiver-surface.py 29-BroadcastReceivers The runtime broadcast surface a manifest reading cannot see (measured at 67–69% invisible)
bypass-triage.py 67-BypassingProtections Enumerating a sample's own anti-analysis before deciding whether to defeat it
device-posture.sh 06-Android-Architecture Record the environment so your own modifications are methodology, not findings

8. Command-line tools

Tool Why
apksigner verify -v --print-certs The authoritative signature check. apk-triage.py parses certificates; it verifies nothing. Always run both
aapt2 dump xmltree --file AndroidManifest.xml The closest host-side approximation of what the platform parses, because aapt2 and the platform share libandroidfw
apktool d Decoded resources and Smali
jadx -d out Decompilation — and count the output tree, not the console summary; chapter 56 measured a 30× under-report
radare2 / rizin, Ghidra, IDA Native disassembly for the JNI_OnLoad table
llvm-nm -D, llvm-readelf ELF symbol and header reads; both ship with the NDK
mitmproxy / Burp Suite C2 interception, once the sample's pinning is defeated
INETSIM / FakeNet-NG Sinkholing egress, so a run cannot reach a live operator
adb Everything device-side. Chapter 60 owns it

Chapter What it gives this one
09-Android-App-Internals Provider startup ordering (measured), installer attribution, forensic artefacts. 09 owns the mechanism; 69 owns the abuse
10-APK-Internals Container structure, signing block, AXML parser-confusion attacks
12-DEX-Internals DEX structure and diffing
15-Native-Code The discipline where native RE is not optional. .init_array, ELF triage
16-JNI RegisterNatives and the mapping blind spot
20-Security-Architecture Why capability abuse is within the model rather than a bypass
21-App-Sandbox How real malware works around the sandbox rather than through it
23-Permissions The grant model every capability here rides on
27-ContentProviders Provider mechanics
29-BroadcastReceivers Protected broadcasts; the 67–69% invisible runtime surface
32-Manifest The deep manifest audit 69 defers to
33-Storage Forensic artefacts, and the 132/132 false-positive measurement
34-Cryptography Cryptography as the attacker's tool: config and payload decryption
35-SSL Trust stores, and the measurement trap in the repository's own test device
36-CertificatePinning Pinning as the attacker's tool: C2 channels you have to open
37-RootDetection Anti-analysis, characterised rather than only defeated
38-TamperDetection Self-integrity checks; the 18-APK measurements; signature rotation
40-Obfuscation Packers, string encryption, runtime DEX loading. The best public unpacking work lives in the malware community
42-R8 What survives minification; the Kotlin metadata false-positive measurement
51-DynamicAnalysis The runtime pipeline, with stage 1 inverted: the device must be disposable
52-StaticAnalysis The static pipeline; the hit/lead/finding discipline; the false-positive arithmetic
53-Frida The instrumentation tool
56-JADX Decompilation, and how it under-reports its own failures
57-Ghidra Native disassembly
60-ADB Every device-side command in this chapter
67-BypassingProtections Defeating a sample's anti-analysis, once you have characterised it
71-OWASP-Mobile MASVS mapping
80-Appendix Report templates and the severity rubric. 69 produces the evidence; 80 formats it

Chapters this one defers to that have since landed — named as directories when 69 was written, and now linked, because they exist: 39-EmulatorDetection, 55-MobSF, 68-ReverseEngineering, 70-VulnerabilityResearch, 75-InterviewQuestions.

66-Instrumentation has since landed as well, and is worth a link rather than a mention here: it is the platform's own supported route into an app's process, and malware reaches for it in exactly one shape — a repackaged application, where the author already re-signs the APK and a co-signed test APK therefore costs nothing. Its measured property that matters for triage is the noise floor: no server binary, no injected library in /proc/<pid>/maps, nothing under /data/adb. What it does leave is a visible installed package and two unsuppressable system_server log lines.

Still referenced as directories rather than as links: 72-RealWorldFindings, 74-CaseStudies.