63
SECURITY IN ANDROID APPLICATION 31/05/2016 ALEXANDER SMIRNOV

Security in Android Applications / Александр Смирнов (RedMadRobot)

  • Upload
    ontico

  • View
    222

  • Download
    5

Embed Size (px)

Citation preview

Page 1: Security in Android Applications / Александр Смирнов (RedMadRobot)

SECURITYIN ANDROID APPLICATION

31/05/2016ALEXANDER SMIRNOV

Page 2: Security in Android Applications / Александр Смирнов (RedMadRobot)

- 3+ years Android dev- 6+ years commercial dev- 1 year bank app dev- Addicted to info security since 2007- DC7499 member

WhoAmI

Page 3: Security in Android Applications / Александр Смирнов (RedMadRobot)

Why?

Page 4: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Android Security Model- Reality- Vulnerabilities- One more sentence- Appendix

Agenda

Page 5: Security in Android Applications / Александр Смирнов (RedMadRobot)

Security

• I •

Android Security Model

Page 6: Security in Android Applications / Александр Смирнов (RedMadRobot)
Page 7: Security in Android Applications / Александр Смирнов (RedMadRobot)

Application Isolation- isolate CPU, RAM, devices, files in

private directory

Page 8: Security in Android Applications / Александр Смирнов (RedMadRobot)

Application Isolation- isolate CPU, RAM, devices, files in

private directory

- every app run in own process

Page 9: Security in Android Applications / Александр Смирнов (RedMadRobot)

Application Isolation- isolate CPU, RAM, devices, files in

private directory

- every app run in own process

- every app has own UserID and GroupID

Page 10: Security in Android Applications / Александр Смирнов (RedMadRobot)

Application Isolation- isolate CPU, RAM, devices, files in

private directory

- every app run in own process

- every app has own UserID and GroupID

- every app run in own instance of Dalvik VM

Page 11: Security in Android Applications / Александр Смирнов (RedMadRobot)

Application Isolation

Page 12: Security in Android Applications / Александр Смирнов (RedMadRobot)

Application Isolation

Page 13: Security in Android Applications / Александр Смирнов (RedMadRobot)

Application Isolation

Page 14: Security in Android Applications / Александр Смирнов (RedMadRobot)

Application Isolation

Page 15: Security in Android Applications / Александр Смирнов (RedMadRobot)

Application Isolation

Page 16: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Is the parent of all App processesZygote

App 1

App 2

App 3

Zygote

fork()

fork()

fork()

start newApp

Page 17: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Is the parent of all App processesZygote

App 1

App 2

App 3

Zygote

fork()

fork()

fork()

start newApp

- COW(Copy On Write) strategy

Page 18: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Is the parent of all App processesZygote

App 1

App 2

App 3

Zygote

fork()

fork()

fork()

start newApp

- COW(Copy On Write) strategy

- /dev/socket/zygote

Page 19: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Before M- After M- Custom permissions- Protection level

Permissions

Page 20: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Protect user dataAndroid Security Overview

Page 21: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Protect user dataAndroid Security Overview

- Protect system resources

Page 22: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Protect user dataAndroid Security Overview

- Protect system resources

- Provide application isolation

Page 23: Security in Android Applications / Александр Смирнов (RedMadRobot)

• II •

Android Security ModelReality

Security

Page 24: Security in Android Applications / Александр Смирнов (RedMadRobot)

Root

Page 25: Security in Android Applications / Александр Смирнов (RedMadRobot)

Triada

Page 26: Security in Android Applications / Александр Смирнов (RedMadRobot)

Security

• III•

Vulnerabilities

Page 27: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Memory CacheData Storage

Page 28: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Memory CacheData Storage

- Internal Storage

Page 29: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Memory CacheData Storage

- Internal Storage

- SharedPreference + MODE_PRIVATE + Cipher

Page 30: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Memory CacheData Storage

- Internal Storage

- SharedPreference + MODE_PRIVATE + Cipher

- DB + SQLCipher

Page 31: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Memory CacheData Storage

- Internal Storage

- SharedPreference + MODE_PRIVATE + Cipher

- DB + SQLCipher

- 21+ setStorageEncryption

Page 32: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Memory CacheData Storage

- Internal Storage

- SharedPreference + MODE_PRIVATE + Cipher

- DB + SQLCipher

- 21+ setStorageEncryption

- KeyStore

Page 33: Security in Android Applications / Александр Смирнов (RedMadRobot)

- MITM Has YouTransport

Page 34: Security in Android Applications / Александр Смирнов (RedMadRobot)

- MITM Has YouTransport

- Check network – why?

Page 35: Security in Android Applications / Александр Смирнов (RedMadRobot)

- MITM Has YouTransport

- Check network – why?

- Diffie–Hellman key exchange

