SlideShare a Scribd company logo
CNIT 128


Hacking Mobile Devices
8. Identifying and Exploiting 

Android Implementation Issues

Part 3 Updated 4-7-2021
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
• If an app loads content over HTTP


• And is running on Android SDK 16 or lower


• A MitM attacker can inject JavaScript code


• Which will exploit a code injection vulnerability


• And use the app as an agent to mount further
attacks
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. 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. 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 install from
an APK file,
not Google
Play
Android 8 or Higher
• Permissions configured on a per-app basis


• https://www.theandroidsoul.com/how-to-allow-apps-installation-
from-unknown-sources-on-android-9-pie/
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
In
fi
ltrating 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
• Can capture
unlock pattern
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 (old 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 present 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. Android Implementation Issues (Part 3)

More Related Content

What's hot (20)

PDF
CNIT 128: 3. Attacking iOS Applications (Part 2)
Sam Bowne
 
PDF
CNIT 128 7. Attacking Android Applications (Part 3)
Sam Bowne
 
PDF
CNIT 128 8. Android Implementation Issues (Part 2)
Sam Bowne
 
PDF
6. Analyzing Android Applications Part 2
Sam Bowne
 
PDF
CNIT 128: Android Implementation Issues (Part 2)
Sam Bowne
 
PDF
CNIT 128 7. Attacking Android Applications (Part 2)
Sam Bowne
 
PDF
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 2)
Sam Bowne
 
PDF
CNIT 128 6. Analyzing Android Applications (Part 1)
Sam Bowne
 
PDF
CNIT 126: Ch 2 & 3
Sam Bowne
 
PDF
CNIT 128 9. Writing Secure Android Applications
Sam Bowne
 
PDF
Abusing, Exploiting and Pwning with Firefox Add-ons
Ajin Abraham
 
PDF
CNIT 128 3. Attacking iOS Applications (Part 2)
Sam Bowne
 
PDF
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Sam Bowne
 
PDF
CNIT 128 2. Analyzing iOS Applications (Part 2)
Sam Bowne
 
PDF
Hacking Tizen: The OS of everything - Whitepaper
Ajin Abraham
 
PDF
CNIT 128 2. Analyzing iOS Applications (Part 1)
Sam Bowne
 
PDF
CNIT 128 3. Attacking iOS Applications (Part 1)
Sam Bowne
 
PDF
5. Identity and Access Management
Sam Bowne
 
PDF
The Dark Side of PowerShell by George Dobrea
EC-Council
 
PDF
CNIT 129S: 10: Attacking Back-End Components
Sam Bowne
 
CNIT 128: 3. Attacking iOS Applications (Part 2)
Sam Bowne
 
CNIT 128 7. Attacking Android Applications (Part 3)
Sam Bowne
 
CNIT 128 8. Android Implementation Issues (Part 2)
Sam Bowne
 
6. Analyzing Android Applications Part 2
Sam Bowne
 
CNIT 128: Android Implementation Issues (Part 2)
Sam Bowne
 
CNIT 128 7. Attacking Android Applications (Part 2)
Sam Bowne
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 2)
Sam Bowne
 
CNIT 128 6. Analyzing Android Applications (Part 1)
Sam Bowne
 
CNIT 126: Ch 2 & 3
Sam Bowne
 
CNIT 128 9. Writing Secure Android Applications
Sam Bowne
 
Abusing, Exploiting and Pwning with Firefox Add-ons
Ajin Abraham
 
CNIT 128 3. Attacking iOS Applications (Part 2)
Sam Bowne
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Sam Bowne
 
CNIT 128 2. Analyzing iOS Applications (Part 2)
Sam Bowne
 
Hacking Tizen: The OS of everything - Whitepaper
Ajin Abraham
 
CNIT 128 2. Analyzing iOS Applications (Part 1)
Sam Bowne
 
CNIT 128 3. Attacking iOS Applications (Part 1)
Sam Bowne
 
5. Identity and Access Management
Sam Bowne
 
The Dark Side of PowerShell by George Dobrea
EC-Council
 
CNIT 129S: 10: Attacking Back-End Components
Sam Bowne
 

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

PDF
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
Sam Bowne
 
PDF
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
Sam Bowne
 
PDF
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
Sam Bowne
 
PDF
8 Android Implementation Issues (Part 1)
Sam Bowne
 
PPTX
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council
 
PDF
CNIT 128 Ch 4: Android
Sam Bowne
 
PDF
Building Custom Android Malware BruCON 2013
Stephan Chenette
 
PPTX
128-ch4.pptx
SankalpKabra
 
PPT
Securely Deploying Android Device - ISSA (Ireland)
Angelill0
 
PDF
7. Attacking Android Applications (Part 2)
Sam Bowne
 
