SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Copyright © The OWASP Foundation
Permission is granted to copy, distribute and/or modify this document
under the terms of the OWASP License.
The OWASP Foundation
OWASP EU Tour 2013
http://www.owasp.org
Android reverse engineering:
understanding third-party applications
Vicente Aguilera Díaz
OWASP Spain Chapter Leader
Co-founder of Internet Security Auditors
vicente.aguilera@owasp.org
Twitter: @vaguileradiaz
www.vicenteaguileradiaz.com
June 5, 2013. Bucharest (Romania)
OWASP 2
Who I am?
Co-founder of Internet Security Auditors
OWASP Spain Chapter Leader
More info: www.vicenteaguileradiaz.com
VICENTE AGUILERA DÍAZ
OWASP 3
Agenda
Reverse engineering: definition and objectives
Application analysis workflow
Malware identification in Android apps
OWASP 4
Reverse engineering: definition and objectives
Definition
Refers to the process of analyzing a system to
identify its components and their interrelationships,
and create representations of the system in another
form or a higher level of abstraction. [1]
Objetives
The purpose of reverse engineering is not to make
changes or to replicate the system under analysis, but
to understand how it was built.
OWASP 5
Application analysis workflow
Decompress
and
Dissassemble
Rebuild
APK
Original APK
Modified APK
Scope of this presentation
Analyze
Modify
OWASP 6
Application analysis workflow
App Name
APK
/lib
/META-INF
/res
resources.arsc
AndroidManifest.xml
classes.dex
Human-readable XML
AXMLPrinter2.jar
.class
.java
dex2jar
jd-gui
Disasm
Debug
Analyze
Manipulateradare2
Static
Analysis
AndroidManifest.xml
apktool.yml
/assets
/res
/smali
.smali
Static
Analysis
baksmali
Understand
Dexter
grep
apktool
unzip
radare2
SaveAPK
Astro File Manager
Real APK Leecher
OWASP 7
Application analysis workflow
Static Analysis Tools for Android Apps
TOOL DESCRIPTION URL
Dexter Static android application analysis tool https://dexter.bluebox.com/
Androguard Analysis tool (.dex, .apk, .xml, .arsc) https://code.google.com/p/androguard/
smali/baksmali Assembler/disassembler (dex format) https://code.google.com/p/smali/
apktool Decode/rebuild resources https://code.google.com/p/android-apktool/
JD-GUI Java decompiler http://java.decompiler.free.fr/?q=jdgui
Dedexer Disassembler tool for DEX files http://dedexer.sourceforge.net/
AXMLPrinter2.jar Prints XML document from binary XML http://code.google.com/p/android4me/
dex2jar Analysis tool (.dex and .class files) https://code.google.com/p/dex2jar/
apkinspector Analysis functions https://code.google.com/p/apkinspector/
Understand Source code analysis and metrics http://www.scitools.com/
Agnitio Security code review http://sourceforge.net/projects/agnitiotool/
OWASP 8
Application analysis workflow
Others (necessary) tools
TOOL DESCRIPTION URL
Android SDK Tools to build, test, and debug apps http://developer.android.com/sdk/index.html
|--- emulator Virtual mobile device developer.android.com/tools/help/emulator.html
|--- adb Android debug bridge developer.android.com/tools/help/adb.html
A.R.E. Android Reverse Engineering VM https://redmine.honeynet.org/projects/are/wiki
OWASP 9
Malware identification in Android apps
Malware definition
Malware is a piece of code which changes the
behavior of either the operating system kernel or
some security sensitive applications, without a user
consent and in such a way that it is then impossible
to detect those changes using a documented features
of the operating system or the application.[2]
A malware is any malicious code or piece of
software that is designed to perform functions
without the consent of the user.
OWASP 10
Malware identification in Android apps
Techniques for introducing malware
Exploit any vulnerability in the web server hosting the
official store
Use the official store to post apps containing malware
Install not malicious app that, at some point, install
malicious code
Use alternatives[3] to official stores to post apps
containing malware
OWASP 11
Malware identification in Android apps
A practical example
Some considerations
The analyzed app are in the Play Store
The published application does not exploit
(supposedly) any vulnerability, but can contains
malicious code that exploits the user's trust[4]
We will only use static analysis
We will analyze Java source code
We will use the Android Emulator[5]
OWASP 12
Malware identification in Android apps
What do we need?
… and motivation!
OWASP 13
Malware identification in Android apps
Let's see an example…
OWASP 14
Malware identification in Android apps
Identify a possible malicious application
App with unnecessary permissions
 A wallpaper that requires “SEND SMS MESSAGES”
 A calculator that requires “DIRECTLY CALL PHONE NUMBERS”
 …
