SlideShare a Scribd company logo
CNIT 128
Hacking Mobile Devices
8. Identifying and Exploiting 

Android Implementation Issues

Part 2
Topics
• Part 1
• Reviewing Pre-installed Applications
• Exploiting Devices
• Start through "Explanation of Privilege
Levels" (up to p. 375)
Topics
• Part 2
• Exploiting Devices
• "Practical Physical Attacks" (p. 376)
through
• "Man-in-the-Middle Exploits" (up to p. 401)
Topics
• Part 3
• Exploiting Devices
• "Injecting Exploits for JavaScript
Interfaces" (p. 401) and following
• Infiltrating User Data
Reviewing Pre-Installed
Applications
Root Access
• Each installed app has its own attack surface
• But when you exploit an app, you get access
with the privileges of that app
• Not root access
• But you can often exfiltrate user data without
root access
Find Powerful Apps
INSTALL PACKAGES
• Exploiting an app with this permission allows
an attacker to install a Trojan app
• Permission level signature|system
• Defined by the android package
Drozer on an Emulator
• Real devices have many more apps with this
dangerous permission
Apps Running as System
• On an emulator
• Many more on a real device (66 in book)
Finding Remote Attack
Vectors
Techniques
• Trick user into installing a malicious app
• Server-side: exploit a listening port
• Client-side: open a malicious document
Browsers and Document
Readers
• Frequently vulnerable
• Complex parsers written in native code
• Fuzzers can fund vulnerabilities
• Samsung has Polaris Viewer for PDFs by
default
• No PDF reader on my emulator
BROWSEABLE Activities
• Allows users to open content inside an
installed app rather than the browser
• App stores installed on the device use this
functionality
• To open links that point to apps
Manifest
• From a rogue Drozer agent
• Opening a link starting with pwn:// will open
this activity
• But not in an iframe anymore
<activity
android:name="com.mwr.dz.PwnActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="pwn" />
</intent-filter>
</activity>
Two Methods
• Via pwn:// URI or "web intent"
<a href="pwn://me">Start drozer<a>
<a href="intent://me/#Intent;scheme=pwn;end">

Start Drozer</a>
Many apps use
BROWSABLE
filters on my
emulator
Custom Update
Mechanisms
• Apps often write their own update mechanisms
• Rather than using the Play Store
• This requires the INSTALL_PACKAGES
permission
• Code may be vulnerable
• May check for a new file over HTTP or
broken HTTPS
Remote Loading of Code
• Link Ch 8b
Remote Loading of Code
• Apps can load new code at runtime
• Using the Java Reflection API
• With the DexClassLoader class
• May load code over the network, or from a
local location that can be overwritten by
other applications
• May cause code injection vulnerabilities
WebViews
• Recipe for disaster
• Using a WebView
• Defining a JavaScript interface
• Loading from a cleartext source or having
SSL bypass code
• Targeting API versions prior to 17 or using
an Android version earlier than 4.2
• May allow JavaScript code injection
Listening Services
• Android is unlikely to have listening ports
• My Genymotion has a few
Messaging Applications
• Examples, may be vulnerable
• Short Message Service (SMS)
• Multimedia Messaging Service (MMS)
• Commercial Mobile Alert System (CMAS)
• Email clients
• Chat clients
Finding Local Vulnerabilities
• Manual process
• Download all installed apps
• Convert them to readable source code
• Use grep to search for vulnerabilities
• Or use Drozer's scanner modules
Drozer's SQLi Scanner
• Doesn't find the Sieve SQL injection
Exploiting Devices
Remote and Local Exploits
• Remote exploit
• Gives attacker a foothold on the device
• Such as software exploits, MITM attacks, or
malware
• Local exploit
• Requires a foothold on the device already
• Local privilege escalation
Using Attack Tools
• Performs ARP poisoning, DNS spoofing, etc.
• We're using local proxy settings
• You need ettercap to perform real MITM
attacks on a LAN
Ettercap
Burp
• Can inspect and modify traffic
• Sends fake TLS certificates
• Burp can be added as a "trusted CA"
Burp Extensions
• Supposedly you can add Python code
Burp Extensions
• But it doesn't work
• After several hours, I couldn't make any of
the useful examples work
• Scripts just fail without sending any error
messages anywhere
• It's torture
• Just ignoring Burp and writing Python scripts
outside it seems far more useful
Drozer
• Infrastructure Mode
• Runs a Drozer server, as a C&C server
• Make "rogue agents" which are like malware
• Custom-built to phone home to the Drozer
server
• Much like Metasploit
Privilege Levels
Non-System App without
Context
• Ex: a shell from a Web browser
• Attacker has privileges of the compromised
app
• Can navigate filesystem under the app's
user account
• Cannot use Java libraries
• Cannot install packages, or read SMS, etc.
Non-System App with
Context
• Attacker takes over app's execution flow and
can load arbitrary classes
• Attacker camn retrieve app Context
• Can do anything the app can do
Installed Package
• Can request arbitrary permissions
• Can be granted them, depending on
protection level
ADB Shell Access
• Can install apps
• Can interact with apps as a developer
System User Access
• Running as system user, can
• Install apps
• Change device configuration
• Access data from any app's private directory
Root User Access
• Ultimate power, can
• Install apps
• Read and write RAM
• Manipulate any aspect of the device
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)

