Vampirism and the Donut Economy (Document)
Presented by: Christopher Crowley
PresentationThe "Vampirism and the Donut Economy" document presents a comprehensive overview of mobile device security, focusing on Android and iOS devices. The document discusses the mobile attack surface, including hardware, operating systems, and installed applications, as well as various types of threats, such as malware, social engineering, and data breaches. It also delves into the methodology for assessing mobile apps, covering behavioral, automated, manipulation, and static analysis techniques, and highlights the importance of understanding the code behind the app through decompilation and simplification tools.
Full Transcript / Content
--- Page 1 ---
Vampirism and the
Donut Economy
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 1
1
--- Page 2 ---
Christopher Crowley
- Background: root on (Ultrix/VMS)
employer systems at 15 years old
(80s #CYBER)
- Mobile History: blackberry, nokia,
iOS, windows phone, android
- Sectors: Defense, Education, Energy,
Government, Financial, Software
Dev., Telecom…
- Consultant, author of SOC-
Class.com: Security Operations,
Design, Build, Operate. Teaches
SANS: SEC575, SEC511, SEC504
Montance® LLC
2
2
--- Page 3 ---
Mobile attack surface overview
- Defensive mobile talk: https://soc-class.com/pres/ :
- Attack surface is the hardware itself (firmware, etc.)
- multi-homed network connectivity
- including WiFi, and Cellular networks as well as
- multiple interface connectivity opportunities, like
- wired (USB, Lightning) and RF (Bluetooth, NFC)
- plus, the operating System of device, the
- applications installed, and the
- user operating the device.
Montance® LLC
3
3
--- Page 4 ---
Where are the donuts?
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 4
4
--- Page 5 ---
here, have a donut, it’s delicious
- Talk inspired by the not-so-good-for-you habits
created by mobile device (app) use: distraction,
isolation, narcissism, inconsistency
- Further reinforced by your corporate (and
governmental) overlords: marketing, tracking,
eavesdropping (text, call, email, web browsing)
- Perhaps also social / societal manipulation and
influencing geopolitical balance
Montance® LLC
5
5
--- Page 6 ---
Chris’s Opinion
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 6
6
--- Page 7 ---
iOS: superior Security architecture
- My opinion is that the iOS ecosystem is more
secure that Android because it is more restrictive
- Other factors influencing this opinion
- Only about 10 supported hardware devices at any
time, android has about 1,000 supported devices
- Single company (with a restrictive posture) for
hardware, OS, and app (vetting and delivery)
- World’s largest (public) application whitelisting
deployment (2020 stat: ~1.5 billion devices)
Montance® LLC
7
https://9to5mac.com/2020/01/28/apple-hits-1-5-billion-active-devices-with-80-of-
recent-iphones-and-ipads-running-ios-13/
7
--- Page 8 ---
Android: Greater Liberty
- That being said, Android provides more liberty to do what
you want and the responsibility to protect ya’ neck
- There are vendors (Copperhead OS, Silent Circle) who
provide security optimized android phones; out of reach
for most individuals to compile OS on own, but possible
- No single controlling entity provides autonomy for
splinter factions (Amazon, eg) coopting the OS and
rebranding it in their channel; provides resilience and
greater development through the community
- Allows substantial variation & rapid dev in hardware
- Ostensibly open source, not fully OS (binary blobs, eg)
Montance® LLC
8
8
--- Page 9 ---
Apple is Media Co, Google is Advertiser
- My opinion is that Apple went down the path of
restrictive hardware to protect its media
revenue stream interests. Why make a tamper
resistant, encrypted, single use mobile device?
- So users can’t steal music, videos, etc. off of it
- It’s hard for other threats to steal your media, too
- Google’s ecosystem is driven by chasing the
larger market share (75% globally) of eyeballs for
advertisements. Lower cost option for devices.
Montance® LLC
9
https://www.statista.com/statistics/272698/global-market-share-held-by-mobile-
operating-systems-since-2009/
9
--- Page 10 ---
Apps: iOS apps delivered compiled
- iOS applications (digitally signed) compiled
objective-C or swift executables from a single source
which reviews the app before allowing distribution
- Signature ‘exceptions’ for enterprise signing and
developer signing: both are commonly abused by
malware and jailbreak developers because it’s basically
the only way to get code onto the phone initially
- Charlie Miller’s Instastock is a good example of a bypass
through Apple vetting, XCode Ghost is another . XCode
Ghost behaved like an ad library (included as dylib) from
multiple developers in China
Montance® LLC
10
https://www.statista.com/statistics/272698/global-market-share-held-by-mobile-
operating-systems-since-2009/
10
--- Page 11 ---
Apps: Android bytecode
- Android apps digital signature is self-signed by
developer; signature used to protected against
updates from another developer; provides some
identity tracking, but no single central authority
- Android apps can be installed from anywhere:
better limitation in current Android (non-Play
store authorization on a per-app basis)
- App is NDK (binary compiled) and SDK “Java™”
(pls don’t sue me Oracle) or Kotlin bytecode
Montance® LLC
11
https://www.statista.com/statistics/272698/global-market-share-held-by-mobile-
operating-systems-since-2009/
11
--- Page 12 ---
Apps: Android bytecode
- Effectively more complicated for Google’s security
team to assess apps prior to allowing into Play store
- See Maddie Stone’s “Wedding Cake” talk BH18
- Developer Policies somewhat more permissive
- Less expensive for (malware) developers to have
multiple accounts and shift personas
- Large number of system apps to deliver functionality,
many of which can’t be uninstalled or disabled by
user, which have same attack surface I’ll discuss
Montance® LLC
12
https://i.blackhat.com/us-18/Thu-August-9/us-18-Stone-Unpacking-The-Packed-
Unpacker .pdf
https://support.google.com/googleplay/android-developer/answer/9904549
12
--- Page 13 ---
Let’s Look on the Bright Side
Donuts are actually delicious, after all…
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 13
13
--- Page 14 ---
Threats - taxonomy (B$,M$,T$)
$B
$M
$T
Montance® LLC
14
- This adapted figure (ES.1 Threat
Taxonomy) from US DOD
Defense Science Board report
Resilient Military Systems…
- groups threats into ten, million,
and billion dollar level resource
capability clubs where:
- $T: reuse vulnerabilities,
- $M: discover vulnerabilities,
- $B: create vulnerabilities.
https://nsarchive2.gwu.edu/NSAEBB/NSAEBB424/docs/Cyber-081.pdf
14
--- Page 15 ---
Not this talk’s focus: $B
- Talk is on individual efforts (not against $B). But,
- If you need individual help with that, remain
hypervigilant and leverage Citizen Labs
https://citizenlab.ca/ resources
- ?q=Mansoor+Pegasus+Citizen+NSO+lookout
- If you help protect a company against the $B,
leverage your country’s public resources and
available threat intel regarding mobile attack TTPs
- If your country is the threat then ?q= “that one
privacy guy VPN comparison” also use Tor/Signal…
Montance® LLC
15
https://citizenlab.ca/2016/08/million-dollar-dissident-iphone-zero-day-nso-group-
uae/
15
--- Page 16 ---
So What Can I do About It?
Don’t be like me: eat one donut, not the whole dozen. That’s why I can’t eat donuts
anymore… As soon as I have one, I will eat all of the donuts until there are none left
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 16
16
--- Page 17 ---
Vigilance and Mobile App Assessment
- All aforementioned actors need to evade
detection all the time in order to continue to
deliver their mobile code to you
- Be vigilant in inspection of mobile devices and
applications running on them
- Substantially larger need for community review
in the android space. Still needed and possible
on iOS, but more difficult
Montance® LLC
17
17
--- Page 18 ---
How Do I Do That?
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 18
18
--- Page 19 ---
assessment procedure
- I’m going to walk through my
assessment suggestions on android
- Parallel actions are available on iOS, a
jailbroken iOS device is very useful
- Thanks to the great work by axi0mX on
checkm8, then the checkra1n developers,
it’s tenable for many people
- Rough analysis sequence: behavioral,
automated tools, manipulation, static
Montance® LLC
19
https://twitter .com/axi0mX/status/1177542201670168576
https://checkra.in/
19
--- Page 20 ---
Execution of Application Assessment
- Technically involved
- Even Apple and Google miss
code included in applications
- XCode Ghost is an example
- Malicious library (with C2)
included at compile time
due to malicious XCode
image from: https://www.fireeye.com/blog/threat-
research/2015/11/xcodeghost_s_a_new.html
20
--- Page 21 ---
Methodology Overcomes Limitations
- Being repeatable and taking great notes is more
important than going fast or getting far
- Every step of the way matters, if you think you
find something, someone else should be able to
reproduce the steps that you took to find it
- Best if you can script the actions, but if you can’t
a concise definition of how to click-click-click is
better than nothing
21
--- Page 22 ---
Assessment Legal Preface
- Consult your legal counsel, I’m not your lawyer
- Usually assessing an application (which was
legally obtained) for suitability of interoperation
within your network is legal
- Do so for networks only where you have written
permission to perform this type of analysis
- If you own the assets and the network…
22
--- Page 23 ---
Permission to Assess Granted
- Montance® LLC now ;)
23
--- Page 24 ---
Pre-existing guidance
- Phenomenal work by OWASP to produce MASVS and
MSTG – use these to guide your actions
- Android App PenTest Guide (AAPG) is a stepwise, tool
specific implementation of MSTG – if you want
concise instructions to follow, go get that and follow it
- It’s got a bunch of holes in it (“TODO” type notes) but
it could be really good guidance or reference
- Take a look at it to see if you know all the tools and
can use it as a script
24
--- Page 25 ---
Virtual Device vs. Phone
- Virtual Device : easier, very low cost to entry, can’t
always use the Play store to get apps (need Play store
image), benefit of snapshots / consistency, already
have root, easy network interception
emulator -http-proxy 127.0.0.1:8080
- Hardware: faster, more costly, no snapshot instance,
better runtime for apps which detect VM, more
realistic modeling of user experience for non-Pixel
(pure play Android) devices, only way to assess some
system and custom apps (Samsung, OnePlus, …)
25
--- Page 26 ---
Virtual Device – Play Store
- Options for virtual devices
with play store in available
Android studio
- May be useful for you in a
couple of circumstances,
definitely for the APK
retrieval for static code
analysis I’ll talk about later
if you’re going to use a
virtual device
26
--- Page 27 ---
Behavioral - Network
behavioral, automated tools, manipulation, static
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 27
27
--- Page 28 ---
Methodology – Behaviors - Network
- Easiest to perform without specialized tools
- Put the mobile device on a network, and monitor the
communication through a laptop
- Challenge – TLS protected communication
- Challenge – interpreting hidden or obfuscated data
- Challenge – application has a trigger condition which
isn’t met in your testing, obscuring some undesirable
but present (and not detected by you) behavior
28
--- Page 29 ---
Methodology – Network
- Physical device two basic options:
- Windows or native linux hosts an access point
- Use a VM on the host, connect a USB wired NIC,
connect a wifi access point and associate device
- My set up is often the latter: snapshot of linux
intercept host – easier (for me) manipulation
and scripting options – ettercap, bettercap, burp,
iptables, CLI manipulation, etc.; snapshot of
windows VM for MS Windows only tools
29
--- Page 30 ---
Methodology – Network –Windows AP
- Use Windows laptop with a USB connected
network card (In this case the card is a ALFA
AWUS 036NHA)
- Configure the USB card as an Access Point
- Built in wireless connection to the internet with
Internet Connection Sharing (ICS) for routing
- Associate mobile device to AP , use tools (burp,
cain, etc.) to monitor / manipulate traffic
30
--- Page 31 ---
Methodology – Network –Windows AP
- Install Burp CA cert into User store of device to
help monitor the TLS communications
- Lets you determine if certificate pinning is in
place, and the data at risk if it is not
- Gives insight into what’s at risk from your use of
access points, your ISP , and Cellular provider
- TLS interception shows what data the apps are
sending back to the DonutOverlords™ for market
research and customer satisfaction, of course
31
--- Page 32 ---
Methodology – Network –Windows AP
- Mobile device <--> WAP <--> laptop w/ ICS enabled <-->
Wireless <--> Internet
- Interface configuration:
- wireless USB - WLAN 2 - set as an access point
- As admin run – (disable wlan the other wireless interface)
netsh wlan set hostednetwork mode=allow
ssid=montance key=itisntreallyaword
netsh wlan start hostednetwork
32
--- Page 33 ---
Methodology – Network – Linux VM
- Kali VM, USB NIC passed to Kali VM
- Connect device to wifi pineapple or any AP
- Run wp4.sh script (My Juiced Up Wifi Pineapple Script
SANS Pentest blog for details on my little tweaks to
make life easy)
https://pen-testing.sans.org/blog/2014/05/07/my-
juiced-up-wifi-pineapple-configurator-script
- Tweaks linux to perform routing and iptables handles
passing HTTP / HTTPS traffic into your proxy
33
--- Page 34 ---
Methodology – Network
- Transparent firewall rules can direct traffic into a proxy
- Make sure you enable transparent proxy in burp (or other)
if you do this to be sure the headers are inspected
- Or device can be configured to use a proxy
34
--- Page 35 ---
Methodology – Network
- Either way, proxy sees (and can modify) non-TLS content
35
--- Page 36 ---
Methodology – Network
- Deal with TLS? Easiest way is add proxy’s certificate
- Burp serves up a .der format file, so convert it
openssl x509 –inform der –outform pem \
–in cacert.der –out cacert.pem
python –m SimpleHTTPServer 9090
- Browse to system, collect cert
(http://172.16.42.42:9090/)
- Install Cert: Settings – Security – “Install from Storage”
- Select “cacert.pem”
36
--- Page 37 ---
Methodology – Network –TLS- rewrite
- TLS continued
- Later Android requires an APK rewrite
- Decompile using apktool
- Edit res/xml/network_security_config.xml
- Recompile
using
apktool
<network-security-config>
<base-config>
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</base-config>
</network-security-config>
37
--- Page 38 ---
Methodology – Network –TLS - magisk
- Another option is to leverage a Magisk (Magic Mask)
module to modify the root trust storage container to
include the certs from the user trust storage container
https://github.com/NVISO-BE/MagiskTrustUserCerts/releases
- Magisk is useful for masking a rooted environment to
keep apps running unaware of the root control
- My opinion about rooted phones: don’t run a rooted
phone as your daily driver. But, my opinion about
taking risks: you’re responsible, do whatever you want
to: don’t hurt yourself or let yourself get hurt
38
--- Page 39 ---
Methodology – Network
- Get “man in the middle”
- Here the cert issuer for
www.google.com is my
Burp Suite CA – “PortSwigger CA”
- Apps vary on how they deal with
this depending on how they’re
programmed
- Cert pinning may be in use
- May require runtime manipulation or app
rewriting to bypass this protection – it’s
good for you if it’s hard to undermine
39
--- Page 40 ---
Methodology – Network
- Additionally, full packet capture (PCAP) via tcpdump,
dumpcap, wireshark, etc. during assessment
40
--- Page 41 ---
Methodology – Network
- You have control of the application while you’re doing
this work. Start with a no action baseline for ~20 min
- Don’t rush, pause ample time between actions to help
to isolate what you’re doing when reviewing
- Record the time of every action you take, use this to
correlate to network activity: go slow and deliberate,
- Search traffic for all (unique) data that you input, also
potentially hashes, we’ll talk about code review next
41
--- Page 42 ---
Methodology – Network
- Wireshark conversations view
42
--- Page 43 ---
Behavioral - Filesystem
behavioral, automated tools, manipulation, static
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 43
43
--- Page 44 ---
Methodology – Filesystem Content
- If you have rooted or jailbroken phone, pull full
filesystem contents: tar, dd, etc.
- If you don’t have root, use adb to pull files, or make a
backup of the phone (or specific app) to review
- Do this before running app, then after, and use diff to
identify which files changed for targeted inspection
- Android adb backup Example:
adb backup -f myfile.ab com.company.package
Note: in my experience, adb backup crashes without filename for single packages
44
--- Page 45 ---
Methodology – Filesystem Content
- Usually an encrypted backup,
need to decrypt the content
- backupdecrypt.pl
- Only through backup version 1
- android-backup-extractor
- abe.jar
- Need to add Java crypto library
to support AES-256 (see abe.jar
README) for instructions to
download library and install
45
--- Page 46 ---
Methodology – Filesystem Content
- java -jar abe.jar unpack myfile.ab decrypted.ab
- tar -xvf decrypted.ab
- Enjoy the volume
of data to inspect!
- Sqlite databases
frequently
encountered
- Not always easy to
review so much data. Protip, be lazy:
sqlite3 app_data.db .dump | grep
46
--- Page 47 ---
Methodology – Filesystem
- Frequently, though not always, data to be
exfiltrated for donut market research is stored
on the filesystem in a database prior to
uploading to the overlord mothership
- You’re looking for traces of information that you
consider sensitive or intrusive: photos, GPS
location, contacts, messages, typed content,
voice clips
47
--- Page 48 ---
Automated Tools
behavioral, automated tools, manipulation, static
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 48
48
--- Page 49 ---
MobSF – Automated
- https://opensecurity.in/ MobSF provides an
dockerized static code analysis Android and iOS
capability with quality assessment reports
- Non-docker version provides additional
automated runtime analysis module
- Extensive documentation and training:
https://github.com/MobSF/Mobile-Security-
Framework-MobSF
49
--- Page 50 ---
Automated - Others
- Androwarn:
https://github.com/maaaaz/androwarn
- Qark: https://github.com/linkedin/qark/
50
--- Page 51 ---
Runtime Manipulation
behavioral, automated tools, manipulation, static
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 51
51
--- Page 52 ---
Methodology – Inter-process Communication
- Android – use of
“intents” between and
within apps for IPC
- Android components:
- Activities
- Services
- Content Providers
- Broadcast Receiver
- iOS – chroot (sandbox) with
minor exceptions for data
sharing between apps
- Document provider (shares
with other apps)
- Document picker (can
import)
- Action extension
- Custom keyboard
- Also, URL handlers such as
“twitter://”
52
--- Page 53 ---
Methodology – Inter-process Communication
- Assessing the IPC is involved in both platforms
- Drozer (thanks, f-secure!) is very helpful for this on Android
- iOS no automated tool yet to help with exploration of IPC
- Concern of action extension for exposure of app to active content
returned into application context
- Challenge is time, and exploring potential content provided
- Look for crashes when passing no data to other activities in
apps, suggest inadequate taint checking and data
verification, then look for abuse opportunities
- Weak interconnections will be abused by donut overlords
53
--- Page 54 ---
IPC - Drozer
- Install Drozer application on Android (root not required)
- In this case, I’m using adb based connection:
adb forward tcp:31415 tcp:31415
drozer console connect
- Drozer has lots of capability to operate at runtime, only
scratching the surface here
- Needs knowledgeable user, but this is trainable / learnable
- Also helpful to dip into static code analysis paired with this
behavioral analysis
54
--- Page 55 ---
IPC - Drozer
- See the attack surface:
run app.package.attacksurface com.ovelin.guitartuna
- See the activities:
run app.activity.info
com.ovelin.guitartuna
55
--- Page 56 ---
IPC - Drozer
- See the Activities (a user interface screen):
run app.activity.info
com.ovelin.guitartuna
56
--- Page 57 ---
IPC – “Extras”
- Can now go look in the code (probably easiest with
jadx-gui) to see if any of the Activities that accept
“extras” – with the inter process communication
- If so, there is an opportunity for an external
application to communicate with this app, there’s an
opportunity for abuse
- Recent example attack on android was intent to
trigger camera to take photo
57
--- Page 58 ---
Runtime – Frida
- Awesome and likely most popular runtime
manipulation tool https://frida.re
- Requires some programming knowledge,
application behavior insight, useful to have a
little android development knowledge
- often requires some static code analysis to
determine application capabilities to manipulate
- Unrooted and rooted (more powerful) options
all Rs reversed?
58
--- Page 59 ---
Runtime - ARTist
- I love this idea, it’s not the most popular
tool, but is an elegant solution
- Replace the dex2oat compilation tool
(requires rooted device) and instrument the
elf executable, thereby bypassing code
modification
checks
- Schranz BH18
https://ieeexplore.ieee.org/abstract/document/7961998
https://i.blackhat.com/us-18/Thu-August-9/us-18-Schranz-ARTist-A-Novel-
Instrumentation-Framework-for-Reversing-and-Analyzing-Android-Apps-and-the-
Middleware-wp.pdf
https://i.blackhat.com/us-18/Thu-August-9/us-18-Schranz-ARTist-A-Novel-
Instrumentation-Framework-for-Reversing-and-Analyzing-Android-Apps-and-the-
Middleware.pdf
59
--- Page 60 ---
Other Runtime
- Needle (f-secure):
https://github.com/FSecureLABS/needle
- Objection (sensepost – uses Frida):
https://github.com/sensepost/objection
- XPosed, Cydia Substrate
- And more tools:
https://github.com/tanprathan/MobileApp-Pentest-
Cheatsheet
60
--- Page 61 ---
Code
behavioral, automated tools, manipulation, static
Copyright 2020 Montance® LLC - All
Rights Reserved. All Wrongs Reversed? SOC-Class.com || Montance® LLC 61
61
--- Page 62 ---
Methodology – Code Assessment
- By reviewing the code, there is an opportunity to
see more than the behavior of the app during
your observation
- You can (maybe) see the things the application is
programmed to do in the present code
- More complex than network or filesystem
- Requires tools to decompile the code, and ability
to read the code. Both learnable, let’s go.
62
--- Page 63 ---
Acquire Application to Assess
- Android – a couple of options
- Install app, use ES FileExplorer to backup apk (my preference)
- RealAPK Leecher to pull from Play store
- Download from internet
- adb includes .apk with appropriate option (I don’t like the naming)
- iOS
- Must have a jailbroken phone to extract application
- If Jailbroken phone: collect (encrypted) executable from within the
filesystem install directory
- Better to use runtime decryption with gdb or dump_decrypted for
subsequent binary analysis: disassemble in ida, hopper, ghidra,…
63
--- Page 64 ---
Acquire Application to Assess
- Root not required!
- Using ES File Explorer, go to “App” Section
- Long press the app of interest. Once
selected, choose “backup”
- Get the file from the device (I used adb
with a USB connection)
adb pull /sdcard/backups/GuitarTuna_4.0.2.apk
- We now have the application to assess
- APK files are just zip files
64
--- Page 65 ---
Unzip and View Manifest
- Since the Android app is just a zip file, we can unzip it
- Make a copy in a sub directory (original stays safe)
- Unzip file using 7-zip, or any zip utility
- (binary) AndroidManifest.xml declares permissions
java –jar AXMLPrinter2.jar AndroidManifest.xml | more
- AndroidManifest also declares Activities
(windows / interfaces), ContentProviders,
Receivers, Services, and Intents (IPC)
- These are components of Android Apps
65
--- Page 66 ---
Unzip and View Manifest
- We see the permissions
declared, and have an
idea of what the app
can do
- The Manifest is long,
declares several things
- In this app, we see
multiple permissions
and a lot of Facebook
integration
(not pictured)
66
--- Page 67 ---
Decompiled Code
- With some understanding of the behavior and the permissions, we
might want to see in detail what the program does
- There are multiple decompilation tools (dex2jar, Procyon, jad-x
bytecodeviewer)
- Jad-X is an easy and free one – providing decompiled Java that is
readable directly from the .apk
- bytecodeviewer is useful: shows multiple decompilers side-by-side
- Others: JEB ($), dex2jar/JD-GUI
- In this app, I reviewed
the facebook integration, as
well as the billing information
67
--- Page 68 ---
Obfuscated Code
- Tools to obfuscate the code: Dexguard, Proguard,
DexProtector
- Developer defined methods and variables only
- Simplify can help here – removes dead / excessive code
private String a(String str, String str2, Boolean bool) {
int length = str.length() / 2;
int length2 = str2.length() / 2;
this.b[0] = str.substring(0, length);
this.b[1] = str.substring(length);
this.c[0] = str2.substring(0, length2);
this.c[1] = str2.substring(length2);
return bool.booleanValue() ? this.b[1] + this.c[0] + this.b[0] +
this.c[1] : "";
}
Jadx Before Simplify
private String a(String str, String str2, Boolean bool) {
return bool.booleanValue() ? this.b[1] + this.c[0] + this.b[0] +
this.c[1] : "";
}
Jadx After Simplify
68
--- Page 69 ---
Obfuscated Code (2)
- Read the code, refactor the
code, rename the code
- JEB (commercial tool) lets you
do that right in the tool
- Cheap way:
- jad-x decompile at command line
- open project in android studio
- Read code, refactor methods and variables (globally
renames)
- Joshua Wright (@joswr1ght) great webcast on this
69
--- Page 70 ---
Methodology – Tools
- Tools to be able to do this work; still extensive manual work
- https://bit.ly/crow-gmob has an old tool list (Yes, I suck :p)
- https://github.com/tanprathan/MobileApp-Pentest-
Cheatsheet
70
--- Page 71 ---
Methodology – Distributions
- There are some pre-built distributions which give you
an environment to work from
- Santoku Linux (from NowSecure)
- Kali Linux
- MobiSec (SecureIdeas)
- Androlab (androl4b)
- Give you the benefit of the tools already set up
- Probably doesn’t have everything you need, but a
good start
71
--- Page 72 ---
Exercise v Donuts – Equity Achieved?
- For app assessment, maintain the program
through updates to approved applications
- Improve analytical capability
- Keep up to date on attacker trends
- Enhance personal security posture, uninstall or
disabled those bad for you donutApps™
- Develop exercises for yourself and share
techniques with others
72
--- Page 73 ---
@CCrowMontance
- This slide deck available:
https://mgt517.com/cell
as are many other decks
up one folder in Public.
- Stay safe, assess and use
your mobile devices with
an informed view of the
benefits and risks…
- I truly want to hear your
thoughts on this.
You Tweet?
Montance® LLC
73
73
Featured Video Clip
"The idea of being always connected is an incredible enabler for a lot of people. And at the same time, it creates circumstances of distraction from focus, human experience, isolation, human experience, and expression of narcissism."
Related Q&A
- Q: OverviewA: Presentation details for Vampirism and the Donut Economy