Google:
 +"send sms messages" +”wallpaper” +site:”play.google.com”
OWASP 15
Malware identification in Android apps
Identify a possible malicious application
Example: “Pipe Mania Droid Lite”
 https://play.google.com/store/apps/details?id=bridge.pipe.lite
OWASP 16
Malware identification in Android apps
Obtaining the APK file
Using the SaveAPK tool (requires IO File Manager)
OWASP 17
Malware identification in Android apps
Decompress the APK file
unzip Pipe Mania Droid Lite.apk
Verify the permissions and receivers
java –jar AXMLPrinter2.jar AndroidManifest.xml > out
OWASP 18
Malware identification in Android apps
Convert from Dalvik EXecutable to Java classes
d2j-dex2jar.sh pipe.apk
Decompile Java classes and download source code
jd-gui pipe-dex2jar.jar
OWASP 19
Malware identification in Android apps
Decompress the source code
unzip pipe-dex2jar-src.zip
Search sensitive strings
grep –i telephonymanager –r *
Analyze the code
With tools
Manually
Identifies malicious code
OWASP 20
Malware identification in Android apps
“Understand” tool
OWASP 21
Malware identification in Android apps
“Dexter” online service
OWASP 22
Malware identification in Android apps
“virustotal.com” online service
OWASP 23
References
[1] “Reverse Engineering and Design Recovery: A
Taxonomy”. Elliot J. Chikofsky, James H. Cross.
[2] “Introducing Stealth Malware Taxanomy”. J.
Rutkowska.
[3] “Alternative markets to the Play Store”.
http://alternativeto.net/software/android-market/
[4] “Security features provided by Android”.
http://developer.android.com/guide/topics/security/permiss
ions.html
[5] “Using the Android Emulator”.
http://developer.android.com/tools/devices/emulator.html
OWASP 24
References
[6] “Android malware database”
http://code.google.com/p/androguard/wiki/DatabaseAndroi
dMalwares
OWASP 25
Thank’s!
Vicente Aguilera Díaz
@vaguileradiaz
www.vicenteaguileradiaz.com

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 
Android pentesting
Android pentestingAndroid pentesting
Android pentesting
 
Reverse engineering android apps
Reverse engineering android appsReverse engineering android apps
Reverse engineering android apps
 
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with Appium
 
Appium overview
Appium overviewAppium overview
Appium overview
 
Android security
Android securityAndroid security
Android security
 
Frans Rosén Keynote at BSides Ahmedabad
Frans Rosén Keynote at BSides AhmedabadFrans Rosén Keynote at BSides Ahmedabad
Frans Rosén Keynote at BSides Ahmedabad
 
Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
 
Mobile security part 1(Android Apps Pentesting)- Romansh yadav
Mobile security part 1(Android Apps Pentesting)- Romansh yadavMobile security part 1(Android Apps Pentesting)- Romansh yadav
Mobile security part 1(Android Apps Pentesting)- Romansh yadav
 
Pentesting iOS Applications
Pentesting iOS ApplicationsPentesting iOS Applications
Pentesting iOS Applications
 
Security in NodeJS applications
Security in NodeJS applicationsSecurity in NodeJS applications
Security in NodeJS applications
 
Android security
Android securityAndroid security
Android security
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
Android Security
Android SecurityAndroid Security
Android Security
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration Testing
 
Practical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectivePractical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's Perspective
 
Appium
AppiumAppium
Appium
 