More Related Content

What's hot (20)

PDF
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
Sam Bowne
 
PPTX
OWASP Zed Attack Proxy
Fadi Abdulwahab
 
PDF
CNIT 128: Android Implementation Issues (Part 2)
Sam Bowne
 
PPTX
Zap vs burp
Tomasz Fajks
 
PDF
Abusing bleeding edge web standards for appsec glory
Priyanka Aash
 
PPTX
Sticky Keys to the Kingdom
Dennis Maldonado
 
PDF
Abusing, Exploiting and Pwning with Firefox Add-ons
Ajin Abraham
 
PPTX
From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg...
Imperva Incapsula
 
PDF
My tryst with sourcecode review
Anant Shrivastava
 
PDF
CNIT 126: Ch 2 & 3
Sam Bowne
 
PDF
Zed Attack Proxy (ZAP)
JAINAM KAPADIYA
 
PDF
Using the Zed Attack Proxy as a Web App testing tool
David Sweigert
 
PPTX
Abusing Exploiting and Pwning with Firefox Addons
Ajin Abraham
 
PDF
Security Automation using ZAP
Vaibhav Gupta
 
PPTX
DC612 Day - Hands on Penetration Testing 101
dc612
 
PPTX
Outlook and Exchange for the bad guys
Nick Landers
 
PDF
Security Testing using ZAP in SFDC
Thinqloud
 
PDF
Hunting for the secrets in a cloud forest
SecuRing
 
PDF
Tale of Forgotten Disclosure and Lesson learned
Anant Shrivastava
 
PDF
Owasp zap
ColdFusionConference
 
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
Sam Bowne
 
OWASP Zed Attack Proxy
Fadi Abdulwahab
 
CNIT 128: Android Implementation Issues (Part 2)
Sam Bowne
 
Zap vs burp
Tomasz Fajks
 
Abusing bleeding edge web standards for appsec glory
Priyanka Aash
 
Sticky Keys to the Kingdom
Dennis Maldonado
 
Abusing, Exploiting and Pwning with Firefox Add-ons
Ajin Abraham
 
From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg...
Imperva Incapsula
 
My tryst with sourcecode review
Anant Shrivastava
 
CNIT 126: Ch 2 & 3
Sam Bowne
 
Zed Attack Proxy (ZAP)
JAINAM KAPADIYA
 
Using the Zed Attack Proxy as a Web App testing tool
David Sweigert
 
Abusing Exploiting and Pwning with Firefox Addons
Ajin Abraham
 
Security Automation using ZAP
Vaibhav Gupta
 
DC612 Day - Hands on Penetration Testing 101
dc612
 
Outlook and Exchange for the bad guys
Nick Landers
 
Security Testing using ZAP in SFDC
Thinqloud
 
Hunting for the secrets in a cloud forest
SecuRing
 
Tale of Forgotten Disclosure and Lesson learned
Anant Shrivastava
 

Similar to CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1) (20)

PDF
8 Android Implementation Issues (Part 1)
Sam Bowne
 
PDF
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
Sam Bowne
 
PDF
CNIT 128 8. Android Implementation Issues (Part 3)
Sam Bowne
 
PDF
CNIT 128 8. Android Implementation Issues (Part 2)
Sam Bowne
 
