SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
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
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:
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)

Weitere ähnliche Inhalte

Was ist angesagt?

Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Ajin Abraham
 
OWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration TestingOWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration Testing
eightbit
 
Hacking and securing ios applications
Hacking and securing ios applicationsHacking and securing ios applications
Hacking and securing ios applications
Satish b
 
Shellcoding in linux
Shellcoding in linuxShellcoding in linux
Shellcoding in linux
Ajin Abraham
 

Was ist angesagt? (20)

CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
 
CNIT 128 2. Analyzing iOS Applications (Part 1)
CNIT 128 2. Analyzing iOS Applications (Part 1)CNIT 128 2. Analyzing iOS Applications (Part 1)
CNIT 128 2. Analyzing iOS Applications (Part 1)
 
CNIT 128 6. Analyzing Android Applications (Part 2 of 3)
CNIT 128 6. Analyzing Android Applications (Part 2 of 3)CNIT 128 6. Analyzing Android Applications (Part 2 of 3)
CNIT 128 6. Analyzing Android Applications (Part 2 of 3)
 
CNIT 128 7. Attacking Android Applications (Part 2)
CNIT 128 7. Attacking Android Applications (Part 2)CNIT 128 7. Attacking Android Applications (Part 2)
CNIT 128 7. Attacking Android Applications (Part 2)
 
Android Security
Android SecurityAndroid Security
Android Security
 
Hacking Tizen: The OS of everything - Whitepaper
Hacking Tizen: The OS of everything - WhitepaperHacking Tizen: The OS of everything - Whitepaper
Hacking Tizen: The OS of everything - Whitepaper
 
Abusing, Exploiting and Pwning with Firefox Add-ons
Abusing, Exploiting and Pwning with Firefox Add-onsAbusing, Exploiting and Pwning with Firefox Add-ons
Abusing, Exploiting and Pwning with Firefox Add-ons
 
Android Security
Android SecurityAndroid Security
Android Security
 
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
 
Permission in Android Security: Threats and solution
Permission in Android Security: Threats and solutionPermission in Android Security: Threats and solution
Permission in Android Security: Threats and solution
 
iOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic TechniquesiOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic Techniques
 
OWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration TestingOWASP Melbourne - Introduction to iOS Application Penetration Testing
OWASP Melbourne - Introduction to iOS Application Penetration Testing
 
Hacking and securing ios applications
Hacking and securing ios applicationsHacking and securing ios applications
Hacking and securing ios applications
 
iOS Application Penetration Testing
iOS Application Penetration TestingiOS Application Penetration Testing
iOS Application Penetration Testing
 
Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1
 
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
Hacking Samsung's Tizen: The OS of Everything - Hack In the Box 2015
 
Shellcoding in linux
Shellcoding in linuxShellcoding in linux
Shellcoding in linux
 
iOS-Application-Security-iAmPr3m
iOS-Application-Security-iAmPr3miOS-Application-Security-iAmPr3m
iOS-Application-Security-iAmPr3m
 
Yow connected developing secure i os applications
Yow connected   developing secure i os applicationsYow connected   developing secure i os applications
Yow connected developing secure i os applications
 

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

Ähnlich wie CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3) (20)

CNIT 128 8. Android Implementation Issues (Part 3)
CNIT 128 8. Android Implementation Issues (Part 3)CNIT 128 8. Android Implementation Issues (Part 3)
CNIT 128 8. Android Implementation Issues (Part 3)
 
CNIT 128 8. Android Implementation Issues (Part 2)
CNIT 128 8. Android Implementation Issues (Part 2)CNIT 128 8. Android Implementation Issues (Part 2)
CNIT 128 8. Android Implementation Issues (Part 2)
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
 
CNIT 128: Android Implementation Issues (Part 2)
CNIT 128: Android Implementation Issues (Part 2)CNIT 128: Android Implementation Issues (Part 2)
CNIT 128: Android Implementation Issues (Part 2)
 
128-ch4.pptx
128-ch4.pptx128-ch4.pptx
128-ch4.pptx
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
CNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: Android
 
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)
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
Pentesting Mobile Applications (Prashant Verma)
Pentesting Mobile Applications (Prashant Verma)Pentesting Mobile Applications (Prashant Verma)
Pentesting Mobile Applications (Prashant Verma)
 
6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)
 
Android Penetration Testing - Day 3
Android Penetration Testing - Day 3Android Penetration Testing - Day 3
Android Penetration Testing - Day 3
 
Mobile security
Mobile securityMobile security
Mobile security
 
Ch 13: Attacking Users: Other Techniques (Part 2)
Ch 13: Attacking Users: Other Techniques (Part 2)Ch 13: Attacking Users: Other Techniques (Part 2)
Ch 13: Attacking Users: Other Techniques (Part 2)
 
Mobile code mining for discovery and exploits nullcongoa2013
Mobile code mining for discovery and exploits nullcongoa2013Mobile code mining for discovery and exploits nullcongoa2013
Mobile code mining for discovery and exploits nullcongoa2013
 
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
 
Android overview
Android overviewAndroid overview
Android overview
 
Hacker Halted 2014 - Reverse Engineering the Android OS
Hacker Halted 2014 - Reverse Engineering the Android OSHacker Halted 2014 - Reverse Engineering the Android OS
Hacker Halted 2014 - Reverse Engineering the Android OS
 
CNIT 128 Ch 3: iOS
CNIT 128 Ch 3: iOSCNIT 128 Ch 3: iOS
CNIT 128 Ch 3: iOS
 

Mehr von Sam Bowne

Mehr von Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
10 RSA
10 RSA10 RSA
10 RSA
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
 
4 Getting Started & 5 Leads
4 Getting Started & 5 Leads4 Getting Started & 5 Leads
4 Getting Started & 5 Leads
 
3. Cryptographic Security
3. Cryptographic Security3. Cryptographic Security
3. Cryptographic Security
 

Kürzlich hochgeladen

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Kürzlich hochgeladen (20)

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

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
  • 9.
  • 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:
  • 12.
  • 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