Mobile Application Penetration Testing
Mobile Application Penetration TestingMobile Application Penetration Testing
Mobile Application Penetration Testing
 
Android Penetration testing - Day 2
 Android Penetration testing - Day 2 Android Penetration testing - Day 2
Android Penetration testing - Day 2
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installation
 

Destacado

Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
VisualBee.com
 
Hacking with Reverse Engineering and Defense against it
Hacking with Reverse Engineering and Defense against it Hacking with Reverse Engineering and Defense against it
Hacking with Reverse Engineering and Defense against it
Prakashchand Suthar
 
Introduction to Reverse Engineering
Introduction to Reverse EngineeringIntroduction to Reverse Engineering
Introduction to Reverse Engineering
Gopinath Chintala
 
Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)
varun teja G.V.V
 
Reverse engineering & its application
Reverse engineering & its applicationReverse engineering & its application
Reverse engineering & its application
mapqrs
 

Destacado (19)

淺談Android app之攻防思維
淺談Android app之攻防思維淺談Android app之攻防思維
淺談Android app之攻防思維
 
Android "Fight Club" : In pursuit of APPiness -- null Humla Delhi Chapter
Android "Fight Club" : In pursuit of APPiness -- null Humla Delhi ChapterAndroid "Fight Club" : In pursuit of APPiness -- null Humla Delhi Chapter
Android "Fight Club" : In pursuit of APPiness -- null Humla Delhi Chapter
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
 
Hacking with Reverse Engineering and Defense against it
Hacking with Reverse Engineering and Defense against it Hacking with Reverse Engineering and Defense against it
Hacking with Reverse Engineering and Defense against it
 
Mobile Apps Security Testing -3
Mobile Apps Security Testing -3Mobile Apps Security Testing -3
Mobile Apps Security Testing -3
 
A visit to the darknet
A visit to the darknetA visit to the darknet
A visit to the darknet
 
WARE: a tool for the Reverse Engineering of Web Applications
WARE: a tool for the Reverse Engineering of Web Applications WARE: a tool for the Reverse Engineering of Web Applications
WARE: a tool for the Reverse Engineering of Web Applications
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
 
Understanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer toolUnderstanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer tool
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
 
Software maintenance Unit5
Software maintenance  Unit5Software maintenance  Unit5
Software maintenance Unit5
 
Software reverse engineering
Software reverse engineeringSoftware reverse engineering
Software reverse engineering
 
Introduction to Reverse Engineering
Introduction to Reverse EngineeringIntroduction to Reverse Engineering
Introduction to Reverse Engineering
 
Android sandbox
Android sandboxAndroid sandbox
Android sandbox
 
Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)Mi 291 chapter 3 (reverse engineering)(1)
Mi 291 chapter 3 (reverse engineering)(1)
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
 
Reverse engineering & its application
Reverse engineering & its applicationReverse engineering & its application
Reverse engineering & its application
 
The dedexer disassembler
The dedexer disassemblerThe dedexer disassembler
The dedexer disassembler
 

Similar a Android reverse engineering: understanding third-party applications. OWASP EU Tour 2013 Bucharest (Romania)

Mobile application security
Mobile application securityMobile application security
Mobile application security
Shubhneet Goel
 
Chirita ionel owasp europe tour
Chirita ionel   owasp europe tourChirita ionel   owasp europe tour
Chirita ionel owasp europe tour
Chirita Ionel
 
Mediating Applications on the Android System
Mediating Applications on the Android SystemMediating Applications on the Android System
Mediating Applications on the Android System
Nizar Maan
 
Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013
Stephan Chenette
 

Similar a Android reverse engineering: understanding third-party applications. OWASP EU Tour 2013 Bucharest (Romania) (20)

Droidcon mobile security
Droidcon   mobile securityDroidcon   mobile security
Droidcon mobile security
 