PDF
CNIT 128 7. Attacking Android Applications (Part 2)
Sam Bowne
 
PDF
CNIT 128 7. Attacking Android Applications (Part 2)
Sam Bowne
 
PPTX
Android Application Penetration Testing - Mohammed Adam
Mohammed Adam
 
PDF
Android Pentesting
n|u - The Open Security Community
 
PPT
Securely Deploying Android Device - ISSA (Ireland)
Angelill0
 
PPTX
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council
 
PDF
Building Custom Android Malware BruCON 2013
Stephan Chenette
 
PDF
Android malware presentation
Sandeep Joshi
 
PDF
Hacking your Android (slides)
Justin Hoang
 
PPTX
Mobile application security
Shubhneet Goel
 
PPTX
Mobile Application Security
Ishan Girdhar
 
PDF
CNIT 128 7. Attacking Android Applications (Part 3)
Sam Bowne
 
PDF
CNIT 128 7. Attacking Android Applications (Part 3)
Sam Bowne
 
PDF
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)
Sam Bowne
 
PDF
CNIT 128 7. Attacking Android Applications (Part 1)
Sam Bowne
 
PDF
7. Attacking Android Applications (Part 1)
Sam Bowne
 
8 Android Implementation Issues (Part 1)
Sam Bowne
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
Sam Bowne
 
CNIT 128 8. Android Implementation Issues (Part 3)
Sam Bowne
 
CNIT 128 8. Android Implementation Issues (Part 2)
Sam Bowne
 
CNIT 128 7. Attacking Android Applications (Part 2)
Sam Bowne
 
CNIT 128 7. Attacking Android Applications (Part 2)
Sam Bowne
 
Android Application Penetration Testing - Mohammed Adam
Mohammed Adam
 
Securely Deploying Android Device - ISSA (Ireland)
Angelill0
 
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council
 
Building Custom Android Malware BruCON 2013
Stephan Chenette
 
Android malware presentation
Sandeep Joshi
 
Hacking your Android (slides)
Justin Hoang
 
Mobile application security
Shubhneet Goel
 
Mobile Application Security
Ishan Girdhar
 
CNIT 128 7. Attacking Android Applications (Part 3)
Sam Bowne
 
CNIT 128 7. Attacking Android Applications (Part 3)
Sam Bowne
 
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)
Sam Bowne
 
CNIT 128 7. Attacking Android Applications (Part 1)
Sam Bowne
 
7. Attacking Android Applications (Part 1)
Sam Bowne
 
Ad

More from Sam Bowne (20)

PDF
Introduction to the Class & CISSP Certification
Sam Bowne
 
PDF
Cyberwar
Sam Bowne
 
PDF
3: DNS vulnerabilities
Sam Bowne
 
PDF
8. Software Development Security
Sam Bowne
 
PDF
4 Mapping the Application
Sam Bowne
 
PDF
3. Attacking iOS Applications (Part 2)
Sam Bowne
 
PDF
12 Elliptic Curves
Sam Bowne
 
PDF
11. Diffie-Hellman
Sam Bowne
 
PDF
2a Analyzing iOS Apps Part 1
Sam Bowne
 
PDF
9 Writing Secure Android Applications
Sam Bowne
 
PDF
12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne
 
PDF
10 RSA
Sam Bowne
 
