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

Android Implementation Issues

Part 3
Topics
• Part 1
• Reviewing Pre-installed Applications
• Exploiting Devices
• Start through "Explanation of Privilege
Levels" (up to p. 402)
Topics
• Part 2
• Exploiting Devices
• "Practical Physical Attacks" (p. 375)
through
• "Polaris Viewer Memory Corruption" (up to
p. 401)
Topics
• Part 3
• Exploiting Devices
• "Injecting Exploits for JavaScript
Interfaces" (p. 401) and following
• Infiltrating User Data
Exploiting Devices
Injecting Exploits for
JavaScript Interfaces
• Attacking Sony Xperia
• An app loads ads over HTTP
• Drozer and Burp used to inject code
Injecting a Drozer Agent
• Adds this code to the page
Custom Application
Updates
• Some apps manage their own update
• Rather than relying on Google Play
• Apps can install their own updates if they have
the INSTALL_PACKAGES permission
• Often downloaded via HTTP
• Allowing MITM update modifications
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
pwn://
• To invoke the installed Drozer agent
• Inject HTML code that loads a page with a URI
starting with pwn://
BROWSABLE URI Injection
• Samsung's UniversalMDMClient app has this
intent filter

• Any package can be installed by invoking this
URI:
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
Malware
• Two scenarios
• Improving the drive-by download attack with
social engineering
• Using a zero permission app to install
additional package
Drive-By Downloads
• Android apps that automatically download
when you visit a site
• A message like this tricks the user:
• Missing Plug-in
• App Update Required
Unknown Sources
• In Android 7 and
earlier,
• Must enable
"Unknown
Sources" in
settings
• To use a
Package
Installer ctivity
on apps not from
Google Play
Android 8 or Higher
• Permissions configured on a per-app basis
• Link Ch 8h
Automatic Launching
• RECEIVE_BOOT_COMPLETED permission
in an app's manifest
• Allows app to start when phone boots up
• Reliable on Android versions before 3.1
• But must wait for a reboot
• Loading an iframe with src="pwn://lol" is
faster
Automatic Launching
• Since Android 3.1
• Newly installed apps won't receive the
BOOT_COMPLETED intent
• Unless a component has been invoked by
the user
• So this method is less common
Android 4.4
• Chrome won't download an APK
automatically
• Attacker must trick user into downloading it
• It won't launch from an iframe either
• Must trick the user into clicking something to
launch it (see next slide)
Social Engineering
Requesting Zero
Permissions
• An app may request no permissions
• Then abuse vulnerabilities to install
additional packages, etc.
• This is called "breaking out of the sandbox"
• One way: use kernel exploits
Samsung Galaxy S3
Command Injection
• App constructed a command-line including
user input, and ran it as system
• PoC exploit to write to SD card
ObjectInputStream
• Can be used to escalate privileges in Android
before 5
• Link Ch 8i
Jeff Forristal
• aka Rain Forest Puppy
• Discovered SQL injection in 1998
• Link Ch 8j
• Presented "Fake ID" vuln at Black Hat In 2014
Fake ID Vulnerability
• Android's functions to verify that a certificate was
actually signed by its issuer were missing
• Any App's certificate could claim to be from any
issuer
• Setting issuer field to Adobe Systems
Incorporated allowed privilege escalation in
Android 4.3 and earlier
• After that the WebView plug-in code was changed
Infiltrating User Data
Existing Drozer Modules
• Record Microphone
• Read and Send SMS Messages
• Read Contacts
• Capture Location, from GPS or Wi-Fi hotspots
• Screenshot or video record screen
Disabling SELinux
Enforcement
Recorded
Video
Stealing Files from the
SD Card
• On Android 4.3 and earlier, every user had
access to the SD card
• Since Android 4.4, it requires
READ_EXTERNAL_STORAGE permission
Extracting Wi-Fi Keys
• Requires root or system access
User Accounts
• Gmail account tokens stored in sqlite database
• Not passwords for Google (link Ch 8k)
User Accounts
• Third-party apps may store plaintext
passwords in accounts.db files
• Or files with similar names
• Especially email clients using old POP3 or
SMTP protocols
Cracking Patterns, PINs,
and Passwords
• /data/system/gesture.key
• Cracker at link Ch 8l
• /data/system/password.key
• Crack with Python (Proj 12x)
Reading Extended
Clipboards
• Any app with Context can read the clipboards
• Password managers put passwords in it
• Extended clipboard
• Stores the last 20 items
• Very useful for an attacker
• Samsung saves them in /data/clipboard/
• But it's not persent in Genymotion
Simulating User Interaction
• input command can send keyboard presses, etc.
Forcing a Tap
• adb shell dumpsys window | grep creen
• shows screen dimensions
Forcing a Tap
• adb shell input tap 800 975
• Launches Drozer :)
Extracting Application Data
with Physical Access
• adb backup -all -shared
• Gets all user and app data
• From apps that do not have allowBackup
set to false in their manifest
• And all data from the SD card
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)