ANDROINSPECTOR: A SYSTEM FOR COMPREHENSIVE ANALYSIS OF ANDROID APPLICATIONS
ANDROINSPECTOR: A SYSTEM FOR COMPREHENSIVE ANALYSIS OF ANDROID APPLICATIONSANDROINSPECTOR: A SYSTEM FOR COMPREHENSIVE ANALYSIS OF ANDROID APPLICATIONS
ANDROINSPECTOR: A SYSTEM FOR COMPREHENSIVE ANALYSIS OF ANDROID APPLICATIONS
 
Androinspector a system for
Androinspector a system forAndroinspector a system for
Androinspector a system for
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat DasNull Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
 
COVERT app
COVERT appCOVERT app
COVERT app
 
MACHINE LEARNING APPROACH TO LEARN AND DETECT MALWARE IN ANDROID
MACHINE LEARNING APPROACH TO LEARN AND DETECT MALWARE IN ANDROIDMACHINE LEARNING APPROACH TO LEARN AND DETECT MALWARE IN ANDROID
MACHINE LEARNING APPROACH TO LEARN AND DETECT MALWARE IN ANDROID
 
DROIDSWAN: Detecting Malicious Android Applications Based on Static Feature A...
DROIDSWAN: Detecting Malicious Android Applications Based on Static Feature A...DROIDSWAN: Detecting Malicious Android Applications Based on Static Feature A...
DROIDSWAN: Detecting Malicious Android Applications Based on Static Feature A...
 
Mobile application security
Mobile application securityMobile application security
Mobile application security
 
Mobile Application Security
Mobile Application SecurityMobile Application Security
Mobile Application Security
 
Malware Bytes – Advanced Fault Analysis
Malware Bytes – Advanced Fault AnalysisMalware Bytes – Advanced Fault Analysis
Malware Bytes – Advanced Fault Analysis
 
SYSTEM CALL DEPENDENCE GRAPH BASED BEHAVIOR DECOMPOSITION OF ANDROID APPLICAT...
SYSTEM CALL DEPENDENCE GRAPH BASED BEHAVIOR DECOMPOSITION OF ANDROID APPLICAT...SYSTEM CALL DEPENDENCE GRAPH BASED BEHAVIOR DECOMPOSITION OF ANDROID APPLICAT...
SYSTEM CALL DEPENDENCE GRAPH BASED BEHAVIOR DECOMPOSITION OF ANDROID APPLICAT...
 
Top Mobile Application Penetration Testing Tools for Android and iOS.pdf
Top Mobile Application Penetration Testing Tools for Android and iOS.pdfTop Mobile Application Penetration Testing Tools for Android and iOS.pdf
Top Mobile Application Penetration Testing Tools for Android and iOS.pdf
 
Review of behavior malware analysis for android
Review of behavior malware analysis for androidReview of behavior malware analysis for android
Review of behavior malware analysis for android
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft talks: Android Security Threats
Sperasoft talks: Android Security Threats
 
Getting started with Android pentesting
Getting started with Android pentestingGetting started with Android pentesting
Getting started with Android pentesting
 
Chirita ionel owasp europe tour
Chirita ionel   owasp europe tourChirita ionel   owasp europe tour
Chirita ionel owasp europe tour
 
Pentesting Android Applications
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android Applications
 
Mediating Applications on the Android System
Mediating Applications on the Android SystemMediating Applications on the Android System
Mediating Applications on the Android System
 
Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013
 
Stephanie Vanroelen - Mobile Anti-Virus apps exposed
Stephanie Vanroelen - Mobile Anti-Virus apps exposedStephanie Vanroelen - Mobile Anti-Virus apps exposed
Stephanie Vanroelen - Mobile Anti-Virus apps exposed
 

Más de Internet Security Auditors

Más de Internet Security Auditors (20)

Explotando los datos como materia prima del conocimiento
Explotando los datos como materia prima del conocimientoExplotando los datos como materia prima del conocimiento
Explotando los datos como materia prima del conocimiento
 
XIII Jornadas STIC CCN-CERT. OSINT de la información a la inteligencia
XIII Jornadas STIC CCN-CERT. OSINT de la información a la inteligenciaXIII Jornadas STIC CCN-CERT. OSINT de la información a la inteligencia
XIII Jornadas STIC CCN-CERT. OSINT de la información a la inteligencia
 
