NN2022 - Analisis Malware en Android
NN2022 - Analisis Malware en Android
NN2022 - Analisis Malware en Android
workshop
Laura Garcia
Helia Estevez
About us
@lain7z @pusha2popa
Index
Linux kernel
Android kernel is
based on Linux kernel
(LTS).
Platform Architecture | Android Developers
Google Play Protect
Report PHA: https://developers.google.com/android/play-protect/pha-reporting
https://developers.google.com/android/play-protect/cloud-based-protections https://developers.google.com/android/play-protect
Android manifest APKs
Main package
Other packages
Resources
Android Manifest
● Application components
● Permissions
● Hardware and software requirements
https://developer.android.com/reference/android/Manifest.permission
Android components
● Launch an activity
● Launch a service
● Share information
https://developer.android.com/reference/android/content/Intent
Definition of Malware (PHA)
PHA
Potentially Harmful Applications (PHAs) are apps that could
put users, user data, or devices at risk
NOT PHA
SPYWARE ROOTING
Collect PII, read
permissions, no Exploits a vuln,
disclosure root the device
BACKDOOR SPAM
Request excessive
Send msg to a list
permissions,
of contacts, may
listen for cmd
include malicious
from C2 and
link
perform actions
STATIC DYNAMIC
Examines the file for
Analyze its behavior
signs of malicious
during run time
intent
● Jadx-GUI ● Device/Emulator
● APKTool ● Traffic inspection
● Ghidra ● ADB
● Androguard ● Frida
● Objection
Koodous
Automated APKLab.io
Static analysis
Java DEX
code files
d8 https://github.com/skylot/jadx
Static analysis
Ghidra ARM disassembler/decompiler functionality to statically analyze the native libraries
https://ghidra-sre.org/
Dynamic analysis
● Testing device or Emulator
● Traffic inspection (Burp Suite)
● Android Debug Bridge (ADB)
● Frida
● Objection
Methodology
Network
Entry Points
activity
What do the Find the C2
services Inspect HTTP(S)
triggered by traffic for PII
receivers data
API calls and
Permissions Exfiltration
keywords
Make sense Search code for
regarding the Does the app
common
functionality of collect PII,
keywords and
the app secrets, keys,
APIs
etc.
Let’s play!
● Contact list
● Photos or other files from the SD
● A lot of READ permissions card or that aren't owned by the app
(READ_CONTACT, READ_SMS, ● Content from user email
READ_CALL_LOG, ● Call log
RECORD_AUDIO, ● SMS log
READ_CALENDAR…) ● Web history or browser bookmarks
● Collects PII of the default browser
● No user disclosure ● Information from the /data/
directories of other apps.
BACKDOOR
Code that allows the execution of unwanted, potentially harmful, remote-controlled operations on
a device.
SIGNALS
SIGNALS
SIGNALS
ic_launcher ic_launcher_alt
Persistence in code
Backdoor behaviour
Dynamic analysis
PHISHING
Code that pretends to come from a trustworthy source, requests a user's authentication credentials
or billing information, and sends the data to a third-party
SIGNALS
XMPMetaData class exfiltrates the seed phrase in the body parameter of the HTTP Request
Static analysis
SIGNALS
SIGNALS
SIGNALS
https://github.com/strazzere/android-unpacke
https://gchq.github.io/CyberChef/ r/tree/master/native-unpacker
Packers
Android Packers are able to encrypt an original classes.dex file, use an ELF binary to decrypt the
dex file to memory at runtime, and then execute via DexClassLoader.
FRIDA-DEXDump Frida script that hooks on an application and dumps dex files from memory.
Dynamic Code Loading (DCL)
DCL allows an app to loads code (.DEX, JAR or APK) that can be retrieved from a remote location
and executed at runtime. DCL is not permitted in Google Play.
Dynamic Code Loading (DCL)
Sample 4