Slide 1

Slide 1 text

Michaël Ohayon Android Developer @mikkL Securing Network Calls on Android, from 2009 to 2019 !1

Slide 2

Slide 2 text

Everyone has a phone with apps Top Applications from the French Google Play Store #3 Netflix #8 WhatsApp #27 Microsoft Outlook #54 Doctolib #106 Crédit Agricole #109 Assurance maladie !2

Slide 3

Slide 3 text

Everyone has a phone with apps and private informations Top Applications from the French Google Play Store #3 Netflix General Password #8 WhatsApp Private messages, pictures #27 Microsoft Outlook Work data #54 Doctolib Medical data #106 Crédit Agricole Bank data #109 Assurance maladie Government ID !3

Slide 4

Slide 4 text

Let's look at how the web did upgrade it's security standards !4

Slide 5

Slide 5 text

1997 !5

Slide 6

Slide 6 text

https://www.telegraph.co.uk/technology/6125914/How-20-popular-websites-looked-when-they-launched.html The Web in 1997 !6

Slide 7

Slide 7 text

HTTP ? !7

Slide 8

Slide 8 text

HTTP 1.1 !8

Slide 9

Slide 9 text

HTTP 1.1 !9

Slide 10

Slide 10 text

HTTP 1.1 !10

Slide 11

Slide 11 text

HTTP 1.1 !11

Slide 12

Slide 12 text

2006 !12

Slide 13

Slide 13 text

https://thenextweb.com/dd/2014/07/15/website-ages-tracking-aol-yahoo-espn-across-time/ The Web in the 2000s !13

Slide 14

Slide 14 text

2008 !14

Slide 15

Slide 15 text

July 24, 2008 "Today, we're making it even easier for you to use https to protect your mail every time you access it. We've added an option to Settings to always use https" https://gmail.googleblog.com/2008/07/making-security-easier.html !15

Slide 16

Slide 16 text

July 24, 2008 "If you don't regularly log in via unencrypted wireless connections at coffee shops or airports or college dorms, then you might not need this additional layer of security." https://gmail.googleblog.com/2008/07/making-security-easier.html !16

Slide 17

Slide 17 text

July 24, 2008 "But if you want to always use https, then this setting makes it super easy. Whenever you forget to type https://mail.google.com, we'll add the https for you." https://gmail.googleblog.com/2008/07/making-security-easier.html !17

Slide 18

Slide 18 text

2009 !18

Slide 19

Slide 19 text

September 23, 2009 !19

Slide 20

Slide 20 text

2009 !20

Slide 21

Slide 21 text

Why is HTTPS such a big deal? Is it hard to monitor HTTP traffic? !21

Slide 22

Slide 22 text

ARP Spoofing in 2 minutes monip.org monip.org Private network !22

Slide 23

Slide 23 text

ARP Spoofing in 2 minutes monip.org monip.org Private network !23

Slide 24

Slide 24 text

ARP Spoofing in 2 minutes monip.org monip.org Private network !24

Slide 25

Slide 25 text

ARP Spoofing in 2 minutes monip.org monip.org Private network !25

Slide 26

Slide 26 text

ARP Spoofing in 2 minutes monip.org monip.org Private network !26

Slide 27

Slide 27 text

ARP Spoofing in 2 minutes !27

Slide 28

Slide 28 text

ARP Spoofing in 2 minutes Network Interface phone ip Network Interface phone ip gateway ip gateway ip !28

Slide 29

Slide 29 text

ARP Spoofing in 2 minutes !29

Slide 30

Slide 30 text

ARP Spoofing in 2 minutes !30

Slide 31

Slide 31 text

No HTTPS Anyone can see the traffic !31

Slide 32

Slide 32 text

ARP Spoofing in 2 minutes !32

Slide 33

Slide 33 text

HTTPS Traffic should not be readable !33

Slide 34

Slide 34 text

2013 !34

Slide 35

Slide 35 text

July 31, 2013 We now use https by default for all Facebook users. This feature, which we first introduced as an option two years ago, means that your browser is told to communicate with Facebook using a secure connection, as indicated by the "https" rather than "http" in https://www.facebook.com. https://www.facebook.com/notes/facebook-engineering/secure-browsing-by-default/10151590414803920/ !35

Slide 36

Slide 36 text

How does HTTPS works? !36

Slide 37

Slide 37 text

Key Infrastructure https://www.thesslstore.com/blog/root-certificates-intermediate/ PRE-INSTALLED !37

Slide 38

Slide 38 text

Key Infrastructure https://android.googlesource.com/platform/system/ca-certificates/+/master/files/ !38

Slide 39

Slide 39 text

Key Infrastructure !39

Slide 40

Slide 40 text

Key Infrastructure Root Intermediary Server !40

Slide 41

Slide 41 text

Why was HTTPS slow to deploy? !41

Slide 42

Slide 42 text

1 - Tech requirements You need to have access to the underlying HTTP Server, not just an FTP access and to be trusted http://conseilscreation.free.fr/pages/ftp_filezilla.php !42

Slide 43

Slide 43 text

2 - Pricing Who wants to pay for something already working? https://www.sslshopper.com/ssl-certificate-list.html !43

Slide 44

Slide 44 text

3 - Lack of documentation !44