Page 36: Security in Android Applications / Александр Смирнов (RedMadRobot)

- MITM Has YouTransport

- Check network – why?

- Diffie–Hellman key exchange

- Certificate Pinning == SSL Pinning (okhttp 2.7.4 || 3.1.2)

Page 37: Security in Android Applications / Александр Смирнов (RedMadRobot)

Intent- Use explicit intents

Page 38: Security in Android Applications / Александр Смирнов (RedMadRobot)

Intent- Use explicit intents

- Validate Input

Page 39: Security in Android Applications / Александр Смирнов (RedMadRobot)

Intent- Use explicit intents

- Validate Input

- Manifest: intent-filter = exported="true"

Page 40: Security in Android Applications / Александр Смирнов (RedMadRobot)

2FA: SMS- Secure PUSH

Page 41: Security in Android Applications / Александр Смирнов (RedMadRobot)

2FA: SMS- Secure PUSH

- Mobile application

Page 42: Security in Android Applications / Александр Смирнов (RedMadRobot)

2FA: SMS- Secure PUSH

- Mobile application

- SIMApplets

Page 43: Security in Android Applications / Александр Смирнов (RedMadRobot)

2FA: SMS- Secure PUSH

- Mobile application

- SIMApplets

- DCV (Dynamic Code Verification)

Page 44: Security in Android Applications / Александр Смирнов (RedMadRobot)

Insecure Device- Secure persistent datastore

Page 45: Security in Android Applications / Александр Смирнов (RedMadRobot)

Insecure Device- Secure persistent datastore

- No immutable (Strings -> char[])

Page 46: Security in Android Applications / Александр Смирнов (RedMadRobot)

Insecure Device- Secure persistent datastore

- No immutable (Strings -> char[])

- Notify if root

Page 47: Security in Android Applications / Александр Смирнов (RedMadRobot)

Insecure Device- Secure persistent datastore

- No immutable (Strings -> char[])

- Notify if root

- Custom keyboard

Page 48: Security in Android Applications / Александр Смирнов (RedMadRobot)

Insecure Device- Secure persistent datastore

- No immutable (Strings -> char[])

- Notify if root

- Custom keyboard

- No EditText

Page 49: Security in Android Applications / Александр Смирнов (RedMadRobot)

Reverse Protection- Check for debug mode

Page 50: Security in Android Applications / Александр Смирнов (RedMadRobot)

Reverse Protection- Check for debug mode

- Emulator check

Page 51: Security in Android Applications / Александр Смирнов (RedMadRobot)

Reverse Protection- Check for debug mode

- Emulator check

- Verify sign

Page 52: Security in Android Applications / Александр Смирнов (RedMadRobot)

Reverse Protection- Check for debug mode

- Emulator check

- Verify sign

- Obfuscation

Page 53: Security in Android Applications / Александр Смирнов (RedMadRobot)

- JNI

Reverse Protection- Check for debug mode

- Emulator check

- Verify sign

- Obfuscation

Page 54: Security in Android Applications / Александр Смирнов (RedMadRobot)

Security

• IV •

One more sentence

Page 55: Security in Android Applications / Александр Смирнов (RedMadRobot)

One more sentence- Convenience vs Security

Page 56: Security in Android Applications / Александр Смирнов (RedMadRobot)

One more sentence- Convenience vs Security

- Socialization & Tools

Page 57: Security in Android Applications / Александр Смирнов (RedMadRobot)

One more sentence- Convenience vs Security

- Socialization & Tools

- Layered Security

Page 58: Security in Android Applications / Александр Смирнов (RedMadRobot)

One more sentence- Convenience vs Security

- Socialization & Tools

- Layered Security

- Better than others

Page 59: Security in Android Applications / Александр Смирнов (RedMadRobot)

- OWASP TOP 10 Mobile Risks

One more sentence- Convenience vs Security

- Socialization & Tools

- Layered Security

- Better than others

Page 60: Security in Android Applications / Александр Смирнов (RedMadRobot)

Security

• V •

Appendix

Page 61: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Cyber Risk Report: bit.ly/1MuoIDS- OWASP Top 10 Mobile Risks: bit.ly/1FAIJiv- DefCon Groups List: bit.ly/1JQlNgC- Triada Malware: bit.ly/1qvyFqY- Obfuscation tools list: bit.ly/1XiHf6Z- Security Official Docs: bit.ly/1qvw1BK- Diffie–Hellman Video: bit.ly/23jV7Se- Tools for SA and Hacking: bit.ly/1qvxpUM

Additional Information

Page 62: Security in Android Applications / Александр Смирнов (RedMadRobot)

- Android Security Model- Reality- Vulnerabilities- One more sentence

Result

Page 63: Security in Android Applications / Александр Смирнов (RedMadRobot)

Any Questions, Please?

[email protected] @_smred