SlideShare a Scribd company logo
Android Security
Developing Secure App
Secure Coding Guidelines
•Such guidelines even exists?
•Who cares! No one's gonna hack my app.
•Lets finish this project anyhow!!!
Secure Coding Guidelines
• Computer Emergency ResponseTeam (CERT)
• Expert groups that handle Computer/IT security incidents.
• Issued Android Secure Coding Guidelines.
• Mission: We reduce the number of vulnerabilities to a level
that can be fully mitigated in operational environments.
Packaging
AttackVectors
in Android
AttackVectors
AttackVectors
• Mounting SD Card in PC
• Malicious App
• Network Attack
• Malicious File Attack
• User’s Unawareness
• USB Debugging
• Root permissions!! (Can do anything)
Security Policy
in Android
Unix Security Policy
1. Process Isolation
2. Hardware Isolation
3. User Permission Model
4. R/W/X Permissions to file
5. Secure IPC
Android Security Policy
1. Application Isolation
2. Sandbox of Application
3. Secure Communication
4. Signing the Application
5. Permission model of Application
To Do's
To Secure Apps
Avoid Simple Logics
private void validate(){
if(mLoginAccess == 1 ){
// TODO: update user.
}
}
private void validate() {
if (mLogin.hasAccess == true) {
// TODO: update user.
}
}
private void validate() {
if (mLogin.hasAccess) {
// TODO: update user.
}
}
Test 3rd Party Libraries!
•Caution: Developers rely heavily on third-party libraries.
It is important to thoroughly probe and test this as you
test your code. Third-party libraries can contain
vulnerabilities and weaknesses. Many developers assume
third-party libraries are well-developed and tested,
however, issues can and do exist in their code.
Use Encryption
•Caution: External storage can become unavailable if the
user mounts the external storage on a computer or
removes the media, and there's no security enforced
upon files you save to the external storage. All
applications can read and write files placed on the
external storage and the user can remove them.
http://developer.android.com/guide/topics/data/data-
storage.html
But How to Encrypt?
To Secure Apps
How to Encrypt or Encode?
1. Encode Shared Preferences
2.Encrypt SQLite: SQLCipher
3. Encrypt Network:TLS
4.Data Encryption: Facebook’s Conceal Library
5.MD5, SHA Sensitive Data
To be Secured
1. Secure Intents
2.SecureWebView
3. Secure Logs
4.Secure Intent Leaks
Code Obfuscation
1. Proguard
2.Don't include unused Classes and Libraries
3. Difficult to protect from Smali Decompilation
To Use
1. Use ofTokens for Authentication
2.Use of HTTPS!
Our Evils
1. ADB
2.MaliciousApplications
3. Unprotected Network
4.Sniffers
Our Friends
1. Android Fuzzers
2.Xposed Framework
3. Drozer
4.APKtool or any other StaticAnalysisTool
5.PenetrationTools for Android
6.and Many more...
Thank you!
@DearDhruv

More Related Content

PPT
Android Security
PDF
Android Security
PPTX
Mobile security
PPTX
Android security
PPTX
Android Security
PPTX
Mobile security
PPTX
Android Application Penetration Testing - Mohammed Adam
PPTX
Mobile security
Android Security
Android Security
Mobile security
Android security
Android Security
Mobile security
Android Application Penetration Testing - Mohammed Adam
Mobile security

What's hot (20)

PDF
Mobile Application Security
PDF
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
PPTX
Understanding android security model
PDF
Mobile Security
PDF
Android Security & Penetration Testing
PPTX
Introduction To Exploitation & Metasploit
PPTX
Mobile Application Security
PDF
Ransomware: History, Analysis, & Mitigation - PDF
PDF
Mobile Malware
PPTX
What is Ransomware
PPTX
Mobile Application Testing Training Presentation
PPTX
iOS-Application-Security-iAmPr3m
PPTX
Osint {open source intelligence }
PPTX
Mobile security
PPT
Introduction To OWASP
PDF
Mobile Security
PDF
Malware classification and detection
PPTX
Pentesting Android Apps
PPTX
IOS security
PDF
iOS Application Penetration Testing
Mobile Application Security
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
Understanding android security model
Mobile Security
Android Security & Penetration Testing
Introduction To Exploitation & Metasploit
Mobile Application Security
Ransomware: History, Analysis, & Mitigation - PDF
Mobile Malware
What is Ransomware
Mobile Application Testing Training Presentation
iOS-Application-Security-iAmPr3m
Osint {open source intelligence }
Mobile security
Introduction To OWASP
Mobile Security
Malware classification and detection
Pentesting Android Apps
IOS security
iOS Application Penetration Testing
Ad

Viewers also liked (18)