More Related Content

What's hot (20)

PDF
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
Sam Bowne
 
PDF
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
Sam Bowne
 
PDF
CNIT 128 2. Analyzing iOS Applications (Part 1)
Sam Bowne
 
PDF
CNIT 128 6. Analyzing Android Applications (Part 2 of 3)
Sam Bowne
 
PDF
CNIT 128 7. Attacking Android Applications (Part 2)
Sam Bowne
 
PDF
Android Security
Lars Jacobs
 
PDF
Hacking Tizen: The OS of everything - Whitepaper
Ajin Abraham
 
PDF
Abusing, Exploiting and Pwning with Firefox Add-ons
Ajin Abraham
 
PDF
Android Security
Mehrnaz Amoon
 
PPTX
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Ajin Abraham
 
PPTX
Permission in Android Security: Threats and solution
Tandhy Simanjuntak
 
PPT
iOS Hacking: Advanced Pentest & Forensic Techniques
Ömer Coşkun
 
PDF
OWASP Melbourne - Introduction to iOS Application Penetration Testing
eightbit
 
PPTX
Hacking and securing ios applications
Satish b
 
PDF
iOS Application Penetration Testing
n|u - The Open Security Community
 
PDF
Hacking and Securing iOS Apps : Part 1
Subhransu Behera
 
PPTX
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
Ajin Abraham
 
PDF
Shellcoding in linux
Ajin Abraham
 
PPTX
iOS-Application-Security-iAmPr3m
Prem Kumar (OSCP)
 
PDF
Yow connected developing secure i os applications
mgianarakis
 
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
Sam Bowne
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
Sam Bowne
 
CNIT 128 2. Analyzing iOS Applications (Part 1)
Sam Bowne
 
CNIT 128 6. Analyzing Android Applications (Part 2 of 3)
Sam Bowne
 
CNIT 128 7. Attacking Android Applications (Part 2)
Sam Bowne
 
Android Security
Lars Jacobs
 
Hacking Tizen: The OS of everything - Whitepaper
Ajin Abraham
 
Abusing, Exploiting and Pwning with Firefox Add-ons
Ajin Abraham
 
Android Security
Mehrnaz Amoon
 
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Ajin Abraham
 
Permission in Android Security: Threats and solution
Tandhy Simanjuntak
 
iOS Hacking: Advanced Pentest & Forensic Techniques
Ömer Coşkun
 
OWASP Melbourne - Introduction to iOS Application Penetration Testing
eightbit
 
Hacking and securing ios applications
Satish b
 
iOS Application Penetration Testing
n|u - The Open Security Community
 
Hacking and Securing iOS Apps : Part 1
Subhransu Behera
 
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
Ajin Abraham
 
Shellcoding in linux
Ajin Abraham
 
iOS-Application-Security-iAmPr3m
Prem Kumar (OSCP)
 
Yow connected developing secure i os applications
mgianarakis
 

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

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 8. Identifying and Exploiting Android Implementation Issues (Part 1)
Sam Bowne
 
PDF
CNIT 128: Android Implementation Issues (Part 2)
Sam Bowne
 
PPTX
128-ch4.pptx
SankalpKabra
 
PDF
8 Android Implementation Issues (Part 1)
Sam Bowne
 
PDF
CNIT 128 Ch 4: Android
Sam Bowne
 
PDF
CNIT 128 7. Attacking Android Applications (Part 3)
Sam Bowne
 
PDF
9 Writing Secure Android Applications
Sam Bowne
 
PDF
7. Attacking Android Applications (Part 2)
Sam Bowne
 
PDF
Pentesting Mobile Applications (Prashant Verma)
ClubHack
 
PDF
6 Analyzing Android Applications (Part 2)
Sam Bowne
 
PPTX
Android Penetration Testing - Day 3
Mohammed Adam
 
PPTX
Mobile security
priyanka pandey
 
PDF
Ch 13: Attacking Users: Other Techniques (Part 2)
Sam Bowne
 
PPT
Mobile code mining for discovery and exploits nullcongoa2013
Blueinfy Solutions
 
PDF
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
Sam Bowne
 
PPTX
Android overview
Mostofa Kamal Rasel Rasel
 
PPTX
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council
 
PDF
CNIT 128 Ch 3: iOS
Sam Bowne
 
CNIT 128 8. Android Implementation Issues (Part 3)
Sam Bowne
 