Slide 45

Slide 45 text

4 - Lack of automation tools !45

Slide 46

Slide 46 text

Not that easy !46

Slide 47

Slide 47 text

2016 !47

Slide 48

Slide 48 text

September 15, 2016 "This specification defines "secure contexts", thereby allowing user agent implementers and specification authors to enable certain features only when certain minimum standards of authentication and confidentiality are met." https://www.w3.org/TR/secure-contexts/ !48

Slide 49

Slide 49 text

September 15, 2016 Warning: Direct access to the camera is a powerful feature. It requires consent from the user, and your site MUST be on a secure origin (HTTPS). https://developers.google.com/web/fundamentals/media/capturing-images/ !49

Slide 50

Slide 50 text

2018 !50

Slide 51

Slide 51 text

February 8, 2018 "Chrome will mark all HTTP sites as ‘not secure’ starting in July" https://www.theverge.com/2018/2/8/16991254/chrome-not-secure-marked-http-encryption-ssl !51

Slide 52

Slide 52 text

Android 9 https://developer.android.com/about/versions/pie/android-9.0-changes-28#framework-security-changes !52

Slide 53

Slide 53 text

Is it easy to switch to HTTPS in 2018? !53

Slide 54

Slide 54 text

Is it easier to switch to HTTPS in 2018? YES !54

Slide 55

Slide 55 text

!55

Slide 56

Slide 56 text

Will this solve all my security issues? !56

Slide 57

Slide 57 text

Will this solve all my security issues? NO !57

Slide 58

Slide 58 text

Trusting weak CA’s !58

Slide 59

Slide 59 text

Trusting weak CA’s !59

Slide 60

Slide 60 text

Trusting weak CA’s !60

Slide 61

Slide 61 text

Trusting weak CA’s https://www.thesslstore.com/blog/root-certificates-intermediate/ COMPROMISED COMPROMISED !61

Slide 62

Slide 62 text

Trusting weak CA’s !62

Slide 63

Slide 63 text

Trusting weak CA’s !63

Slide 64

Slide 64 text

Is this possible on Android? !64

Slide 65

Slide 65 text

Is this possible on Android? YES !65

Slide 66

Slide 66 text

The "debug" use case https://www.charlesproxy.com monip.org monip.org Private network !66

Slide 67

Slide 67 text

Trusting weak CA’s COMPROMISED COMPROMISED COMPROMISED !67

Slide 68

Slide 68 text

Trusting weak CA’s !68

Slide 69

Slide 69 text

Automating User Certs trust !69

Slide 70

Slide 70 text

What can I do? !70

Slide 71

Slide 71 text

Can I create my own certificate chain? !71

Slide 72

Slide 72 text

Self-signed certificate PRIVATE !72

Slide 73

Slide 73 text

Can I use a self-signed certificate? MAYBE !73

Slide 74

Slide 74 text

Can I use a self-signed certificate? NO (if you plan to use this certificate on devices you do not administrate or on apps you are not building, such as web browsers ) !74

Slide 75

Slide 75 text

Can I use a self-signed certificate? YES (If it's for applications where you can control the network logic or devices you can administrate) !75

Slide 76

Slide 76 text

OkHttp Certificate Pinner !76

Slide 77

Slide 77 text

Congrats! You just learned (basic) SSL pinning! More : https://medium.com/@appmattus/android-security-ssl-pinning-1db8acb6621e !77

Slide 78

Slide 78 text

!78

Slide 79

Slide 79 text

Is Certificate Pinning the way to go? YES (but don’t forget to think about certificate’s lifetime) !79

Slide 80

Slide 80 text

Will this solve all my security issues? !80

Slide 81

Slide 81 text

Will this solve all my security issues? NO (but most of them) !81

Slide 82

Slide 82 text

What should I be afraid of? !82

Slide 83

Slide 83 text

What should I be afraid of? Social Engineering !83

Slide 84

Slide 84 text

What should I be afraid of? Social Engineering (The device may be compromised) !84

Slide 85

Slide 85 text

Social Engineering https://www.androidpolice.com/2018/06/03/fake-fortnite-apks-dont-tricked-downloading-one/ !85

Slide 86

Slide 86 text

What should I be afraid of? Reverse Engineering !86

Slide 87

Slide 87 text

What should I be afraid of? Reverse Engineering (The device is already compromised) !87

Slide 88

Slide 88 text

Decompiling keytool / jarsigner https://blog.bramp.net/post/2015/08/01/decompile-and-recompile-android-apk/ !88

Slide 89

Slide 89 text

Call interception !89

Slide 90

Slide 90 text

Automating Unpinning https://github.com/ac-pm/SSLUnpinning_Xposed !90

Slide 91

Slide 91 text

https://github.com/ac-pm/SSLUnpinning_Xposed Automating Unpinning !91

Slide 92

Slide 92 text

Should I be worried? You should not, but the backend team may !92

Slide 93

Slide 93 text

Recap •HTTPS is the way to go (who would doubt that?)
 •Certificate Pinning exists and should be implemented
 •Think twice when releasing outside default stores! •If someone wants to look at the traffic, he may succeed but on compromised devices •Keep cool, in 2019, your apps should be safe enough
 !93

Slide 94

Slide 94 text

Thanks! !94