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

Weitere ähnliche Inhalte

Was ist angesagt?

Abusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryAbusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec glory
Priyanka Aash
 
Abusing Exploiting and Pwning with Firefox Addons
Abusing Exploiting and Pwning with Firefox AddonsAbusing Exploiting and Pwning with Firefox Addons
Abusing Exploiting and Pwning with Firefox Addons
Ajin Abraham
 

Was ist angesagt? (20)

CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site ScriptingCNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
 
OWASP Zed Attack Proxy
OWASP Zed Attack ProxyOWASP Zed Attack Proxy
OWASP Zed Attack Proxy
 
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)
 
Zap vs burp
Zap vs burpZap vs burp
Zap vs burp
 
Abusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryAbusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec glory
 
Sticky Keys to the Kingdom
Sticky Keys to the KingdomSticky Keys to the Kingdom
Sticky Keys to the Kingdom
 
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
 
From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg...
From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg...From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg...
From 1000/day to 1000/sec: The Evolution of Incapsula's BIG DATA System [Surg...
 
My tryst with sourcecode review
My tryst with sourcecode reviewMy tryst with sourcecode review
My tryst with sourcecode review
 
CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3
 
Zed Attack Proxy (ZAP)
Zed Attack Proxy (ZAP)Zed Attack Proxy (ZAP)
Zed Attack Proxy (ZAP)
 
Using the Zed Attack Proxy as a Web App testing tool
Using the Zed Attack Proxy as a Web App testing toolUsing the Zed Attack Proxy as a Web App testing tool
Using the Zed Attack Proxy as a Web App testing tool
 
Abusing Exploiting and Pwning with Firefox Addons
Abusing Exploiting and Pwning with Firefox AddonsAbusing Exploiting and Pwning with Firefox Addons
Abusing Exploiting and Pwning with Firefox Addons
 
Security Automation using ZAP
Security Automation using ZAPSecurity Automation using ZAP
Security Automation using ZAP
 
DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101
 
Outlook and Exchange for the bad guys
Outlook and Exchange for the bad guysOutlook and Exchange for the bad guys
Outlook and Exchange for the bad guys
 
Security Testing using ZAP in SFDC
Security Testing using ZAP in SFDCSecurity Testing using ZAP in SFDC
Security Testing using ZAP in SFDC
 
Hunting for the secrets in a cloud forest
Hunting for the secrets in a cloud forestHunting for the secrets in a cloud forest
Hunting for the secrets in a cloud forest
 
Tale of Forgotten Disclosure and Lesson learned
Tale of Forgotten Disclosure and Lesson learnedTale of Forgotten Disclosure and Lesson learned
Tale of Forgotten Disclosure and Lesson learned
 
Owasp zap
Owasp zapOwasp zap
Owasp zap
 

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

Hacking By Nirmal
Hacking By NirmalHacking By Nirmal
Hacking By Nirmal
NIRMAL RAJ
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
Positive Hack Days
 

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

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 8. Identifying and Exploiting Android Implementation Issues (Part 3)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
 
Android Penetration Testing - Day 3
Android Penetration Testing - Day 3Android Penetration Testing - Day 3
Android Penetration Testing - Day 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 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)
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
CNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: Android
 
VAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxVAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptx
 
128-ch4.pptx
128-ch4.pptx128-ch4.pptx
128-ch4.pptx
 
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)
 
unit 2 confinement techniques.pdf
unit 2 confinement techniques.pdfunit 2 confinement techniques.pdf
unit 2 confinement techniques.pdf
 
3. APTs Presentation
3. APTs Presentation3. APTs Presentation
3. APTs Presentation
 
VAPT PRESENTATION full.pptx
VAPT PRESENTATION full.pptxVAPT PRESENTATION full.pptx
VAPT PRESENTATION full.pptx
 
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)
CNIT 128: 7. Attacking Android Applications (Part 1 of 3)CNIT 128: 7. Attacking Android Applications (Part 1 of 3)
CNIT 128: 7. Attacking Android Applications (Part 1 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)
 
Botnets Attacks.pptx
Botnets Attacks.pptxBotnets Attacks.pptx
Botnets Attacks.pptx
 
CNIT 128 7. Attacking Android Applications (Part 1)
CNIT 128 7. Attacking Android Applications (Part 1)CNIT 128 7. Attacking Android Applications (Part 1)
CNIT 128 7. Attacking Android Applications (Part 1)
 
Hacking By Nirmal
Hacking By NirmalHacking By Nirmal
Hacking By Nirmal
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
 
Hacking your Droid (Aditya Gupta)
Hacking your Droid (Aditya Gupta)Hacking your Droid (Aditya Gupta)
Hacking your Droid (Aditya Gupta)
 

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 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
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
 
6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 

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