CNIT 128 8. Android Implementation Issues (Part 2)
Sam Bowne
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
Sam Bowne
 
CNIT 128: Android Implementation Issues (Part 2)
Sam Bowne
 
128-ch4.pptx
SankalpKabra
 
8 Android Implementation Issues (Part 1)
Sam Bowne
 
CNIT 128 Ch 4: Android
Sam Bowne
 
CNIT 128 7. Attacking Android Applications (Part 3)
Sam Bowne
 
9 Writing Secure Android Applications
Sam Bowne
 
7. Attacking Android Applications (Part 2)
Sam Bowne
 
Pentesting Mobile Applications (Prashant Verma)
ClubHack
 
6 Analyzing Android Applications (Part 2)
Sam Bowne
 
Android Penetration Testing - Day 3
Mohammed Adam
 
Mobile security
priyanka pandey
 
Ch 13: Attacking Users: Other Techniques (Part 2)
Sam Bowne
 
Mobile code mining for discovery and exploits nullcongoa2013
Blueinfy Solutions
 
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
Sam Bowne
 
Android overview
Mostofa Kamal Rasel Rasel
 
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council
 
CNIT 128 Ch 3: iOS
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
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 1)
Sam Bowne
 
PDF
5. Stream Ciphers
Sam Bowne
 
PDF
6 Scope & 7 Live Data Collection
Sam Bowne
 
PDF
4. Block Ciphers
Sam Bowne
 
PDF
4 Getting Started & 5 Leads
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
 
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 1)
Sam Bowne
 
5. Stream Ciphers
Sam Bowne
 
6 Scope & 7 Live Data Collection
Sam Bowne
 
4. Block Ciphers
Sam Bowne
 
4 Getting Started & 5 Leads
Sam Bowne
 
Ad

Recently uploaded (20)

PDF
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
PPTX
Urban Hierarchy and Service Provisions.pptx
Islamic University of Bangladesh
 
PPTX
How to Add New Item in CogMenu in Odoo 18
Celine George
 
DOCX
ANNOTATION on objective 10 on pmes 2022-2025
joviejanesegundo1
 
PDF
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
PPTX
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
PPTX
Iván Bornacelly - Presentation of the report - Empowering the workforce in th...
EduSkills OECD
 
PDF
Rapid Mathematics Assessment Score sheet for all Grade levels
DessaCletSantos
 
PDF
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
PPTX
SYMPATHOMIMETICS[ADRENERGIC AGONISTS] pptx
saip95568
 
PDF
COM and NET Component Services 1st Edition Juval Löwy
kboqcyuw976
 
PDF
Our Guide to the July 2025 USPS® Rate Change
Postal Advocate Inc.
 
PDF
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
 
PPTX
How to use _name_search() method in Odoo 18
Celine George
 
PPTX
ENGLISH -PPT- Week1 Quarter1 -day-1.pptx
garcialhavz
 
PDF
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 
PPTX
ESP 10 Edukasyon sa Pagpapakatao PowerPoint Lessons Quarter 1.pptx
Sir J.
 
PPTX
How Physics Enhances Our Quality of Life.pptx
AngeliqueTolentinoDe
 
PDF
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
PPT
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
Urban Hierarchy and Service Provisions.pptx
Islamic University of Bangladesh
 
How to Add New Item in CogMenu in Odoo 18
Celine George
 
ANNOTATION on objective 10 on pmes 2022-2025
joviejanesegundo1
 
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
Iván Bornacelly - Presentation of the report - Empowering the workforce in th...
EduSkills OECD
 
Rapid Mathematics Assessment Score sheet for all Grade levels
DessaCletSantos
 
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
SYMPATHOMIMETICS[ADRENERGIC AGONISTS] pptx
saip95568
 
COM and NET Component Services 1st Edition Juval Löwy
kboqcyuw976
 
Our Guide to the July 2025 USPS® Rate Change
Postal Advocate Inc.
 
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
 
How to use _name_search() method in Odoo 18
Celine George
 
ENGLISH -PPT- Week1 Quarter1 -day-1.pptx
garcialhavz
 
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 
ESP 10 Edukasyon sa Pagpapakatao PowerPoint Lessons Quarter 1.pptx
Sir J.
 