PPTX
Permission in Android Security: Threats and solution
PDF
Deep Dive Into Android Security
ODP
Android security in depth
PPTX
Security threats in Android OS + App Permissions
PPT
Understanding Android Security
PPTX
Android sandbox
PDF
Brief Tour about Android Security
PPTX
Information Security and Privacy
PDF
Digging for Android Kernel Bugs
PDF
Security in Android Applications / Александр Смирнов (RedMadRobot)
PDF
Android coding standard
PDF
Android Security Overview and Safe Practices for Web-Based Android Applications
PDF
Android Security - Common Security Pitfalls in Android Applications
PPSX
Mobile device security informative v2
PPTX
Android security model
PDF
Testing Android Security
PDF
Fuzzing the Media Framework in Android
PDF
Android system security
Permission in Android Security: Threats and solution
Deep Dive Into Android Security
Android security in depth
Security threats in Android OS + App Permissions
Understanding Android Security
Android sandbox
Brief Tour about Android Security
Information Security and Privacy
Digging for Android Kernel Bugs
Security in Android Applications / Александр Смирнов (RedMadRobot)
Android coding standard
Android Security Overview and Safe Practices for Web-Based Android Applications
Android Security - Common Security Pitfalls in Android Applications
Mobile device security informative v2
Android security model
Testing Android Security
Fuzzing the Media Framework in Android
Android system security
Ad

Similar to Android security (20)

PDF
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
PDF
Yow connected developing secure i os applications
PDF
Droidcon it-2014-marco-grassi-viaforensics
PDF
Mobile App Security - Best Practices
PDF
" onclick="alert(1)
PDF
<marquee>html title testfsdjk34254</marquee>
PDF
Secure codingguide
PPTX
Security testing of mobile applications
PPTX
Untitled 1
PDF
Breaking Secure Mobile Applications - Hack In The Box 2014 KL
PDF
YOW! Connected 2014 - Developing Secure iOS Applications
PDF
Building Custom Android Malware BruCON 2013
PDF
9 Writing Secure Android Applications
PDF
AusCERT - Developing Secure iOS Applications
PPTX
Android Security and Peneteration Testing
PPTX
Building a Mobile Security Program
PPT
Analysis and research of system security based on android
PDF
From velvet to silk there is still a lot of sweat
PPTX
Owasp Mobile Risk Series : M4 : Unintended Data Leakage
PPTX
Started In Security Now I'm Here
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
Yow connected developing secure i os applications
Droidcon it-2014-marco-grassi-viaforensics
Mobile App Security - Best Practices
" onclick="alert(1)
<marquee>html title testfsdjk34254</marquee>
Secure codingguide
Security testing of mobile applications
Untitled 1
Breaking Secure Mobile Applications - Hack In The Box 2014 KL
YOW! Connected 2014 - Developing Secure iOS Applications
Building Custom Android Malware BruCON 2013
9 Writing Secure Android Applications
AusCERT - Developing Secure iOS Applications
Android Security and Peneteration Testing
Building a Mobile Security Program
Analysis and research of system security based on android
From velvet to silk there is still a lot of sweat
Owasp Mobile Risk Series : M4 : Unintended Data Leakage
Started In Security Now I'm Here

Android security

  • 2. Secure Coding Guidelines •Such guidelines even exists? •Who cares! No one's gonna hack my app. •Lets finish this project anyhow!!!
  • 3. Secure Coding Guidelines • Computer Emergency ResponseTeam (CERT) • Expert groups that handle Computer/IT security incidents. • Issued Android Secure Coding Guidelines. • Mission: We reduce the number of vulnerabilities to a level that can be fully mitigated in operational environments.
  • 7. AttackVectors • Mounting SD Card in PC • Malicious App • Network Attack • Malicious File Attack • User’s Unawareness • USB Debugging • Root permissions!! (Can do anything)
  • 9. Unix Security Policy 1. Process Isolation 2. Hardware Isolation 3. User Permission Model 4. R/W/X Permissions to file 5. Secure IPC
  • 10. Android Security Policy 1. Application Isolation 2. Sandbox of Application 3. Secure Communication 4. Signing the Application 5. Permission model of Application
  • 12. Avoid Simple Logics private void validate(){ if(mLoginAccess == 1 ){ // TODO: update user. } } private void validate() { if (mLogin.hasAccess == true) { // TODO: update user. } } private void validate() { if (mLogin.hasAccess) { // TODO: update user. } }
  • 13. Test 3rd Party Libraries! •Caution: Developers rely heavily on third-party libraries. It is important to thoroughly probe and test this as you test your code. Third-party libraries can contain vulnerabilities and weaknesses. Many developers assume third-party libraries are well-developed and tested, however, issues can and do exist in their code.
  • 14. Use Encryption •Caution: External storage can become unavailable if the user mounts the external storage on a computer or removes the media, and there's no security enforced upon files you save to the external storage. All applications can read and write files placed on the external storage and the user can remove them. http://developer.android.com/guide/topics/data/data- storage.html
  • 15. But How to Encrypt? To Secure Apps
  • 16. How to Encrypt or Encode? 1. Encode Shared Preferences 2.Encrypt SQLite: SQLCipher 3. Encrypt Network:TLS 4.Data Encryption: Facebook’s Conceal Library 5.MD5, SHA Sensitive Data
  • 17. To be Secured 1. Secure Intents 2.SecureWebView 3. Secure Logs 4.Secure Intent Leaks
  • 18. Code Obfuscation 1. Proguard 2.Don't include unused Classes and Libraries 3. Difficult to protect from Smali Decompilation
  • 19. To Use 1. Use ofTokens for Authentication 2.Use of HTTPS!
  • 20. Our Evils 1. ADB 2.MaliciousApplications 3. Unprotected Network 4.Sniffers
  • 21. Our Friends 1. Android Fuzzers 2.Xposed Framework 3. Drozer 4.APKtool or any other StaticAnalysisTool 5.PenetrationTools for Android 6.and Many more...