PDF
Hacking your Android (slides)
Justin Hoang
 
PDF
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
Felipe Prado
 
PDF
Deep Dive Into Android Security
Marakana Inc.
 
PDF
Hacking your Droid (Aditya Gupta)
ClubHack
 
PDF
Android malware overview, status and dilemmas
Tech and Law Center
 
PDF
ToorCon 14 : Malandroid : The Crux of Android Infections
Aditya K Sood
 
PDF
9 Writing Secure Android Applications
Sam Bowne
 
PPTX
Android Application Penetration Testing - Mohammed Adam
Mohammed Adam
 
PDF
Android Pentesting
n|u - The Open Security Community
 
PPTX
Mobile security part 1(Android Apps Pentesting)- Romansh yadav
Romansh Yadav
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
Sam Bowne
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
Sam Bowne
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
Sam Bowne
 
8 Android Implementation Issues (Part 1)
Sam Bowne
 
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council
 
CNIT 128 Ch 4: Android
Sam Bowne
 
Building Custom Android Malware BruCON 2013
Stephan Chenette
 
128-ch4.pptx
SankalpKabra
 
Securely Deploying Android Device - ISSA (Ireland)
Angelill0
 
7. Attacking Android Applications (Part 2)
Sam Bowne
 
Hacking your Android (slides)
Justin Hoang
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
Felipe Prado
 
Deep Dive Into Android Security
Marakana Inc.
 
Hacking your Droid (Aditya Gupta)
ClubHack
 
Android malware overview, status and dilemmas
Tech and Law Center
 
ToorCon 14 : Malandroid : The Crux of Android Infections
Aditya K Sood
 
9 Writing Secure Android Applications
Sam Bowne
 
Android Application Penetration Testing - Mohammed Adam
Mohammed Adam
 
Mobile security part 1(Android Apps Pentesting)- Romansh yadav
Romansh Yadav
 
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
6 Analyzing Android Applications (Part 2)
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
 
6 Analyzing Android Applications (Part 2)
Sam Bowne
 
Ad

Recently uploaded (20)

PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
Dimensions of Societal Planning in Commonism
StefanMz
 
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
community health nursing question paper 2.pdf
Prince kumar
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 

CNIT 128 8. Android Implementation Issues (Part 3)

  • 1. CNIT 128 Hacking Mobile Devices 8. Identifying and Exploiting 
 Android Implementation Issues Part 3 Updated 4-7-2021
  • 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 • If an app loads content over HTTP • And is running on Android SDK 16 or lower • A MitM attacker can inject JavaScript code • Which will exploit a code injection vulnerability • And use the app as an agent to mount further attacks
  • 7. Injecting Exploits for JavaScript Interfaces • Attacking Sony Xperia • An app loads ads over HTTP • Drozer and Burp used to inject code
  • 8. Injecting a Drozer Agent • Adds this code to the page
  • 9. 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
  • 11. pwn:// • To invoke the installed Drozer agent • Inject HTML code that loads a page with a URI starting with pwn://
  • 12. BROWSABLE URI Injection • Samsung's UniversalMDMClient app has this intent filter 
 • Any package can be installed by invoking this URI:
  • 14. Malware • Two scenarios • Improving the drive-by download attack with social engineering • Using a zero permission app to install additional package
  • 15. 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
  • 16. Unknown Sources • In Android 7 and earlier, • Must enable "Unknown Sources" in settings • To install from an APK file, not Google Play
  • 17. Android 8 or Higher • Permissions configured on a per-app basis • https://www.theandroidsoul.com/how-to-allow-apps-installation- from-unknown-sources-on-android-9-pie/
  • 18. 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
  • 19. 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
  • 20. 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)
  • 22. 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
  • 23. 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
  • 24. ObjectInputStream • Can be used to escalate privileges in Android before 5 • Link Ch 8i
  • 25. Jeff Forristal • aka Rain Forest Puppy • Discovered SQL injection in 1998 • Link Ch 8j • Presented "Fake ID" vuln at Black Hat In 2014
  • 26. 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
  • 28. 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
  • 31. 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
  • 32. Extracting Wi-Fi Keys • Requires root or system access
  • 33. User Accounts • Gmail account tokens stored in sqlite database • Not passwords for Google (link Ch 8k)
  • 34. 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
  • 35. Cracking Patterns, PINs, and Passwords • /data/system/gesture.key • Cracker at link Ch 8l • /data/system/password.key • Crack with Python (old Proj 12x)
  • 36. 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 present in Genymotion
  • 37. Simulating User Interaction • input command can send keyboard presses, etc.
  • 38. Forcing a Tap • adb shell dumpsys window | grep creen • shows screen dimensions
  • 39. Forcing a Tap • adb shell input tap 800 975 • Launches Drozer :)
  • 40. 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