Proceso de implementación de los sistemas de gestión ISO 27001 e ISO 22301
Proceso de implementación de los sistemas de gestión ISO 27001 e ISO 22301Proceso de implementación de los sistemas de gestión ISO 27001 e ISO 22301
Proceso de implementación de los sistemas de gestión ISO 27001 e ISO 22301
 
Problemática de implementación de un SGSI o un SGCN en contact centers y BPOs
Problemática de implementación de un SGSI o un SGCN en contact centers y BPOsProblemática de implementación de un SGSI o un SGCN en contact centers y BPOs
Problemática de implementación de un SGSI o un SGCN en contact centers y BPOs
 
PCI DSS en el Cloud: Transferencia Internacional Datos
PCI DSS en el Cloud: Transferencia Internacional DatosPCI DSS en el Cloud: Transferencia Internacional Datos
PCI DSS en el Cloud: Transferencia Internacional Datos
 
Problematicas de PCI DSS en Contact Centers & BPO
Problematicas de PCI DSS en Contact Centers & BPOProblematicas de PCI DSS en Contact Centers & BPO
Problematicas de PCI DSS en Contact Centers & BPO
 
PCI DSS: Justificacion del Cumplimiento
PCI DSS: Justificacion del CumplimientoPCI DSS: Justificacion del Cumplimiento
PCI DSS: Justificacion del Cumplimiento
 
Proteccion de Datos Personales: Conceptos, Sanciones, Metodologia
Proteccion de Datos Personales: Conceptos, Sanciones, MetodologiaProteccion de Datos Personales: Conceptos, Sanciones, Metodologia
Proteccion de Datos Personales: Conceptos, Sanciones, Metodologia
 
GigaTIC 2017 - Más allá del futuro: Negocio, tecnología y robótica. (Abril 2017)
GigaTIC 2017 - Más allá del futuro: Negocio, tecnología y robótica. (Abril 2017)GigaTIC 2017 - Más allá del futuro: Negocio, tecnología y robótica. (Abril 2017)
GigaTIC 2017 - Más allá del futuro: Negocio, tecnología y robótica. (Abril 2017)
 
RootedCon 2017 - Workshop: IoT Insecurity of Things?
RootedCon 2017 - Workshop: IoT Insecurity of Things?RootedCon 2017 - Workshop: IoT Insecurity of Things?
RootedCon 2017 - Workshop: IoT Insecurity of Things?
 
PCI DSS en la Nube
PCI DSS en la NubePCI DSS en la Nube
PCI DSS en la Nube
 
Cambios de las versiones 3.2, Cuestionarios y Ecosistema de Normas PCI
Cambios de las versiones 3.2, Cuestionarios y Ecosistema de Normas PCICambios de las versiones 3.2, Cuestionarios y Ecosistema de Normas PCI
Cambios de las versiones 3.2, Cuestionarios y Ecosistema de Normas PCI
 
