SlideShare a Scribd company logo
1 of 27
Download to read offline
© Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
Episode III
ATTACK OF THE CODE
© Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
Episode II
RETURN OF THE
NETWORK/BACK-END
Episode I
THE FORENSIC
MENACE
Episode III
ATTACK OF
THE CODE
© Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information.
Jake Van Dyke
Mobile Security Researcher | NowSecure
Michael Krueger
Solutions Engineer | NowSecure
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Connect with NowSecure
Twitter: @NowSecureMobile
—
Subscribe to #MobSec5, blog updates, and more:
https://www.nowsecure.com/go/subscribe
Our weekly mobile security news digest
—
RSA Conference 2017: Visit us at booth N3334
And save a seat for NowSecure CEO Andrew Hoog’s conference talk:
“How Android and iOS Security Enhancements Complicate Threat Detection”
Thursday, February 16 or Friday, February 17
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Contents
● What is reverse engineering and source code analysis?
● How to do it and recommended tools
● Android app analysis example
● iOS app analysis example
● Questions
© Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
Mobile
forensics &
data recovery
Network, web
services, and
API testing
Server-side
penetration
testing
Reverse
engineering &
code analysis
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
What does it mean to reverse engineer an app?
What is reverse engineering?
Taking executable code (not human readable), and
translating it into something that’s easier to understand. It
also involves disassembling code into its component parts
(e.g., classes, libraries, scripts, etc.).
What’s the purpose?
● Analyzing an app’s code
● Identifying vulnerabilities
● Finding hardcoded sensitive data
● Analyzing malware
● Modifying an app’s functionality
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Executable code compared to disassembled code
Executable code Same code disassembled
(by all appearances random junk) (something that starts to make some sense)
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Why reverse engineer an app you developed?
Know what’s exposed
if a third party
reverse engineers
your app
Find hard-coded
API keys, credentials,
etc. that make
you vulnerable
Ensure debugging
information
is stripped
from binaries
Verify that
your toolchain
built your
code properly
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Why reverse engineer an app someone else developed?
Clients pay you to
assess the security of
their mobile apps
(see previous slide)
To make sure an app
is secure for your own
personal use
To participate in bug
bounty programs
offered by a vendor
To learn
and practice
reverse engineering
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Reverse engineering answers questions such as:
● Can you tamper with the app?
● Can you modify the app during runtime?
● Does the app allow you to pull it from a device, re-sign it, and re-install it?
○ Can you also modify the app’s main executable?
○ Can you also modify supplementary files like scripts and native libraries?
● What can you see as a result of hooking APIs?
○ Filesystem
○ Cryptography—dump keys, initialization vectors (IVs), identify cipher, dump the decrypted blob
○ Network—what servers and IP addresses does the app talk to?
○ Observe the app as it writes files or transmits data—is interesting/private data leaked?
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Reverse engineering focus in the OWASP Mobile Top 10
Read more: “Building blocks for secure mobile development: Testing for the OWASP Mobile Top 10”
Draft
(release candidate)
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Specific vulnerabilities identified with reverse engineering
● Insecure network communication / sensitive data leaking over the network
● Interprocess communication (IPC) issues
○ Relevant to Android apps (iOS apps don’t really talk to one another)
○ Content providers with directory traversal or SQLi vulns
● Hard-coded encryption keys
● AES with null initialization vector (IV)
● Helpful logging is disabled at runtime
○ But logging statements still available during static analysis
○ Can be used to determine names for classes and variables
○ Common in Java
○ Common in C, C++, Obj-C via non-standard toolchain (bootloaders and hypervisors)
● Logic flaws or easily circumvented security
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
A full suite of mobile tools (including most of these): Santoku Linux
Good reverse engineering tools
APKTool
For reverse engineering third party, closed, binary Android apps. Decodes resources to nearly
original form and rebuilds them after making some modifications.
dex2jar Suite of utilities for working with the classes.dex file.
jd-gui Standalone graphical utility that displays Java source code from “.class” files.
Frida
Dynamic instrumentation framework that injects JavaScript and explores native apps on multiple
platforms, including mobile platforms.
Radare (R2) Portable reverse engineering framework.
classdump
Command-line utility for examining the Objective-C runtime information stored in Mach-O files.
Also generates declarations for classes, categories, and protocols.
clutch iOS decryption tool.
cycript Allows you to analyze and modify running iOS or OS X apps.
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Using Apktool to get Smali code from an app
$ java -jar apktool_2.2.1.jar d com.tinder_1720.apk
$ cat com.tinder_1720/smali/com/tinder/paywall/PaywallItemInteractor.smali | sed '/^$/d'
.class public Lcom/tinder/paywall/PaywallItemInteractor;
.super Ljava/lang/Object;
.source "PaywallItemInteractor.java"
# direct methods
.method public constructor <init>()V
.locals 0
.prologue
.line 21
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 23
return-void
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Analyzing an Android app’s code
$ dex2jar-2.0/d2j-dex2jar.sh -f -o tinder.jar com.tinder_1720.apk
Using dex2jar, you get a .jar file that can be loaded in jd-gui for decompilation to produce Java code
Reverse Engineering
Native Code
A disassembler takes compiled code (e.g., ELF and
MACH-O files) and displays assembly and flow using
boxes and arrows.
A decompiler tries to generate C code from those
same binary formats.
while ( v13 != v18 )
{
v19[v13] = v15[v13] | v14[v13];
++v13;
}
convert1(&v32, 2);
flipConv(v15);
convert1(v15, 3);
flipConv(v14);
v21 = strlen(v14);
convert1(v14, v21);
convert1(v14, 4);
v22 = (char *)calloc(v30 + n + 1 + v25 + v29 + v13, 1u);
strncpy(v22, v17, n);
strncat(v22, v20, v13);
strncat(v22, v15, v25);
strncat(v22, (const char *)&v32, v30);
strncat(v22, v14, v29);
SHA1_Init((int)&v35);
v23 = strlen(v22);
SHA1_Update((int)&v35, v22, v23);
SHA1_Final((int)&v35, (int)&v33, v24);
dth((int)&v33, (int)&v34);
convert2(&v34, 1);
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Analyzing an iOS app’s code (similar concepts)
1. Get the app from the store
2. Decrypt the app on the device
3. Pull the app from the iOS device
4. Feed it to your disassembler and/or decompiler
iPhone:~ root# Clutch2 -i
Installed apps:
1: Associated Credit Union <com.intuit.mobilebanking03919>
…
iPhone:~ root# Clutch2 -b 1
…
Finished dumping com.intuit.mobilebanking03919 to
/var/tmp/clutch/2734E965-9D88-41BC-830E-7B3E47623E4F
Finished dumping com.intuit.mobilebanking03919 in 2.6 seconds
$ scp -r
root@192.168.2.23:/var/tmp/clutch/2734E965-9D88-41BC-830E-7B3E47623E4F/com.intuit.mobilebanking03919
/ .
Associated Credit Union 100% 7567KB
7.4MB/s 00:00
$ file com.intuit.mobilebanking03919/*
com.intuit.mobilebanking03919/Associated Credit Union: Mach-O universal binary with 2 architectures:
[arm_v7: Mach-O arm_v7 executable] [64-bit architecture=12]
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Disassembled iOS app
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
What Do I Do Next?
The answer is there’s no right answer.
● Dig around
● Look for interesting keywords
● Start at an interesting function and follow the parameters and branches
While you’re digging around, you look for things like the following:
● Logic bugs
● Additional debugging info
● Examine any closed source libraries you may be linking to in your app
● Hardcoded API keys and credentials
● Look in resources for other files that may be included in your .apk accidentally
© Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
Reverse engineering exposes flaws you
might otherwise miss
Reverse engineer your app from the
attacker’s perspective (“black box” testing)
Apply your own creativity/ingenuity for
the best results
© Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute.
Did you miss an episode?
Catch up at https://www.nowsecure.com/webinars/
Episode II
RETURN OF THE
NETWORK/BACK-END
Episode I
THE FORENSIC
MENACE
Episode III
ATTACK OF
THE CODE
Let’s talk
NowSecure
+1 312.878.1100
@NowSecureMobile
www.nowsecure.com
Subscribe to #MobSec5
A digest of the week’s mobile security news that matters
https://www.nowsecure.com/go/subscribe

More Related Content

What's hot

OWASP Mobile Top 10
OWASP Mobile Top 10OWASP Mobile Top 10
OWASP Mobile Top 10NowSecure
 
Top OSS for Mobile AppSec Testing: The Latest on R2 and FRIDA
Top OSS for Mobile AppSec Testing: The Latest on R2 and FRIDATop OSS for Mobile AppSec Testing: The Latest on R2 and FRIDA
Top OSS for Mobile AppSec Testing: The Latest on R2 and FRIDANowSecure
 
Preparing for the inevitable: The mobile incident response playbook
Preparing for the inevitable: The mobile incident response playbookPreparing for the inevitable: The mobile incident response playbook
Preparing for the inevitable: The mobile incident response playbookNowSecure
 
Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013drewz lin
 
Lookout pegasus-android-technical-analysis
Lookout pegasus-android-technical-analysisLookout pegasus-android-technical-analysis
Lookout pegasus-android-technical-analysisAndrey Apuhtin
 
Cyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application ExploitationCyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application ExploitationPrathan Phongthiproek
 
[CB16] Background Story of "Operation neutralizing banking malware" and highl...
[CB16] Background Story of "Operation neutralizing banking malware" and highl...[CB16] Background Story of "Operation neutralizing banking malware" and highl...
[CB16] Background Story of "Operation neutralizing banking malware" and highl...CODE BLUE
 
Webinar: Stopping evasive malware - how a cloud sandbox array works
Webinar: Stopping evasive malware - how a cloud sandbox array worksWebinar: Stopping evasive malware - how a cloud sandbox array works
Webinar: Stopping evasive malware - how a cloud sandbox array worksCyren, Inc
 
OWASP Thailand-Beyond the Penetration Testing
OWASP Thailand-Beyond the Penetration TestingOWASP Thailand-Beyond the Penetration Testing
OWASP Thailand-Beyond the Penetration TestingPrathan Phongthiproek
 
Webinar: Insights from Cyren's 2016 cyberthreat report
Webinar: Insights from Cyren's 2016 cyberthreat reportWebinar: Insights from Cyren's 2016 cyberthreat report
Webinar: Insights from Cyren's 2016 cyberthreat reportCyren, Inc
 
Fighting malware - keeping your Intellectual Property safe
Fighting malware -  keeping your Intellectual Property safeFighting malware -  keeping your Intellectual Property safe
Fighting malware - keeping your Intellectual Property safePrayukth K V
 
Xamarin security talk slideshare
Xamarin security talk slideshareXamarin security talk slideshare
Xamarin security talk slideshareMarcus de Wilde
 
Webinar: Why evasive zero day attacks are killing traditional sandboxing
Webinar: Why evasive zero day attacks are killing traditional sandboxingWebinar: Why evasive zero day attacks are killing traditional sandboxing
Webinar: Why evasive zero day attacks are killing traditional sandboxingCyren, Inc
 
Webinar: Is your web security broken? - 10 things you need to know
Webinar: Is your web security broken? - 10 things you need to knowWebinar: Is your web security broken? - 10 things you need to know
Webinar: Is your web security broken? - 10 things you need to knowCyren, Inc
 
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...Minseok(Jacky) Cha
 

What's hot (20)

OWASP Mobile Top 10
OWASP Mobile Top 10OWASP Mobile Top 10
OWASP Mobile Top 10
 
Top OSS for Mobile AppSec Testing: The Latest on R2 and FRIDA
Top OSS for Mobile AppSec Testing: The Latest on R2 and FRIDATop OSS for Mobile AppSec Testing: The Latest on R2 and FRIDA
Top OSS for Mobile AppSec Testing: The Latest on R2 and FRIDA
 
Preparing for the inevitable: The mobile incident response playbook
Preparing for the inevitable: The mobile incident response playbookPreparing for the inevitable: The mobile incident response playbook
Preparing for the inevitable: The mobile incident response playbook
 
Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013
 
Lookout pegasus-android-technical-analysis
Lookout pegasus-android-technical-analysisLookout pegasus-android-technical-analysis
Lookout pegasus-android-technical-analysis
 
OWASP Mobile Top 10 Deep-Dive
OWASP Mobile Top 10 Deep-DiveOWASP Mobile Top 10 Deep-Dive
OWASP Mobile Top 10 Deep-Dive
 
Cyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application ExploitationCyber Kill Chain: Web Application Exploitation
Cyber Kill Chain: Web Application Exploitation
 
Communication security 2021
Communication security 2021Communication security 2021
Communication security 2021
 
[CB16] Background Story of "Operation neutralizing banking malware" and highl...
[CB16] Background Story of "Operation neutralizing banking malware" and highl...[CB16] Background Story of "Operation neutralizing banking malware" and highl...
[CB16] Background Story of "Operation neutralizing banking malware" and highl...
 
Webinar: Stopping evasive malware - how a cloud sandbox array works
Webinar: Stopping evasive malware - how a cloud sandbox array worksWebinar: Stopping evasive malware - how a cloud sandbox array works
Webinar: Stopping evasive malware - how a cloud sandbox array works
 
OWASP Thailand-Beyond the Penetration Testing
OWASP Thailand-Beyond the Penetration TestingOWASP Thailand-Beyond the Penetration Testing
OWASP Thailand-Beyond the Penetration Testing
 
Webinar: Insights from Cyren's 2016 cyberthreat report
Webinar: Insights from Cyren's 2016 cyberthreat reportWebinar: Insights from Cyren's 2016 cyberthreat report
Webinar: Insights from Cyren's 2016 cyberthreat report
 
LASCON 2015
LASCON 2015LASCON 2015
LASCON 2015
 
Fighting malware - keeping your Intellectual Property safe
Fighting malware -  keeping your Intellectual Property safeFighting malware -  keeping your Intellectual Property safe
Fighting malware - keeping your Intellectual Property safe
 
Xamarin security talk slideshare
Xamarin security talk slideshareXamarin security talk slideshare
Xamarin security talk slideshare
 
Webinar: Why evasive zero day attacks are killing traditional sandboxing
Webinar: Why evasive zero day attacks are killing traditional sandboxingWebinar: Why evasive zero day attacks are killing traditional sandboxing
Webinar: Why evasive zero day attacks are killing traditional sandboxing
 
How to assign a CVE to yourself?
How to assign a CVE to yourself?How to assign a CVE to yourself?
How to assign a CVE to yourself?
 
Webinar: Is your web security broken? - 10 things you need to know
Webinar: Is your web security broken? - 10 things you need to knowWebinar: Is your web security broken? - 10 things you need to know
Webinar: Is your web security broken? - 10 things you need to know
 
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
Targeted attacks on major industry sectors in south korea 20171201 cha minseo...
 
Anonymizers
AnonymizersAnonymizers
Anonymizers
 

Similar to Mobile Penetration Testing: Episode III - Attack of the Code

(Isc)² secure johannesburg
(Isc)² secure johannesburg (Isc)² secure johannesburg
(Isc)² secure johannesburg Tunde Ogunkoya
 
Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016
Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016
Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016Subho Halder
 
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...NowSecure
 
Securing a Cloud Migration
Securing a Cloud MigrationSecuring a Cloud Migration
Securing a Cloud MigrationVMware Tanzu
 
Droidcon mobile security
Droidcon   mobile securityDroidcon   mobile security
Droidcon mobile securityJudy Ngure
 
Next Generation Security
Next Generation SecurityNext Generation Security
Next Generation SecurityCisco Canada
 
PROGRAMMING AND CYBER SECURITY
PROGRAMMING AND CYBER SECURITYPROGRAMMING AND CYBER SECURITY
PROGRAMMING AND CYBER SECURITYSylvain Martinez
 
SACON - Automating SecOps (Murray Goldschmidt)
SACON - Automating SecOps (Murray Goldschmidt)SACON - Automating SecOps (Murray Goldschmidt)
SACON - Automating SecOps (Murray Goldschmidt)Priyanka Aash
 
iOS and Android security: Differences you need to know
iOS and Android security: Differences you need to knowiOS and Android security: Differences you need to know
iOS and Android security: Differences you need to knowNowSecure
 
Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...
Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...
Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...Mobodexter
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft
 
Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014
Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014
Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014viaForensics
 
10 Best DevSecOps Tools for 2023
10 Best DevSecOps Tools for 202310 Best DevSecOps Tools for 2023
10 Best DevSecOps Tools for 2023SofiaCarter4
 
RSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of ThingsRSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of ThingsDaniel Miessler
 
5 Mobile App Security MUST-DOs in 2018
5 Mobile App Security MUST-DOs in 20185 Mobile App Security MUST-DOs in 2018
5 Mobile App Security MUST-DOs in 2018NowSecure
 
From Reversing to Exploitation
From Reversing to ExploitationFrom Reversing to Exploitation
From Reversing to ExploitationSatria Ady Pradana
 
Cisco Connect Toronto 2017 - Security Through The Eyes of a Hacker
Cisco Connect Toronto 2017 -  Security Through The Eyes of a HackerCisco Connect Toronto 2017 -  Security Through The Eyes of a Hacker
Cisco Connect Toronto 2017 - Security Through The Eyes of a HackerCisco Canada
 
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming NextThe Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming NextPriyanka Aash
 
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming NextThe Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming NextPriyanka Aash
 

Similar to Mobile Penetration Testing: Episode III - Attack of the Code (20)

(Isc)² secure johannesburg
(Isc)² secure johannesburg (Isc)² secure johannesburg
(Isc)² secure johannesburg
 
Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016
Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016
Outsmarting Hackers before your App gets Hacked - iOS Conf SG 2016
 
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
Mobile App Crashworthiness - Securing Vehicle-to-Device (V2D) Interfaces and ...
 
Securing a Cloud Migration
Securing a Cloud MigrationSecuring a Cloud Migration
Securing a Cloud Migration
 
Securing a Cloud Migration
Securing a Cloud MigrationSecuring a Cloud Migration
Securing a Cloud Migration
 
Droidcon mobile security
Droidcon   mobile securityDroidcon   mobile security
Droidcon mobile security
 
Next Generation Security
Next Generation SecurityNext Generation Security
Next Generation Security
 
PROGRAMMING AND CYBER SECURITY
PROGRAMMING AND CYBER SECURITYPROGRAMMING AND CYBER SECURITY
PROGRAMMING AND CYBER SECURITY
 
SACON - Automating SecOps (Murray Goldschmidt)
SACON - Automating SecOps (Murray Goldschmidt)SACON - Automating SecOps (Murray Goldschmidt)
SACON - Automating SecOps (Murray Goldschmidt)
 
iOS and Android security: Differences you need to know
iOS and Android security: Differences you need to knowiOS and Android security: Differences you need to know
iOS and Android security: Differences you need to know
 
Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...
Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...
Top 10 Software to Detect & Prevent Security Vulnerabilities from BlackHat US...
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft talks: Android Security Threats
Sperasoft talks: Android Security Threats
 
Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014
Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014
Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014
 
10 Best DevSecOps Tools for 2023
10 Best DevSecOps Tools for 202310 Best DevSecOps Tools for 2023
10 Best DevSecOps Tools for 2023
 
RSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of ThingsRSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of Things
 
5 Mobile App Security MUST-DOs in 2018
5 Mobile App Security MUST-DOs in 20185 Mobile App Security MUST-DOs in 2018
5 Mobile App Security MUST-DOs in 2018
 
From Reversing to Exploitation
From Reversing to ExploitationFrom Reversing to Exploitation
From Reversing to Exploitation
 
Cisco Connect Toronto 2017 - Security Through The Eyes of a Hacker
Cisco Connect Toronto 2017 -  Security Through The Eyes of a HackerCisco Connect Toronto 2017 -  Security Through The Eyes of a Hacker
Cisco Connect Toronto 2017 - Security Through The Eyes of a Hacker
 
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming NextThe Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
 
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming NextThe Seven Most Dangerous New Attack Techniques, and What's Coming Next
The Seven Most Dangerous New Attack Techniques, and What's Coming Next
 

More from NowSecure

iOS recon with Radare2
iOS recon with Radare2iOS recon with Radare2
iOS recon with Radare2NowSecure
 
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference ArchitectureFrom Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference ArchitectureNowSecure
 
Android Q & iOS 13 Privacy Enhancements
Android Q & iOS 13 Privacy EnhancementsAndroid Q & iOS 13 Privacy Enhancements
Android Q & iOS 13 Privacy EnhancementsNowSecure
 
Debunking the Top 5 Myths About Mobile AppSec
Debunking the Top 5 Myths About Mobile AppSecDebunking the Top 5 Myths About Mobile AppSec
Debunking the Top 5 Myths About Mobile AppSecNowSecure
 
OSS Tools: Creating a Reverse Engineering Plug-in for r2frida
OSS Tools: Creating a Reverse Engineering Plug-in for r2fridaOSS Tools: Creating a Reverse Engineering Plug-in for r2frida
OSS Tools: Creating a Reverse Engineering Plug-in for r2fridaNowSecure
 
Building a Mobile App Pen Testing Blueprint
Building a Mobile App Pen Testing BlueprintBuilding a Mobile App Pen Testing Blueprint
Building a Mobile App Pen Testing BlueprintNowSecure
 
Mobile App Security Predictions 2019
Mobile App Security Predictions 2019Mobile App Security Predictions 2019
Mobile App Security Predictions 2019NowSecure
 
Jeff's Journey: Best Practices for Securing Mobile App DevOps
Jeff's Journey: Best Practices for Securing Mobile App DevOpsJeff's Journey: Best Practices for Securing Mobile App DevOps
Jeff's Journey: Best Practices for Securing Mobile App DevOpsNowSecure
 
CASE STUDY - Ironclad Messaging & Secure App Dev for Regulated Industries
CASE STUDY - Ironclad Messaging & Secure App Dev for Regulated IndustriesCASE STUDY - Ironclad Messaging & Secure App Dev for Regulated Industries
CASE STUDY - Ironclad Messaging & Secure App Dev for Regulated IndustriesNowSecure
 
A Risk-Based Mobile App Security Testing Strategy
A Risk-Based Mobile App Security Testing StrategyA Risk-Based Mobile App Security Testing Strategy
A Risk-Based Mobile App Security Testing StrategyNowSecure
 
Android P Security Updates: What You Need to Know
Android P Security Updates: What You Need to KnowAndroid P Security Updates: What You Need to Know
Android P Security Updates: What You Need to KnowNowSecure
 
iOS 12 Preview - What You Need To Know
iOS 12 Preview - What You Need To KnowiOS 12 Preview - What You Need To Know
iOS 12 Preview - What You Need To KnowNowSecure
 
5 Tips for Agile Mobile App Security Testing
5 Tips for Agile Mobile App Security Testing5 Tips for Agile Mobile App Security Testing
5 Tips for Agile Mobile App Security TestingNowSecure
 
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?NowSecure
 
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App RiskMobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App RiskNowSecure
 
What attackers know about your mobile apps that you don’t: Banking & FinTech
What attackers know about your mobile apps that you don’t: Banking & FinTechWhat attackers know about your mobile apps that you don’t: Banking & FinTech
What attackers know about your mobile apps that you don’t: Banking & FinTechNowSecure
 
Solving for Compliance: Mobile app security for banking and financial services
Solving for Compliance: Mobile app security for banking and financial servicesSolving for Compliance: Mobile app security for banking and financial services
Solving for Compliance: Mobile app security for banking and financial servicesNowSecure
 
Leaky Mobile Apps: What You Need to Know
Leaky Mobile Apps: What You Need to KnowLeaky Mobile Apps: What You Need to Know
Leaky Mobile Apps: What You Need to KnowNowSecure
 
Vetting Mobile Apps for Corporate Use: Security Essentials
Vetting Mobile Apps for Corporate Use: Security EssentialsVetting Mobile Apps for Corporate Use: Security Essentials
Vetting Mobile Apps for Corporate Use: Security EssentialsNowSecure
 
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...NowSecure
 

More from NowSecure (20)

iOS recon with Radare2
iOS recon with Radare2iOS recon with Radare2
iOS recon with Radare2
 
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference ArchitectureFrom Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
From Tangled Mess to Organized Flow: A Mobile DevSecOps Reference Architecture
 
Android Q & iOS 13 Privacy Enhancements
Android Q & iOS 13 Privacy EnhancementsAndroid Q & iOS 13 Privacy Enhancements
Android Q & iOS 13 Privacy Enhancements
 
Debunking the Top 5 Myths About Mobile AppSec
Debunking the Top 5 Myths About Mobile AppSecDebunking the Top 5 Myths About Mobile AppSec
Debunking the Top 5 Myths About Mobile AppSec
 
OSS Tools: Creating a Reverse Engineering Plug-in for r2frida
OSS Tools: Creating a Reverse Engineering Plug-in for r2fridaOSS Tools: Creating a Reverse Engineering Plug-in for r2frida
OSS Tools: Creating a Reverse Engineering Plug-in for r2frida
 
Building a Mobile App Pen Testing Blueprint
Building a Mobile App Pen Testing BlueprintBuilding a Mobile App Pen Testing Blueprint
Building a Mobile App Pen Testing Blueprint
 
Mobile App Security Predictions 2019
Mobile App Security Predictions 2019Mobile App Security Predictions 2019
Mobile App Security Predictions 2019
 
Jeff's Journey: Best Practices for Securing Mobile App DevOps
Jeff's Journey: Best Practices for Securing Mobile App DevOpsJeff's Journey: Best Practices for Securing Mobile App DevOps
Jeff's Journey: Best Practices for Securing Mobile App DevOps
 
CASE STUDY - Ironclad Messaging & Secure App Dev for Regulated Industries
CASE STUDY - Ironclad Messaging & Secure App Dev for Regulated IndustriesCASE STUDY - Ironclad Messaging & Secure App Dev for Regulated Industries
CASE STUDY - Ironclad Messaging & Secure App Dev for Regulated Industries
 
A Risk-Based Mobile App Security Testing Strategy
A Risk-Based Mobile App Security Testing StrategyA Risk-Based Mobile App Security Testing Strategy
A Risk-Based Mobile App Security Testing Strategy
 
Android P Security Updates: What You Need to Know
Android P Security Updates: What You Need to KnowAndroid P Security Updates: What You Need to Know
Android P Security Updates: What You Need to Know
 
iOS 12 Preview - What You Need To Know
iOS 12 Preview - What You Need To KnowiOS 12 Preview - What You Need To Know
iOS 12 Preview - What You Need To Know
 
5 Tips for Agile Mobile App Security Testing
5 Tips for Agile Mobile App Security Testing5 Tips for Agile Mobile App Security Testing
5 Tips for Agile Mobile App Security Testing
 
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
85% of App Store Apps Fail OWASP Mobile Top 10: Are you exposed?
 
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App RiskMobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
Mobile Apps & Connected Healthcare: Managing 3rd-Party Mobile App Risk
 
What attackers know about your mobile apps that you don’t: Banking & FinTech
What attackers know about your mobile apps that you don’t: Banking & FinTechWhat attackers know about your mobile apps that you don’t: Banking & FinTech
What attackers know about your mobile apps that you don’t: Banking & FinTech
 
Solving for Compliance: Mobile app security for banking and financial services
Solving for Compliance: Mobile app security for banking and financial servicesSolving for Compliance: Mobile app security for banking and financial services
Solving for Compliance: Mobile app security for banking and financial services
 
Leaky Mobile Apps: What You Need to Know
Leaky Mobile Apps: What You Need to KnowLeaky Mobile Apps: What You Need to Know
Leaky Mobile Apps: What You Need to Know
 
Vetting Mobile Apps for Corporate Use: Security Essentials
Vetting Mobile Apps for Corporate Use: Security EssentialsVetting Mobile Apps for Corporate Use: Security Essentials
Vetting Mobile Apps for Corporate Use: Security Essentials
 
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
Cutting out the middleman: Man-in-the-middle attacks and prevention for mobil...
 

Recently uploaded

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

Mobile Penetration Testing: Episode III - Attack of the Code

  • 1. © Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. Episode III ATTACK OF THE CODE
  • 2. © Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. Episode II RETURN OF THE NETWORK/BACK-END Episode I THE FORENSIC MENACE Episode III ATTACK OF THE CODE
  • 3. © Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information. Jake Van Dyke Mobile Security Researcher | NowSecure Michael Krueger Solutions Engineer | NowSecure
  • 4. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Connect with NowSecure Twitter: @NowSecureMobile — Subscribe to #MobSec5, blog updates, and more: https://www.nowsecure.com/go/subscribe Our weekly mobile security news digest — RSA Conference 2017: Visit us at booth N3334 And save a seat for NowSecure CEO Andrew Hoog’s conference talk: “How Android and iOS Security Enhancements Complicate Threat Detection” Thursday, February 16 or Friday, February 17
  • 5. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Contents ● What is reverse engineering and source code analysis? ● How to do it and recommended tools ● Android app analysis example ● iOS app analysis example ● Questions
  • 6. © Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. Mobile forensics & data recovery Network, web services, and API testing Server-side penetration testing Reverse engineering & code analysis
  • 7. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
  • 8. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. What does it mean to reverse engineer an app? What is reverse engineering? Taking executable code (not human readable), and translating it into something that’s easier to understand. It also involves disassembling code into its component parts (e.g., classes, libraries, scripts, etc.). What’s the purpose? ● Analyzing an app’s code ● Identifying vulnerabilities ● Finding hardcoded sensitive data ● Analyzing malware ● Modifying an app’s functionality
  • 9. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Executable code compared to disassembled code Executable code Same code disassembled (by all appearances random junk) (something that starts to make some sense)
  • 10. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Why reverse engineer an app you developed? Know what’s exposed if a third party reverse engineers your app Find hard-coded API keys, credentials, etc. that make you vulnerable Ensure debugging information is stripped from binaries Verify that your toolchain built your code properly
  • 11. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Why reverse engineer an app someone else developed? Clients pay you to assess the security of their mobile apps (see previous slide) To make sure an app is secure for your own personal use To participate in bug bounty programs offered by a vendor To learn and practice reverse engineering
  • 12. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Reverse engineering answers questions such as: ● Can you tamper with the app? ● Can you modify the app during runtime? ● Does the app allow you to pull it from a device, re-sign it, and re-install it? ○ Can you also modify the app’s main executable? ○ Can you also modify supplementary files like scripts and native libraries? ● What can you see as a result of hooking APIs? ○ Filesystem ○ Cryptography—dump keys, initialization vectors (IVs), identify cipher, dump the decrypted blob ○ Network—what servers and IP addresses does the app talk to? ○ Observe the app as it writes files or transmits data—is interesting/private data leaked?
  • 13. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Reverse engineering focus in the OWASP Mobile Top 10 Read more: “Building blocks for secure mobile development: Testing for the OWASP Mobile Top 10” Draft (release candidate)
  • 14. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Specific vulnerabilities identified with reverse engineering ● Insecure network communication / sensitive data leaking over the network ● Interprocess communication (IPC) issues ○ Relevant to Android apps (iOS apps don’t really talk to one another) ○ Content providers with directory traversal or SQLi vulns ● Hard-coded encryption keys ● AES with null initialization vector (IV) ● Helpful logging is disabled at runtime ○ But logging statements still available during static analysis ○ Can be used to determine names for classes and variables ○ Common in Java ○ Common in C, C++, Obj-C via non-standard toolchain (bootloaders and hypervisors) ● Logic flaws or easily circumvented security
  • 15. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. A full suite of mobile tools (including most of these): Santoku Linux Good reverse engineering tools APKTool For reverse engineering third party, closed, binary Android apps. Decodes resources to nearly original form and rebuilds them after making some modifications. dex2jar Suite of utilities for working with the classes.dex file. jd-gui Standalone graphical utility that displays Java source code from “.class” files. Frida Dynamic instrumentation framework that injects JavaScript and explores native apps on multiple platforms, including mobile platforms. Radare (R2) Portable reverse engineering framework. classdump Command-line utility for examining the Objective-C runtime information stored in Mach-O files. Also generates declarations for classes, categories, and protocols. clutch iOS decryption tool. cycript Allows you to analyze and modify running iOS or OS X apps.
  • 16. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
  • 17. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Using Apktool to get Smali code from an app $ java -jar apktool_2.2.1.jar d com.tinder_1720.apk $ cat com.tinder_1720/smali/com/tinder/paywall/PaywallItemInteractor.smali | sed '/^$/d' .class public Lcom/tinder/paywall/PaywallItemInteractor; .super Ljava/lang/Object; .source "PaywallItemInteractor.java" # direct methods .method public constructor <init>()V .locals 0 .prologue .line 21 invoke-direct {p0}, Ljava/lang/Object;-><init>()V .line 23 return-void
  • 18. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Analyzing an Android app’s code $ dex2jar-2.0/d2j-dex2jar.sh -f -o tinder.jar com.tinder_1720.apk Using dex2jar, you get a .jar file that can be loaded in jd-gui for decompilation to produce Java code
  • 19. Reverse Engineering Native Code A disassembler takes compiled code (e.g., ELF and MACH-O files) and displays assembly and flow using boxes and arrows. A decompiler tries to generate C code from those same binary formats. while ( v13 != v18 ) { v19[v13] = v15[v13] | v14[v13]; ++v13; } convert1(&v32, 2); flipConv(v15); convert1(v15, 3); flipConv(v14); v21 = strlen(v14); convert1(v14, v21); convert1(v14, 4); v22 = (char *)calloc(v30 + n + 1 + v25 + v29 + v13, 1u); strncpy(v22, v17, n); strncat(v22, v20, v13); strncat(v22, v15, v25); strncat(v22, (const char *)&v32, v30); strncat(v22, v14, v29); SHA1_Init((int)&v35); v23 = strlen(v22); SHA1_Update((int)&v35, v22, v23); SHA1_Final((int)&v35, (int)&v33, v24); dth((int)&v33, (int)&v34); convert2(&v34, 1);
  • 20. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
  • 21. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Analyzing an iOS app’s code (similar concepts) 1. Get the app from the store 2. Decrypt the app on the device 3. Pull the app from the iOS device 4. Feed it to your disassembler and/or decompiler iPhone:~ root# Clutch2 -i Installed apps: 1: Associated Credit Union <com.intuit.mobilebanking03919> … iPhone:~ root# Clutch2 -b 1 … Finished dumping com.intuit.mobilebanking03919 to /var/tmp/clutch/2734E965-9D88-41BC-830E-7B3E47623E4F Finished dumping com.intuit.mobilebanking03919 in 2.6 seconds $ scp -r root@192.168.2.23:/var/tmp/clutch/2734E965-9D88-41BC-830E-7B3E47623E4F/com.intuit.mobilebanking03919 / . Associated Credit Union 100% 7567KB 7.4MB/s 00:00 $ file com.intuit.mobilebanking03919/* com.intuit.mobilebanking03919/Associated Credit Union: Mach-O universal binary with 2 architectures: [arm_v7: Mach-O arm_v7 executable] [64-bit architecture=12]
  • 22. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Disassembled iOS app
  • 23. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information.
  • 24. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. What Do I Do Next? The answer is there’s no right answer. ● Dig around ● Look for interesting keywords ● Start at an interesting function and follow the parameters and branches While you’re digging around, you look for things like the following: ● Logic bugs ● Additional debugging info ● Examine any closed source libraries you may be linking to in your app ● Hardcoded API keys and credentials ● Look in resources for other files that may be included in your .apk accidentally
  • 25. © Copyright 2017 NowSecure, Inc. All Rights Reserved. Proprietary information. Reverse engineering exposes flaws you might otherwise miss Reverse engineer your app from the attacker’s perspective (“black box” testing) Apply your own creativity/ingenuity for the best results
  • 26. © Copyright 2016 NowSecure, Inc. All Rights Reserved. Proprietary information. Do not distribute. Did you miss an episode? Catch up at https://www.nowsecure.com/webinars/ Episode II RETURN OF THE NETWORK/BACK-END Episode I THE FORENSIC MENACE Episode III ATTACK OF THE CODE
  • 27. Let’s talk NowSecure +1 312.878.1100 @NowSecureMobile www.nowsecure.com Subscribe to #MobSec5 A digest of the week’s mobile security news that matters https://www.nowsecure.com/go/subscribe