How Physics Enhances Our Quality of Life.pptx
AngeliqueTolentinoDe
 
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 

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

  • 1. CNIT 128 Hacking Mobile Devices 8. Identifying and Exploiting 
 Android Implementation Issues Part 3
  • 2. Topics • Part 1 • Reviewing Pre-installed Applications • Exploiting Devices • Start through "Explanation of Privilege Levels" (up to p. 402)
  • 3. Topics • Part 2 • Exploiting Devices • "Practical Physical Attacks" (p. 375) through • "Polaris Viewer Memory Corruption" (up to p. 401)
  • 4. Topics • Part 3 • Exploiting Devices • "Injecting Exploits for JavaScript Interfaces" (p. 401) and following • Infiltrating User Data
  • 6. Injecting Exploits for JavaScript Interfaces • Attacking Sony Xperia • An app loads ads over HTTP • Drozer and Burp used to inject code
  • 7. Injecting a Drozer Agent • Adds this code to the page
  • 8. Custom Application Updates • Some apps manage their own update • Rather than relying on Google Play • Apps can install their own updates if they have the INSTALL_PACKAGES permission • Often downloaded via HTTP • Allowing MITM update modifications
  • 10. pwn:// • To invoke the installed Drozer agent • Inject HTML code that loads a page with a URI starting with pwn://
  • 11. BROWSABLE URI Injection • Samsung's UniversalMDMClient app has this intent filter
 • Any package can be installed by invoking this URI:
  • 13. Malware • Two scenarios • Improving the drive-by download attack with social engineering • Using a zero permission app to install additional package
  • 14. Drive-By Downloads • Android apps that automatically download when you visit a site • A message like this tricks the user: • Missing Plug-in • App Update Required
  • 15. Unknown Sources • In Android 7 and earlier, • Must enable "Unknown Sources" in settings • To use a Package Installer ctivity on apps not from Google Play
  • 16. Android 8 or Higher • Permissions configured on a per-app basis • Link Ch 8h
  • 17. Automatic Launching • RECEIVE_BOOT_COMPLETED permission in an app's manifest • Allows app to start when phone boots up • Reliable on Android versions before 3.1 • But must wait for a reboot • Loading an iframe with src="pwn://lol" is faster
  • 18. Automatic Launching • Since Android 3.1 • Newly installed apps won't receive the BOOT_COMPLETED intent • Unless a component has been invoked by the user • So this method is less common
  • 19. Android 4.4 • Chrome won't download an APK automatically • Attacker must trick user into downloading it • It won't launch from an iframe either • Must trick the user into clicking something to launch it (see next slide)
  • 21. Requesting Zero Permissions • An app may request no permissions • Then abuse vulnerabilities to install additional packages, etc. • This is called "breaking out of the sandbox" • One way: use kernel exploits
  • 22. Samsung Galaxy S3 Command Injection • App constructed a command-line including user input, and ran it as system • PoC exploit to write to SD card
  • 23. ObjectInputStream • Can be used to escalate privileges in Android before 5 • Link Ch 8i
  • 24. Jeff Forristal • aka Rain Forest Puppy • Discovered SQL injection in 1998 • Link Ch 8j • Presented "Fake ID" vuln at Black Hat In 2014
  • 25. Fake ID Vulnerability • Android's functions to verify that a certificate was actually signed by its issuer were missing • Any App's certificate could claim to be from any issuer • Setting issuer field to Adobe Systems Incorporated allowed privilege escalation in Android 4.3 and earlier • After that the WebView plug-in code was changed
  • 27. Existing Drozer Modules • Record Microphone • Read and Send SMS Messages • Read Contacts • Capture Location, from GPS or Wi-Fi hotspots • Screenshot or video record screen
  • 30. Stealing Files from the SD Card • On Android 4.3 and earlier, every user had access to the SD card • Since Android 4.4, it requires READ_EXTERNAL_STORAGE permission
  • 31. Extracting Wi-Fi Keys • Requires root or system access
  • 32. User Accounts • Gmail account tokens stored in sqlite database • Not passwords for Google (link Ch 8k)
  • 33. User Accounts • Third-party apps may store plaintext passwords in accounts.db files • Or files with similar names • Especially email clients using old POP3 or SMTP protocols
  • 34. Cracking Patterns, PINs, and Passwords • /data/system/gesture.key • Cracker at link Ch 8l • /data/system/password.key • Crack with Python (Proj 12x)
  • 35. Reading Extended Clipboards • Any app with Context can read the clipboards • Password managers put passwords in it • Extended clipboard • Stores the last 20 items • Very useful for an attacker • Samsung saves them in /data/clipboard/ • But it's not persent in Genymotion
  • 36. Simulating User Interaction • input command can send keyboard presses, etc.
  • 37. Forcing a Tap • adb shell dumpsys window | grep creen • shows screen dimensions
  • 38. Forcing a Tap • adb shell input tap 800 975 • Launches Drozer :)
  • 39. Extracting Application Data with Physical Access • adb backup -all -shared • Gets all user and app data • From apps that do not have allowBackup set to false in their manifest • And all data from the SD card