Overdrive Hacking Conference 2016 - Riesgos en el uso de las Redes Sociales (...
Overdrive Hacking Conference 2016 - Riesgos en el uso de las Redes Sociales (...Overdrive Hacking Conference 2016 - Riesgos en el uso de las Redes Sociales (...
Overdrive Hacking Conference 2016 - Riesgos en el uso de las Redes Sociales (...
 
Conferencia sobre Protección de Datos (Bogotá): Errores comunes en la identif...
Conferencia sobre Protección de Datos (Bogotá): Errores comunes en la identif...Conferencia sobre Protección de Datos (Bogotá): Errores comunes en la identif...
Conferencia sobre Protección de Datos (Bogotá): Errores comunes en la identif...
 
Conferencia sobre Protección de Datos (Bogotá): Aprendiendo de las Sanciones
Conferencia sobre Protección de Datos (Bogotá): Aprendiendo de las SancionesConferencia sobre Protección de Datos (Bogotá): Aprendiendo de las Sanciones
Conferencia sobre Protección de Datos (Bogotá): Aprendiendo de las Sanciones
 
Catosfera 2016: Anàlisi de xarxes socials amb finalitats d'investigació: ris...
Catosfera 2016:  Anàlisi de xarxes socials amb finalitats d'investigació: ris...Catosfera 2016:  Anàlisi de xarxes socials amb finalitats d'investigació: ris...
Catosfera 2016: Anàlisi de xarxes socials amb finalitats d'investigació: ris...
 
CIBERSEG'16. Técnicas #OSINT
CIBERSEG'16. Técnicas #OSINTCIBERSEG'16. Técnicas #OSINT
CIBERSEG'16. Técnicas #OSINT
 
VI Foro Evidencias Electrónicas en la Investigación Policial. Análisis forens...
VI Foro Evidencias Electrónicas en la Investigación Policial. Análisis forens...VI Foro Evidencias Electrónicas en la Investigación Policial. Análisis forens...
VI Foro Evidencias Electrónicas en la Investigación Policial. Análisis forens...
 
CIBERSEG '15 - Taller: Ingeniería inversa en aplicaciones Android
CIBERSEG '15 - Taller: Ingeniería inversa en aplicaciones AndroidCIBERSEG '15 - Taller: Ingeniería inversa en aplicaciones Android
CIBERSEG '15 - Taller: Ingeniería inversa en aplicaciones Android
 
(ISC)2 Security Congress EMEA. You are being watched.
(ISC)2 Security Congress EMEA. You are being watched.(ISC)2 Security Congress EMEA. You are being watched.
(ISC)2 Security Congress EMEA. You are being watched.
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 

Android reverse engineering: understanding third-party applications. OWASP EU Tour 2013 Bucharest (Romania)

  • 1. Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP Foundation OWASP EU Tour 2013 http://www.owasp.org Android reverse engineering: understanding third-party applications Vicente Aguilera Díaz OWASP Spain Chapter Leader Co-founder of Internet Security Auditors vicente.aguilera@owasp.org Twitter: @vaguileradiaz www.vicenteaguileradiaz.com June 5, 2013. Bucharest (Romania)
  • 2. OWASP 2 Who I am? Co-founder of Internet Security Auditors OWASP Spain Chapter Leader More info: www.vicenteaguileradiaz.com VICENTE AGUILERA DÍAZ
  • 3. OWASP 3 Agenda Reverse engineering: definition and objectives Application analysis workflow Malware identification in Android apps
  • 4. OWASP 4 Reverse engineering: definition and objectives Definition Refers to the process of analyzing a system to identify its components and their interrelationships, and create representations of the system in another form or a higher level of abstraction. [1] Objetives The purpose of reverse engineering is not to make changes or to replicate the system under analysis, but to understand how it was built.
  • 5. OWASP 5 Application analysis workflow Decompress and Dissassemble Rebuild APK Original APK Modified APK Scope of this presentation Analyze Modify
  • 6. OWASP 6 Application analysis workflow App Name APK /lib /META-INF /res resources.arsc AndroidManifest.xml classes.dex Human-readable XML AXMLPrinter2.jar .class .java dex2jar jd-gui Disasm Debug Analyze Manipulateradare2 Static Analysis AndroidManifest.xml apktool.yml /assets /res /smali .smali Static Analysis baksmali Understand Dexter grep apktool unzip radare2 SaveAPK Astro File Manager Real APK Leecher
  • 7. OWASP 7 Application analysis workflow Static Analysis Tools for Android Apps TOOL DESCRIPTION URL Dexter Static android application analysis tool https://dexter.bluebox.com/ Androguard Analysis tool (.dex, .apk, .xml, .arsc) https://code.google.com/p/androguard/ smali/baksmali Assembler/disassembler (dex format) https://code.google.com/p/smali/ apktool Decode/rebuild resources https://code.google.com/p/android-apktool/ JD-GUI Java decompiler http://java.decompiler.free.fr/?q=jdgui Dedexer Disassembler tool for DEX files http://dedexer.sourceforge.net/ AXMLPrinter2.jar Prints XML document from binary XML http://code.google.com/p/android4me/ dex2jar Analysis tool (.dex and .class files) https://code.google.com/p/dex2jar/ apkinspector Analysis functions https://code.google.com/p/apkinspector/ Understand Source code analysis and metrics http://www.scitools.com/ Agnitio Security code review http://sourceforge.net/projects/agnitiotool/
  • 8. OWASP 8 Application analysis workflow Others (necessary) tools TOOL DESCRIPTION URL Android SDK Tools to build, test, and debug apps http://developer.android.com/sdk/index.html |--- emulator Virtual mobile device developer.android.com/tools/help/emulator.html |--- adb Android debug bridge developer.android.com/tools/help/adb.html A.R.E. Android Reverse Engineering VM https://redmine.honeynet.org/projects/are/wiki
  • 9. OWASP 9 Malware identification in Android apps Malware definition Malware is a piece of code which changes the behavior of either the operating system kernel or some security sensitive applications, without a user consent and in such a way that it is then impossible to detect those changes using a documented features of the operating system or the application.[2] A malware is any malicious code or piece of software that is designed to perform functions without the consent of the user.
  • 10. OWASP 10 Malware identification in Android apps Techniques for introducing malware Exploit any vulnerability in the web server hosting the official store Use the official store to post apps containing malware Install not malicious app that, at some point, install malicious code Use alternatives[3] to official stores to post apps containing malware
  • 11. OWASP 11 Malware identification in Android apps A practical example Some considerations The analyzed app are in the Play Store The published application does not exploit (supposedly) any vulnerability, but can contains malicious code that exploits the user's trust[4] We will only use static analysis We will analyze Java source code We will use the Android Emulator[5]
  • 12. OWASP 12 Malware identification in Android apps What do we need? … and motivation!
  • 13. OWASP 13 Malware identification in Android apps Let's see an example…
  • 14. OWASP 14 Malware identification in Android apps Identify a possible malicious application App with unnecessary permissions  A wallpaper that requires “SEND SMS MESSAGES”  A calculator that requires “DIRECTLY CALL PHONE NUMBERS”  … Google:  +"send sms messages" +”wallpaper” +site:”play.google.com”
  • 15. OWASP 15 Malware identification in Android apps Identify a possible malicious application Example: “Pipe Mania Droid Lite”  https://play.google.com/store/apps/details?id=bridge.pipe.lite
  • 16. OWASP 16 Malware identification in Android apps Obtaining the APK file Using the SaveAPK tool (requires IO File Manager)
  • 17. OWASP 17 Malware identification in Android apps Decompress the APK file unzip Pipe Mania Droid Lite.apk Verify the permissions and receivers java –jar AXMLPrinter2.jar AndroidManifest.xml > out
  • 18. OWASP 18 Malware identification in Android apps Convert from Dalvik EXecutable to Java classes d2j-dex2jar.sh pipe.apk Decompile Java classes and download source code jd-gui pipe-dex2jar.jar
  • 19. OWASP 19 Malware identification in Android apps Decompress the source code unzip pipe-dex2jar-src.zip Search sensitive strings grep –i telephonymanager –r * Analyze the code With tools Manually Identifies malicious code
  • 20. OWASP 20 Malware identification in Android apps “Understand” tool
  • 21. OWASP 21 Malware identification in Android apps “Dexter” online service
  • 22. OWASP 22 Malware identification in Android apps “virustotal.com” online service
  • 23. OWASP 23 References [1] “Reverse Engineering and Design Recovery: A Taxonomy”. Elliot J. Chikofsky, James H. Cross. [2] “Introducing Stealth Malware Taxanomy”. J. Rutkowska. [3] “Alternative markets to the Play Store”. http://alternativeto.net/software/android-market/ [4] “Security features provided by Android”. http://developer.android.com/guide/topics/security/permiss ions.html [5] “Using the Android Emulator”. http://developer.android.com/tools/devices/emulator.html
  • 24. OWASP 24 References [6] “Android malware database” http://code.google.com/p/androguard/wiki/DatabaseAndroi dMalwares
  • 25. OWASP 25 Thank’s! Vicente Aguilera Díaz @vaguileradiaz www.vicenteaguileradiaz.com