0% found this document useful (0 votes)
54 views72 pages

Mobile App Reverse Engineering Guide

This document summarizes steps for reversing Android apps, including static analysis, dynamic analysis, and tampering with the app. Static analysis involves decompiling the app's APK file to view code and resources. Dynamic analysis uses a network sniffer like Charles Proxy to observe runtime behavior and network requests. Tampering attempts to bypass protections like certificate pinning by repackaging the app with modified code and resources. The document also provides suggestions for developers to harden apps against reversal, such as obfuscation, native code usage, and detection of rooting/debugging tools.

Uploaded by

jose
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views72 pages

Mobile App Reverse Engineering Guide

This document summarizes steps for reversing Android apps, including static analysis, dynamic analysis, and tampering with the app. Static analysis involves decompiling the app's APK file to view code and resources. Dynamic analysis uses a network sniffer like Charles Proxy to observe runtime behavior and network requests. Tampering attempts to bypass protections like certificate pinning by repackaging the app with modified code and resources. The document also provides suggestions for developers to harden apps against reversal, such as obfuscation, native code usage, and detection of rooting/debugging tools.

Uploaded by

jose
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Reversing Android Apps

Marc Obrador
Lead Architect @ Build38

Barcelona
marc@[Link]
@marcobrador
/in/marc-obrador
) !
EU
e
th
( in
al
eg
ill
Source: [Link]

’s
It
Josep Bernad Albert Sunyer
iOS UI
Artà is in Mallorca

ABF takes place


(usually) in June

COVID-19 pushed it to
…?
Get to know the app
Step 0
Get to know
the app
Get to know
the app
Get to know
the app
Get to know
the app
Static Analysis
Step 1
Static Analysis
Getting the APK
Decompiling the app

[Link]

$ brew install apktool


Decompiling
the app
Let’s keep
looking
around
Wait… “discount
codes”?
App users get a
discount for
events
Let’s take a closer look…
HTTP Basic Authorisation =
Base64(“username:password”)
HTTP Basic Authorisation =
Base64(“username:password”)

username = “string1” xor “string2”


pasword = “string3” xor “string2”
Protecting against static analysis

ProGuard is a good start… for regular apps


• It’s just method renaming and code shrinking
• Tools for reversing ProGuard exist: [Link]

Other (paid) alternatives exist for obfuscation

Writing sensitve code in native (NDK) is a good idea


Dynamic Analysis
Step 2
Dynamic Analysis
Dynamic Analysis
Network Sniffing
a.k.a MITM
Network Sniffing

[Link]
Setting Up
Charles
Proxy
Setting Up
Charles
Proxy
Setting Up
Charles
Proxy
First
attempt…
First attempt…
Setting Up Charles Proxy
Setting Up
Charles
Proxy
Let’s try
again…
Protecting against dynamic analysis

• Implement Root/Debugger/Emulator/Hooking Framework detection

• Use certificate pinning

• Try to detect app tampering


Using Certificate Pinning

Source: [Link]
Tampering with the App
Step 3
Assuming the app implemented
Certificate Pinning…
$ adb install “Downloads/Artà Beer Festival_v1.2.5_apkpure.[Link]”
Performing Streamed Install
Success
$ adb shell am start [Link]/.SplashActivity
Starting: Intent { act=[Link] cat=[[Link]
.LAUNCHER] cmp=[Link]/.SplashActivity }
Let’s try to remove it
Time to give it a try!
Preventing Repackaging
Looks like we
are done here
This code can be
removed, too!
Closing Thoughts
Thank you!

You might also like