SlideShare une entreprise Scribd logo
1  sur  113
Reverse Engineering 
the 
Android OS
About Me 
Ex Military “31 Mic” Microwave Communications - 34th Signal Battalion 
Lab Developer for Jones and Bartlett Publishing 
CEI – CEH V8 
Martial Art Nutcase 
Co-creator of Cyber Kung Fu
Reverse Engineering 
• Understand how applications work 
• Analyze them 
• Find vulnerabilities 
• Uncover hard coded information
Why do I want to Hack Mobile Devices
• Natural Curiosity 
• MacGyver Fan 
• CEH V8 mobile sucked 
• Humongous Installed Base 
• Self Defense
Lots of important information 
• Contacts 
• Messages 
• Photos 
• Email 
• GPS co-ordinates 
• Personal notes 
• Stored accounts 
• Web traffic 
• Application configs and credentials
Double Edged Sword 
• User moves between work and personal environments 
• Carries Corporate Data 
• Device can be compromised in less secure areas 
• Compromised device is then connected to work 
environment
Theft and Loss 
• Weak protective mechanisms 
• Compounded by users turning off security features 
• Rooted devices
More Problems 
• Increasing everyday use 
• Users not educated 
• Mix of personal and business use 
• Always connected to internet
Physical Security 
• Phone is easily accessed 
• SD Card 
• Charging/io port access – Rubber Ducky 
• Shoulder Surfing 
• Smudge attack
Web Issues 
• Small screen hides full URL 
• XSS 
• CSRF 
• Phishing
Rogue Applications 
• Malware 
• Virus 
• Trojans 
• Spyware
History 
• Cabir – 2004 
• Skulls – 2004 
• pbstealer 
• Commwarrior 
• Cardtrap 
• All Symbion basesd but eventually spread to CE 
and Java (J2ME
Android and IOs 
• Ikee – 2009/2010 - worm 
• AndroidOS.FakePlayer – premuium SMS 
• Geinimi Trojan 
• SMS Replicator 
• DroidDream 
• GinerMaster 
• DroidKungFu
Older Devices 
• Out of date software 
• Vulnerable to older fixed exploits 
• Patching – no incentive for older hardware 
• Carrier indifference
Architecture
Kernel 
First layer to interact with Hardware
C/C++ Libraries 
• Exposed to developer via Java API 
• Kind of a transaction layer between kernel and 
application framework 
• Provides common services for apps
Core Libraries 
• SSL 
• SLite 
• Surface Manager 
• WebKit 
• Font, media, display libraries
Runtime 
• DVM – Dalvik Virtual Machine 
• Efficient and Secure mobile environment
Secure 
• Each app runs in its own instance 
• Unique ID and VM 
• Separate memory and files
Application Framework 
• Compiled java code running in DVM 
• Provides services to multiple apps 
• Layer that 3rd party developers interact with 
• Abstract access to key resources
Application Layer 
• Contacts 
• Phone 
• Calendar 
• Browser 
• Maps 
• Pictures
Privilege Separation & Sandboxing 
• Based on Linux security model 
• Each user is assigned a unique ID (UID) 
• Each user can be assigned to Groups 
• Each Group has an unique ID (GID)
Resource Permissions 
• Owner 
• Group 
• Rest of world (everyone)
Sandboxing 
• Two or more applications can communicate 
• Provided they grant permissions 
• Implemented in the kernel 
• Extended to all software above 1st layer
App Separation 
• Kernel assigns unique UID 
• Runs as that user in separate process 
• Different than multiuser OS
File Separation 
• New apps get new UIDs 
• Extended across memory cards 
• All associated DB and files use the new UID
File Permissions
Separate File Permission Groups 
• Note – only the associated UID and root UID have full privileges on 
these resources unless the developer exposes files to other apps.
SD Cards 
• Everyone (Whole World) has access Storage 
• Currently vfat fs 
• Doesn’t support granular permissions 
• Note – good place for privilege escalation
Data Storage on the Device 
• Databases 
• SharedPreferences
SharedPreferences 
• Allows app to store and retrieve persistent key values 
• Persist across device sessions 
• Accesss using the SharedPreferences Object 
• Stored as XML 
• /data/data/”app”/shared_prefs 
• Example
SQLite3 
• Full Support 
• Accessed via the UID of the related app 
• /data/data/”app”/databases
Application Signing 
• Ensures Integrity and Authenticity 
• APK must be signed 
• Inhibits tampering 
• Aids confidentiality by insuring where it came from 
• Apps signed with same key can share UID, Process, Memory, 
Data Storage and Sandbox
Signing Quirks 
• Apps can be disassembled and changed 
• Can be resigned with same certificate if you have key 
• Multiple apps can use same certificate 
• App can be manipulated to accept same certificate 
• Debugging certificate
App access to resources 
• Developer limits access to required resources 
• Helps to inhibit rogue apps from taking over 
• Text, GPS, MMS, camera, microphone, contacts
API Permissions 
• AndroidManifest.xml 
• Used by trusted applications 
• Tracks what the user is allowed to do 
• Each app must have an AndroidManifest.xml
Permission Model 
• System displays permissions 
• Helps user to decide to trust app or not. 
Normal – Dangerous – Signature – Signature or System
Components 
• Activity 
• Content Providers 
• Broadcast Receivers 
• Services
Activity 
• Provides a screen and allows a user to interact with it. 
• A window where the user interface is defined
Content Providers 
• Allow efficient data sharing between processes & applications 
• Allow applications to access the stored data of other 
applications 
• Use relational databases similar to tables 
• Each row is an Instance each column is a Type 
• Pic
Examples of Content Providers 
• Calendar provider 
• Contacts provider
Broadcast Receiver 
• Listens for asynchronous request from intents 
• Apps can register for events and get notified when it happens
Services 
• Background processes 
• Run even when app is not visible 
• Provide computations 
• Example is GPS
SecurityException 
• Without proper permissions a component call will raise a 
Security Exception
Intents 
• Mechanisms for asynchronous IPC (Inter Process Communication) 
• Allow app to send or broadcast messages to specific components 
• Control task and transport data 
• Components like Activities, Broadcast Receivers & Services are 
activated via Intents 
• Contain a large amount of information 
• Parsed by OS & used by the receiver to take action 
• Contain category and instruction for activity launch 
Action – Data – Type – Category (note)
Google Bouncer 
• Automatically scans Android Market looking for malicious Apps 
• Checks new applications 
• Apps already in Store 
• Developer accounts 
• No restrictions on upload process 
• Can be bypassed
Rooting 
• Gain Root permissions 
• Allow access and editing of Carrier and Manufacturer apps 
• Install Custom Software (ROMs) 
• Install different Android Version 
• Wi Fi tethering 
• Overclocking 
• Removing Fluff-ware
Some Rooting Techniques 
• Depends on the device 
• OneClickRoot 
• SuperOneClick 
• z4Root 
• GingerBreak 
• UnlockRoot
The SDK 
• Windows and Linux 
• SDk & Eclipse 
• Virtual Devices (emulators) 
• Allows interaction with virtual and real devices 
– Browse files 
– Create, install, extract apps 
– Get shells 
– SSH & VNC
SDK continued 
• Eclipse 
• ADT – Android Developer Tools 
– Signing 
– Debugging 
– Important for developer & tester 
– Use Android SDK Tools 
• IDE – integrated Development Environment
Package Explorer
Package Explorer 
Middle pane 
• Source code 
• Activity’s UI
Right Pane (Outline) 
• Methods 
• Functions 
• Arguments 
• Variables 
• Properties
Perspectives 
• Java – DDMS – Debug (Dalvik Debug Monitor Server)
AVD Manager 
• Allows emulation of devices 
• Custom hardware 
• Custom software 
• Runs from SDK executables
Android Virtual Device
Device definition 
• Create 
• Clone – Edit – Delete 
• New custom devices
What we can do with a Virtual Device 
• Send and receive text between devices 
• make calls 
• interact with the touch screen if you have one on your host 
• browse file 
• threads
Commands Available 
• the VM can be run from the command line 
• Command - adb devices 
• adb connect <device name> 
• note the number reference the port used
USB devices are different
Shell interaction is via the –s option
Shell commands 
• allows browsing 
• read and write files & folders 
• change permissions 
• get network statistics
basic linux commands 
• ls 
• ps 
• netstat 
• top
More Commands 
• list all the packages 
• pm list packages –f
sqlite3 
• access databases *.db 
• query statements 
• show a browsed database from 
/data/Datacom.android.providers.telephony/databases
Browse SMS Folder
Database containing SMSs
Sqlite3 mnsms.db
sqlite .tables
select * sms
Adb pull - Adb push 
• adb pull <device_path> <local_path> 
• adb push <device_path> <local_path>
Pull Example 
Browser Files
Push Example 
Changed “enable_javascript” to true
Device Settings Changed
Sqlite.exe in sdk/tools
Sqlite store credentials 
Because the Web Browser had the “Remember Password” option 
enabled we can view it in the “webview.db” file
DDMS View 
Dalvik Debug Monitor Server 
Browse all Devices and Contents by using the “File Explorer” Tab
More Powerfull Shell
SSH Client
SSH Server
Putty as Client
putty shell via ssh over wifi
Droid VNC
Analysis Types
APK = ZIP
Decompiling & Disassembling
Elements in apk
Source 
AndroidManifest.xml
Dex files 
dexdump –d path_to_file.dex
apktool 
apktool d name.apk path_to_file
Smali / bacsmali 
• Developed by Jesus Freke 
• Assembler/ disassembler for dex files
smali Folder
classes.dex vs .smali
Apktool 
AndroidManifest.xml
Folders & Uses 
src – source 
• Packages 
• MainActivity.java 
assets 
• Fonts, audio, images, text files 
• Non-android xml files
Folders & Uses 
bin – same as Linux 
libs - same as Linux 
res - resources 
• drawables – images for layouts 
• layout –user interface * 
• values – string.xml – styles.xml – dimens.xml - colors
layout/Folder 
Activity_Main.xml 
<TextView 
android:layout_width=“wrap_content” 
android:layout_height=“wrap_content” 
android:text=“@string/”hello world”
valuesFolder 
Strings.xml 
<resourses> 
<string name=“Hello world”> Hello world </string>
dex2jar
Decompiles dex into java
JD-GUI
XDAAutoTool
XDAAutoTool Options
Bypassing Security Controls
Code example
for - if - else
password 
after 5 iterations
Quick Way
Tom Updegrove 
tu@internetworkservice.com

Contenu connexe

Tendances

Mobile application security
Mobile application securityMobile application security
Mobile application security
Shubhneet Goel
 
Analysis and research of system security based on android
Analysis and research of system security based on androidAnalysis and research of system security based on android
Analysis and research of system security based on android
Ravishankar Kumar
 

Tendances (20)

Penetrating Android Aapplications
Penetrating Android AapplicationsPenetrating Android Aapplications
Penetrating Android Aapplications
 
Android Security Development
Android Security DevelopmentAndroid Security Development
Android Security Development
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
Pentesting Mobile Applications (Prashant Verma)
Pentesting Mobile Applications (Prashant Verma)Pentesting Mobile Applications (Prashant Verma)
Pentesting Mobile Applications (Prashant Verma)
 
My Null Android Penetration Session
My Null  Android Penetration Session My Null  Android Penetration Session
My Null Android Penetration Session
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft talks: Android Security Threats
Sperasoft talks: Android Security Threats
 
2015.04.24 Updated > Android Security Development - Part 1: App Development
2015.04.24 Updated > Android Security Development - Part 1: App Development 2015.04.24 Updated > Android Security Development - Part 1: App Development
2015.04.24 Updated > Android Security Development - Part 1: App Development
 
Android Security
Android SecurityAndroid Security
Android Security
 
Hacking your Android (slides)
Hacking your Android (slides)Hacking your Android (slides)
Hacking your Android (slides)
 
Android Security
Android SecurityAndroid Security
Android Security
 
Android Security
Android SecurityAndroid Security
Android Security
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
 
Android Security
Android SecurityAndroid Security
Android Security
 
Android security
Android securityAndroid security
Android security
 
Understanding android security model
Understanding android security modelUnderstanding android security model
Understanding android security model
 
Android security
Android securityAndroid security
Android security
 
Android pen test basics
Android pen test basicsAndroid pen test basics
Android pen test basics
 
Mobile application security
Mobile application securityMobile application security
Mobile application security
 
Analysis and research of system security based on android
Analysis and research of system security based on androidAnalysis and research of system security based on android
Analysis and research of system security based on android
 

En vedette

Inside Apple iPhone 2013 - iPhone 5s & iPhone 5c
Inside Apple iPhone 2013 - iPhone 5s & iPhone 5cInside Apple iPhone 2013 - iPhone 5s & iPhone 5c
Inside Apple iPhone 2013 - iPhone 5s & iPhone 5c
JJ Wu
 
Pau Oliva – Bypassing wifi pay-walls with Android [Rooted CON 2014]
Pau Oliva – Bypassing wifi pay-walls with Android [Rooted CON 2014]Pau Oliva – Bypassing wifi pay-walls with Android [Rooted CON 2014]
Pau Oliva – Bypassing wifi pay-walls with Android [Rooted CON 2014]
RootedCON
 
UseCase is a DIALOG---NOT a PROCESS
UseCase is a DIALOG---NOT a PROCESSUseCase is a DIALOG---NOT a PROCESS
UseCase is a DIALOG---NOT a PROCESS
Putcha Narasimham
 
Activity diagram railway reservation system
Activity diagram railway reservation systemActivity diagram railway reservation system
Activity diagram railway reservation system
muthumeenakshim
 
Payroll and attendance system
Payroll and attendance system Payroll and attendance system
Payroll and attendance system
Moses Nkrumah
 
Usecase diagram railway reservation system
Usecase diagram railway reservation systemUsecase diagram railway reservation system
Usecase diagram railway reservation system
muthumeenakshim
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentation
connectshilpa
 

En vedette (20)

iPhone 5s vs 5c Teardown by ifixit
iPhone 5s vs 5c Teardown by ifixitiPhone 5s vs 5c Teardown by ifixit
iPhone 5s vs 5c Teardown by ifixit
 
This is the secure droid you are looking for
This is the secure droid you are looking forThis is the secure droid you are looking for
This is the secure droid you are looking for
 
Inside Apple iPhone 2013 - iPhone 5s & iPhone 5c
Inside Apple iPhone 2013 - iPhone 5s & iPhone 5cInside Apple iPhone 2013 - iPhone 5s & iPhone 5c
Inside Apple iPhone 2013 - iPhone 5s & iPhone 5c
 
SELP: Debugging, AVDs and Manifests
SELP: Debugging, AVDs and ManifestsSELP: Debugging, AVDs and Manifests
SELP: Debugging, AVDs and Manifests
 
Working with databases in Android
Working with databases in AndroidWorking with databases in Android
Working with databases in Android
 
Android overview
Android overviewAndroid overview
Android overview
 
Arrays in Objective-C
Arrays in Objective-CArrays in Objective-C
Arrays in Objective-C
 
My Final year project on Android app development
My Final year project on Android app developmentMy Final year project on Android app development
My Final year project on Android app development
 
iPhone 5S Fingerprint Sensor teardown reverse costing report by published Yol...
iPhone 5S Fingerprint Sensor teardown reverse costing report by published Yol...iPhone 5S Fingerprint Sensor teardown reverse costing report by published Yol...
iPhone 5S Fingerprint Sensor teardown reverse costing report by published Yol...
 
Steelcon 2015 Reverse-Engineering Obfuscated Android Applications
Steelcon 2015 Reverse-Engineering Obfuscated Android ApplicationsSteelcon 2015 Reverse-Engineering Obfuscated Android Applications
Steelcon 2015 Reverse-Engineering Obfuscated Android Applications
 
Pau Oliva – Bypassing wifi pay-walls with Android [Rooted CON 2014]
Pau Oliva – Bypassing wifi pay-walls with Android [Rooted CON 2014]Pau Oliva – Bypassing wifi pay-walls with Android [Rooted CON 2014]
Pau Oliva – Bypassing wifi pay-walls with Android [Rooted CON 2014]
 
Visualizing My Facebook Networks
Visualizing My Facebook NetworksVisualizing My Facebook Networks
Visualizing My Facebook Networks
 
Practice of Android Reverse Engineering
Practice of Android Reverse EngineeringPractice of Android Reverse Engineering
Practice of Android Reverse Engineering
 
Toll app - Android project
Toll app - Android projectToll app - Android project
Toll app - Android project
 
UseCase is a DIALOG---NOT a PROCESS
UseCase is a DIALOG---NOT a PROCESSUseCase is a DIALOG---NOT a PROCESS
UseCase is a DIALOG---NOT a PROCESS
 
Activity diagram railway reservation system
Activity diagram railway reservation systemActivity diagram railway reservation system
Activity diagram railway reservation system
 
Payroll and attendance system
Payroll and attendance system Payroll and attendance system
Payroll and attendance system
 
Usecase diagram railway reservation system
Usecase diagram railway reservation systemUsecase diagram railway reservation system
Usecase diagram railway reservation system
 
Ziilion E245 final presentation
Ziilion E245 final presentationZiilion E245 final presentation
Ziilion E245 final presentation
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentation
 

Similaire à Hacker Halted 2014 - Reverse Engineering the Android OS

Android village @nullcon 2012
Android village @nullcon 2012 Android village @nullcon 2012
Android village @nullcon 2012
hakersinfo
 
Thick Application Penetration Testing - A Crash Course
Thick Application Penetration Testing - A Crash CourseThick Application Penetration Testing - A Crash Course
Thick Application Penetration Testing - A Crash Course
NetSPI
 
Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01
Santosh Sh
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 

Similaire à Hacker Halted 2014 - Reverse Engineering the Android OS (20)

CNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: Android
 
128-ch4.pptx
128-ch4.pptx128-ch4.pptx
128-ch4.pptx
 
CNIT 128 7. Attacking Android Applications (Part 3)
CNIT 128 7. Attacking Android Applications (Part 3)CNIT 128 7. Attacking Android Applications (Part 3)
CNIT 128 7. Attacking Android Applications (Part 3)
 
CNIT 128 7. Attacking Android Applications (Part 3)
CNIT 128 7. Attacking Android Applications (Part 3)CNIT 128 7. Attacking Android Applications (Part 3)
CNIT 128 7. Attacking Android Applications (Part 3)
 
Mobile platform security models
Mobile platform security modelsMobile platform security models
Mobile platform security models
 
Google android os
Google android osGoogle android os
Google android os
 
Android Security and Peneteration Testing
Android Security and Peneteration TestingAndroid Security and Peneteration Testing
Android Security and Peneteration Testing
 
Android quick talk
Android quick talkAndroid quick talk
Android quick talk
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
 
Android village @nullcon 2012
Android village @nullcon 2012 Android village @nullcon 2012
Android village @nullcon 2012
 
Thick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdfThick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdf
 
Thick Application Penetration Testing - A Crash Course
Thick Application Penetration Testing - A Crash CourseThick Application Penetration Testing - A Crash Course
Thick Application Penetration Testing - A Crash Course
 
Android application development fundamentals
Android application development fundamentalsAndroid application development fundamentals
Android application development fundamentals
 
Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01
 
Google android os
Google android osGoogle android os
Google android os
 
CNIT 128 6. Analyzing Android Applications (Part 1)
CNIT 128 6. Analyzing Android Applications (Part 1)CNIT 128 6. Analyzing Android Applications (Part 1)
CNIT 128 6. Analyzing Android Applications (Part 1)
 
Android overview
Android overviewAndroid overview
Android overview
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Hacking your Droid (Aditya Gupta)
Hacking your Droid (Aditya Gupta)Hacking your Droid (Aditya Gupta)
Hacking your Droid (Aditya Gupta)
 
Overview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptxOverview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptx
 

Plus de EC-Council

Weaponizing OSINT – Hacker Halted 2019 – Michael James
 Weaponizing OSINT – Hacker Halted 2019 – Michael James  Weaponizing OSINT – Hacker Halted 2019 – Michael James
Weaponizing OSINT – Hacker Halted 2019 – Michael James
EC-Council
 
War Game: Ransomware – Global CISO Forum 2019
War Game: Ransomware – Global CISO Forum 2019War Game: Ransomware – Global CISO Forum 2019
War Game: Ransomware – Global CISO Forum 2019
EC-Council
 

Plus de EC-Council (20)

CyberOm - Hacking the Wellness Code in a Chaotic Cyber World
CyberOm - Hacking the Wellness Code in a Chaotic Cyber WorldCyberOm - Hacking the Wellness Code in a Chaotic Cyber World
CyberOm - Hacking the Wellness Code in a Chaotic Cyber World
 
Cloud Security Architecture - a different approach
Cloud Security Architecture - a different approachCloud Security Architecture - a different approach
Cloud Security Architecture - a different approach
 
Phases of Incident Response
Phases of Incident ResponsePhases of Incident Response
Phases of Incident Response
 
Weaponizing OSINT – Hacker Halted 2019 – Michael James
 Weaponizing OSINT – Hacker Halted 2019 – Michael James  Weaponizing OSINT – Hacker Halted 2019 – Michael James
Weaponizing OSINT – Hacker Halted 2019 – Michael James
 
Hacking Your Career – Hacker Halted 2019 – Keith Turpin
Hacking Your Career – Hacker Halted 2019 – Keith TurpinHacking Your Career – Hacker Halted 2019 – Keith Turpin
Hacking Your Career – Hacker Halted 2019 – Keith Turpin
 
Hacking Diversity – Hacker Halted . 2019 – Marcelle Lee
Hacking Diversity – Hacker Halted . 2019 – Marcelle LeeHacking Diversity – Hacker Halted . 2019 – Marcelle Lee
Hacking Diversity – Hacker Halted . 2019 – Marcelle Lee
 
Cloud Proxy Technology – Hacker Halted 2019 – Jeff Silver
Cloud Proxy Technology – Hacker Halted 2019 – Jeff SilverCloud Proxy Technology – Hacker Halted 2019 – Jeff Silver
Cloud Proxy Technology – Hacker Halted 2019 – Jeff Silver
 
DNS – Strategies for Reducing Data Leakage & Protecting Online Privacy – Hack...
DNS – Strategies for Reducing Data Leakage & Protecting Online Privacy – Hack...DNS – Strategies for Reducing Data Leakage & Protecting Online Privacy – Hack...
DNS – Strategies for Reducing Data Leakage & Protecting Online Privacy – Hack...
 
Data in cars can be creepy – Hacker Halted 2019 – Andrea Amico
Data in cars can be creepy – Hacker Halted 2019 – Andrea AmicoData in cars can be creepy – Hacker Halted 2019 – Andrea Amico
Data in cars can be creepy – Hacker Halted 2019 – Andrea Amico
 
Breaking Smart [Bank] Statements – Hacker Halted 2019 – Manuel Nader
Breaking Smart [Bank] Statements – Hacker Halted 2019 – Manuel NaderBreaking Smart [Bank] Statements – Hacker Halted 2019 – Manuel Nader
Breaking Smart [Bank] Statements – Hacker Halted 2019 – Manuel Nader
 
Are your cloud servers under attack?– Hacker Halted 2019 – Brian Hileman
Are your cloud servers under attack?– Hacker Halted 2019 – Brian HilemanAre your cloud servers under attack?– Hacker Halted 2019 – Brian Hileman
Are your cloud servers under attack?– Hacker Halted 2019 – Brian Hileman
 
War Game: Ransomware – Global CISO Forum 2019
War Game: Ransomware – Global CISO Forum 2019War Game: Ransomware – Global CISO Forum 2019
War Game: Ransomware – Global CISO Forum 2019
 
How to become a Security Behavior Alchemist – Global CISO Forum 2019 – Perry ...
How to become a Security Behavior Alchemist – Global CISO Forum 2019 – Perry ...How to become a Security Behavior Alchemist – Global CISO Forum 2019 – Perry ...
How to become a Security Behavior Alchemist – Global CISO Forum 2019 – Perry ...
 
Introduction to FAIR Risk Methodology – Global CISO Forum 2019 – Donna Gall...
Introduction to FAIR Risk Methodology – Global CISO Forum 2019  –  Donna Gall...Introduction to FAIR Risk Methodology – Global CISO Forum 2019  –  Donna Gall...
Introduction to FAIR Risk Methodology – Global CISO Forum 2019 – Donna Gall...
 
Alexa is a snitch! Hacker Halted 2019 - Wes Widner
Alexa is a snitch! Hacker Halted 2019 - Wes WidnerAlexa is a snitch! Hacker Halted 2019 - Wes Widner
Alexa is a snitch! Hacker Halted 2019 - Wes Widner
 
Hacker Halted 2018: Don't Panic! Big Data Analytics vs. Law Enforcement
Hacker Halted 2018: Don't Panic! Big Data Analytics vs. Law EnforcementHacker Halted 2018: Don't Panic! Big Data Analytics vs. Law Enforcement
Hacker Halted 2018: Don't Panic! Big Data Analytics vs. Law Enforcement
 
Hacker Halted 2018: HACKING TRILLIAN: A 42-STEP SOLUTION TO EXPLOIT POST-VOGA...
Hacker Halted 2018: HACKING TRILLIAN: A 42-STEP SOLUTION TO EXPLOIT POST-VOGA...Hacker Halted 2018: HACKING TRILLIAN: A 42-STEP SOLUTION TO EXPLOIT POST-VOGA...
Hacker Halted 2018: HACKING TRILLIAN: A 42-STEP SOLUTION TO EXPLOIT POST-VOGA...
 
Hacker Halted 2018: Breaking the Bad News: How to Prevent Your IR Messages fr...
Hacker Halted 2018: Breaking the Bad News: How to Prevent Your IR Messages fr...Hacker Halted 2018: Breaking the Bad News: How to Prevent Your IR Messages fr...
Hacker Halted 2018: Breaking the Bad News: How to Prevent Your IR Messages fr...
 
Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist...
Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist...Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist...
Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist...
 
Hacker Halted 2018: SE vs Predator: Using Social Engineering in ways I never ...
Hacker Halted 2018: SE vs Predator: Using Social Engineering in ways I never ...Hacker Halted 2018: SE vs Predator: Using Social Engineering in ways I never ...
Hacker Halted 2018: SE vs Predator: Using Social Engineering in ways I never ...
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

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
 
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...
 
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?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

Hacker Halted 2014 - Reverse Engineering the Android OS

  • 1.
  • 3. About Me Ex Military “31 Mic” Microwave Communications - 34th Signal Battalion Lab Developer for Jones and Bartlett Publishing CEI – CEH V8 Martial Art Nutcase Co-creator of Cyber Kung Fu
  • 4. Reverse Engineering • Understand how applications work • Analyze them • Find vulnerabilities • Uncover hard coded information
  • 5. Why do I want to Hack Mobile Devices
  • 6. • Natural Curiosity • MacGyver Fan • CEH V8 mobile sucked • Humongous Installed Base • Self Defense
  • 7. Lots of important information • Contacts • Messages • Photos • Email • GPS co-ordinates • Personal notes • Stored accounts • Web traffic • Application configs and credentials
  • 8. Double Edged Sword • User moves between work and personal environments • Carries Corporate Data • Device can be compromised in less secure areas • Compromised device is then connected to work environment
  • 9. Theft and Loss • Weak protective mechanisms • Compounded by users turning off security features • Rooted devices
  • 10. More Problems • Increasing everyday use • Users not educated • Mix of personal and business use • Always connected to internet
  • 11. Physical Security • Phone is easily accessed • SD Card • Charging/io port access – Rubber Ducky • Shoulder Surfing • Smudge attack
  • 12. Web Issues • Small screen hides full URL • XSS • CSRF • Phishing
  • 13. Rogue Applications • Malware • Virus • Trojans • Spyware
  • 14. History • Cabir – 2004 • Skulls – 2004 • pbstealer • Commwarrior • Cardtrap • All Symbion basesd but eventually spread to CE and Java (J2ME
  • 15. Android and IOs • Ikee – 2009/2010 - worm • AndroidOS.FakePlayer – premuium SMS • Geinimi Trojan • SMS Replicator • DroidDream • GinerMaster • DroidKungFu
  • 16. Older Devices • Out of date software • Vulnerable to older fixed exploits • Patching – no incentive for older hardware • Carrier indifference
  • 18. Kernel First layer to interact with Hardware
  • 19. C/C++ Libraries • Exposed to developer via Java API • Kind of a transaction layer between kernel and application framework • Provides common services for apps
  • 20. Core Libraries • SSL • SLite • Surface Manager • WebKit • Font, media, display libraries
  • 21. Runtime • DVM – Dalvik Virtual Machine • Efficient and Secure mobile environment
  • 22. Secure • Each app runs in its own instance • Unique ID and VM • Separate memory and files
  • 23. Application Framework • Compiled java code running in DVM • Provides services to multiple apps • Layer that 3rd party developers interact with • Abstract access to key resources
  • 24. Application Layer • Contacts • Phone • Calendar • Browser • Maps • Pictures
  • 25. Privilege Separation & Sandboxing • Based on Linux security model • Each user is assigned a unique ID (UID) • Each user can be assigned to Groups • Each Group has an unique ID (GID)
  • 26. Resource Permissions • Owner • Group • Rest of world (everyone)
  • 27. Sandboxing • Two or more applications can communicate • Provided they grant permissions • Implemented in the kernel • Extended to all software above 1st layer
  • 28. App Separation • Kernel assigns unique UID • Runs as that user in separate process • Different than multiuser OS
  • 29. File Separation • New apps get new UIDs • Extended across memory cards • All associated DB and files use the new UID
  • 31. Separate File Permission Groups • Note – only the associated UID and root UID have full privileges on these resources unless the developer exposes files to other apps.
  • 32. SD Cards • Everyone (Whole World) has access Storage • Currently vfat fs • Doesn’t support granular permissions • Note – good place for privilege escalation
  • 33. Data Storage on the Device • Databases • SharedPreferences
  • 34. SharedPreferences • Allows app to store and retrieve persistent key values • Persist across device sessions • Accesss using the SharedPreferences Object • Stored as XML • /data/data/”app”/shared_prefs • Example
  • 35. SQLite3 • Full Support • Accessed via the UID of the related app • /data/data/”app”/databases
  • 36. Application Signing • Ensures Integrity and Authenticity • APK must be signed • Inhibits tampering • Aids confidentiality by insuring where it came from • Apps signed with same key can share UID, Process, Memory, Data Storage and Sandbox
  • 37. Signing Quirks • Apps can be disassembled and changed • Can be resigned with same certificate if you have key • Multiple apps can use same certificate • App can be manipulated to accept same certificate • Debugging certificate
  • 38. App access to resources • Developer limits access to required resources • Helps to inhibit rogue apps from taking over • Text, GPS, MMS, camera, microphone, contacts
  • 39. API Permissions • AndroidManifest.xml • Used by trusted applications • Tracks what the user is allowed to do • Each app must have an AndroidManifest.xml
  • 40. Permission Model • System displays permissions • Helps user to decide to trust app or not. Normal – Dangerous – Signature – Signature or System
  • 41. Components • Activity • Content Providers • Broadcast Receivers • Services
  • 42. Activity • Provides a screen and allows a user to interact with it. • A window where the user interface is defined
  • 43. Content Providers • Allow efficient data sharing between processes & applications • Allow applications to access the stored data of other applications • Use relational databases similar to tables • Each row is an Instance each column is a Type • Pic
  • 44. Examples of Content Providers • Calendar provider • Contacts provider
  • 45. Broadcast Receiver • Listens for asynchronous request from intents • Apps can register for events and get notified when it happens
  • 46. Services • Background processes • Run even when app is not visible • Provide computations • Example is GPS
  • 47. SecurityException • Without proper permissions a component call will raise a Security Exception
  • 48. Intents • Mechanisms for asynchronous IPC (Inter Process Communication) • Allow app to send or broadcast messages to specific components • Control task and transport data • Components like Activities, Broadcast Receivers & Services are activated via Intents • Contain a large amount of information • Parsed by OS & used by the receiver to take action • Contain category and instruction for activity launch Action – Data – Type – Category (note)
  • 49. Google Bouncer • Automatically scans Android Market looking for malicious Apps • Checks new applications • Apps already in Store • Developer accounts • No restrictions on upload process • Can be bypassed
  • 50. Rooting • Gain Root permissions • Allow access and editing of Carrier and Manufacturer apps • Install Custom Software (ROMs) • Install different Android Version • Wi Fi tethering • Overclocking • Removing Fluff-ware
  • 51. Some Rooting Techniques • Depends on the device • OneClickRoot • SuperOneClick • z4Root • GingerBreak • UnlockRoot
  • 52. The SDK • Windows and Linux • SDk & Eclipse • Virtual Devices (emulators) • Allows interaction with virtual and real devices – Browse files – Create, install, extract apps – Get shells – SSH & VNC
  • 53. SDK continued • Eclipse • ADT – Android Developer Tools – Signing – Debugging – Important for developer & tester – Use Android SDK Tools • IDE – integrated Development Environment
  • 55. Package Explorer Middle pane • Source code • Activity’s UI
  • 56. Right Pane (Outline) • Methods • Functions • Arguments • Variables • Properties
  • 57. Perspectives • Java – DDMS – Debug (Dalvik Debug Monitor Server)
  • 58. AVD Manager • Allows emulation of devices • Custom hardware • Custom software • Runs from SDK executables
  • 60. Device definition • Create • Clone – Edit – Delete • New custom devices
  • 61. What we can do with a Virtual Device • Send and receive text between devices • make calls • interact with the touch screen if you have one on your host • browse file • threads
  • 62. Commands Available • the VM can be run from the command line • Command - adb devices • adb connect <device name> • note the number reference the port used
  • 63. USB devices are different
  • 64. Shell interaction is via the –s option
  • 65. Shell commands • allows browsing • read and write files & folders • change permissions • get network statistics
  • 66. basic linux commands • ls • ps • netstat • top
  • 67. More Commands • list all the packages • pm list packages –f
  • 68. sqlite3 • access databases *.db • query statements • show a browsed database from /data/Datacom.android.providers.telephony/databases
  • 74. Adb pull - Adb push • adb pull <device_path> <local_path> • adb push <device_path> <local_path>
  • 76. Push Example Changed “enable_javascript” to true
  • 79. Sqlite store credentials Because the Web Browser had the “Remember Password” option enabled we can view it in the “webview.db” file
  • 80. DDMS View Dalvik Debug Monitor Server Browse all Devices and Contents by using the “File Explorer” Tab
  • 85. putty shell via ssh over wifi
  • 92. Dex files dexdump –d path_to_file.dex
  • 93.
  • 94. apktool apktool d name.apk path_to_file
  • 95. Smali / bacsmali • Developed by Jesus Freke • Assembler/ disassembler for dex files
  • 99. Folders & Uses src – source • Packages • MainActivity.java assets • Fonts, audio, images, text files • Non-android xml files
  • 100. Folders & Uses bin – same as Linux libs - same as Linux res - resources • drawables – images for layouts • layout –user interface * • values – string.xml – styles.xml – dimens.xml - colors
  • 101. layout/Folder Activity_Main.xml <TextView android:layout_width=“wrap_content” android:layout_height=“wrap_content” android:text=“@string/”hello world”
  • 102. valuesFolder Strings.xml <resourses> <string name=“Hello world”> Hello world </string>
  • 105. JD-GUI
  • 110. for - if - else
  • 111. password after 5 iterations