PDF
12 Investigating Windows Systems (Part 1 of 3
Sam Bowne
 
PDF
9. Hard Problems
Sam Bowne
 
PDF
11 Analysis Methodology
Sam Bowne
 
PDF
8. Authenticated Encryption
Sam Bowne
 
PDF
7. Attacking Android Applications (Part 2)
Sam Bowne
 
PDF
5. Stream Ciphers
Sam Bowne
 
PDF
6 Scope & 7 Live Data Collection
Sam Bowne
 
PDF
4. Block Ciphers
Sam Bowne
 
Introduction to the Class & CISSP Certification
Sam Bowne
 
Cyberwar
Sam Bowne
 
3: DNS vulnerabilities
Sam Bowne
 
8. Software Development Security
Sam Bowne
 
4 Mapping the Application
Sam Bowne
 
3. Attacking iOS Applications (Part 2)
Sam Bowne
 
12 Elliptic Curves
Sam Bowne
 
11. Diffie-Hellman
Sam Bowne
 
2a Analyzing iOS Apps Part 1
Sam Bowne
 
9 Writing Secure Android Applications
Sam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne
 
10 RSA
Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
Sam Bowne
 
9. Hard Problems
Sam Bowne
 
11 Analysis Methodology
Sam Bowne
 
8. Authenticated Encryption
Sam Bowne
 
7. Attacking Android Applications (Part 2)
Sam Bowne
 
5. Stream Ciphers
Sam Bowne
 
6 Scope & 7 Live Data Collection
Sam Bowne
 
4. Block Ciphers
Sam Bowne
 
Ad

Recently uploaded (20)

DOCX
ANNOTATION on objective 10 on pmes 2022-2025
joviejanesegundo1
 
PPTX
Aerobic and Anaerobic respiration and CPR.pptx
Olivier Rochester
 
PDF
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
PPTX
JSON, XML and Data Science introduction.pptx
Ramakrishna Reddy Bijjam
 
PPTX
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
 
PPTX
A Case of Identity A Sociological Approach Fix.pptx
Ismail868386
 
PDF
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
PDF
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
PDF
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
 
PPTX
ESP 10 Edukasyon sa Pagpapakatao PowerPoint Lessons Quarter 1.pptx
Sir J.
 
PPTX
How to Setup Automatic Reordering Rule in Odoo 18 Inventory
Celine George
 
PPTX
Urban Hierarchy and Service Provisions.pptx
Islamic University of Bangladesh
 
PPTX
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
 
DOCX
DLL english grade five goof for one week
FlordelynGonzales1
 
PPTX
Elo the HeroTHIS IS A STORY ABOUT A BOY WHO SAVED A LITTLE GOAT .pptx
JoyIPanos
 
PPTX
How to use grouped() method in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Configure Taxes in Company Currency in Odoo 18 Accounting
Celine George
 
PPTX
Project 4 PART 1 AI Assistant Vocational Education
barmanjit380
 
PPTX
Martyrs of Ireland - who kept the faith of St. Patrick.pptx
Martin M Flynn
 
PPT
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
ANNOTATION on objective 10 on pmes 2022-2025
joviejanesegundo1
 
Aerobic and Anaerobic respiration and CPR.pptx
Olivier Rochester
 
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
JSON, XML and Data Science introduction.pptx
Ramakrishna Reddy Bijjam
 
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
 
A Case of Identity A Sociological Approach Fix.pptx
Ismail868386
 
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
 
ESP 10 Edukasyon sa Pagpapakatao PowerPoint Lessons Quarter 1.pptx
Sir J.
 
How to Setup Automatic Reordering Rule in Odoo 18 Inventory
Celine George
 
Urban Hierarchy and Service Provisions.pptx
Islamic University of Bangladesh
 
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
 
DLL english grade five goof for one week
FlordelynGonzales1
 
Elo the HeroTHIS IS A STORY ABOUT A BOY WHO SAVED A LITTLE GOAT .pptx
JoyIPanos
 
How to use grouped() method in Odoo 18 - Odoo Slides
Celine George
 
How to Configure Taxes in Company Currency in Odoo 18 Accounting
Celine George
 
Project 4 PART 1 AI Assistant Vocational Education
barmanjit380
 
Martyrs of Ireland - who kept the faith of St. Patrick.pptx
Martin M Flynn
 
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 

CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)

  • 1. CNIT 128 Hacking Mobile Devices 8. Identifying and Exploiting 
 Android Implementation Issues Part 2
  • 2. Topics • Part 1 • Reviewing Pre-installed Applications • Exploiting Devices • Start through "Explanation of Privilege Levels" (up to p. 375)
  • 3. Topics • Part 2 • Exploiting Devices • "Practical Physical Attacks" (p. 376) through • "Man-in-the-Middle Exploits" (up to p. 401)
  • 4. Topics • Part 3 • Exploiting Devices • "Injecting Exploits for JavaScript Interfaces" (p. 401) and following • Infiltrating User Data
  • 6. Root Access • Each installed app has its own attack surface • But when you exploit an app, you get access with the privileges of that app • Not root access • But you can often exfiltrate user data without root access
  • 8. INSTALL PACKAGES • Exploiting an app with this permission allows an attacker to install a Trojan app • Permission level signature|system • Defined by the android package
  • 9. Drozer on an Emulator • Real devices have many more apps with this dangerous permission
  • 10. Apps Running as System • On an emulator • Many more on a real device (66 in book)
  • 12. Techniques • Trick user into installing a malicious app • Server-side: exploit a listening port • Client-side: open a malicious document
  • 13. Browsers and Document Readers • Frequently vulnerable • Complex parsers written in native code • Fuzzers can fund vulnerabilities • Samsung has Polaris Viewer for PDFs by default • No PDF reader on my emulator
  • 14. BROWSEABLE Activities • Allows users to open content inside an installed app rather than the browser • App stores installed on the device use this functionality • To open links that point to apps
  • 15. Manifest • From a rogue Drozer agent • Opening a link starting with pwn:// will open this activity • But not in an iframe anymore <activity android:name="com.mwr.dz.PwnActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="pwn" /> </intent-filter> </activity>
  • 16. Two Methods • Via pwn:// URI or "web intent" <a href="pwn://me">Start drozer<a> <a href="intent://me/#Intent;scheme=pwn;end">
 Start Drozer</a>
  • 18. Custom Update Mechanisms • Apps often write their own update mechanisms • Rather than using the Play Store • This requires the INSTALL_PACKAGES permission • Code may be vulnerable • May check for a new file over HTTP or broken HTTPS
  • 19. Remote Loading of Code • Link Ch 8b
  • 20. Remote Loading of Code • Apps can load new code at runtime • Using the Java Reflection API • With the DexClassLoader class • May load code over the network, or from a local location that can be overwritten by other applications • May cause code injection vulnerabilities
  • 21. WebViews • Recipe for disaster • Using a WebView • Defining a JavaScript interface • Loading from a cleartext source or having SSL bypass code • Targeting API versions prior to 17 or using an Android version earlier than 4.2 • May allow JavaScript code injection
  • 22. Listening Services • Android is unlikely to have listening ports • My Genymotion has a few
  • 23. Messaging Applications • Examples, may be vulnerable • Short Message Service (SMS) • Multimedia Messaging Service (MMS) • Commercial Mobile Alert System (CMAS) • Email clients • Chat clients
  • 24. Finding Local Vulnerabilities • Manual process • Download all installed apps • Convert them to readable source code • Use grep to search for vulnerabilities • Or use Drozer's scanner modules
  • 25. Drozer's SQLi Scanner • Doesn't find the Sieve SQL injection
  • 27. Remote and Local Exploits • Remote exploit • Gives attacker a foothold on the device • Such as software exploits, MITM attacks, or malware • Local exploit • Requires a foothold on the device already • Local privilege escalation
  • 29. • Performs ARP poisoning, DNS spoofing, etc. • We're using local proxy settings • You need ettercap to perform real MITM attacks on a LAN Ettercap
  • 30. Burp • Can inspect and modify traffic • Sends fake TLS certificates • Burp can be added as a "trusted CA"
  • 31. Burp Extensions • Supposedly you can add Python code
  • 32. Burp Extensions • But it doesn't work • After several hours, I couldn't make any of the useful examples work • Scripts just fail without sending any error messages anywhere • It's torture • Just ignoring Burp and writing Python scripts outside it seems far more useful
  • 33. Drozer • Infrastructure Mode • Runs a Drozer server, as a C&C server • Make "rogue agents" which are like malware • Custom-built to phone home to the Drozer server • Much like Metasploit
  • 35. Non-System App without Context • Ex: a shell from a Web browser • Attacker has privileges of the compromised app • Can navigate filesystem under the app's user account • Cannot use Java libraries • Cannot install packages, or read SMS, etc.
  • 36. Non-System App with Context • Attacker takes over app's execution flow and can load arbitrary classes • Attacker camn retrieve app Context • Can do anything the app can do
  • 37. Installed Package • Can request arbitrary permissions • Can be granted them, depending on protection level
  • 38. ADB Shell Access • Can install apps • Can interact with apps as a developer
  • 39. System User Access • Running as system user, can • Install apps • Change device configuration • Access data from any app's private directory
  • 40. Root User Access • Ultimate power, can • Install apps • Read and write RAM • Manipulate any aspect of the device