Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dima Kovalenko - Modern SSL Pinning

OWASP Kyiv
December 04, 2017

Dima Kovalenko - Modern SSL Pinning

Video: https://www.youtube.com/watch?v=MeZINw4GnGM
OWASP Kyiv Winter 2017 Meetup, Dec 2, 2017
https://www.owasp.org/index.php/Kyiv

OWASP Kyiv

December 04, 2017
Tweet

More Decks by OWASP Kyiv

Other Decks in Technology

Transcript

  1. Modern SSL Pinning
    in iOS system & applications
    Dima Kovalenko
    Dec 2, 2017
    OWASP Kyiv 2017

    View Slide

  2. Agenda
    1. Seasons in the sun
    2. Smelly breath of SSL
    3. SSL pinning versus SSLKillSwitch
    4. Modern techniques to sniff/prevent sniffing SSL traffic
    5. Summary

    View Slide

  3. Seasons in the sun
    From the beginning of the iPhone era to 2010:
    ● HTTP everywhere
    ● HTTPs is a very rare beast
    ● Any HTTP sniffer can see applications’
    traffic
    Life is good!

    View Slide

  4. Seasons in the sun
    Apple AppStore traffic in 2009

    View Slide

  5. Seasons in the sun
    Apple AppStore traffic in 2009

    View Slide

  6. Smelly breath of SSL
    Starting from 2010, more and more iOS apps use SSL. However:
    ● HTTP protocol is still widely used (now over SSL)
    ● iOS applications trust system certificate storage
    It looks like SSL is used mostly to prevent MitM-attacks (stealing
    passwords, cookies etc) that prevent sniffing traffic from your own device.

    View Slide

  7. Smelly breath of SSL
    In 2010, the way to bypass SSL is simple:
    1. Generate an SSL certificate
    2. Add the certificate to iOS system storage
    3. Use the certificate in your sniffer

    View Slide

  8. Smelly breath of SSL
    Numerous instructions how to do it

    View Slide

  9. SSL pinning versus SSLKillSwitch
    SSL certificate pinning is widely used since about 2012.
    1. HTTP is still the core protocol for many iOS apps, but...
    2. ...the apps do not trust system certificate storage anymore!

    View Slide

  10. SSL pinning versus SSLKillSwitch
    So
    1. Any app has it’s own “per-app” certificate storage.
    2. There is no common implementation of the “per-app” storages (iOS apps
    hardcode certificates, keep certificates in external files, request certificates on
    first start and save to app bundle settings etc).
    3. There is no common way to sniff SSL traffic
    anymore!

    View Slide

  11. SSL pinning versus SSLKillSwitch
    In July 2012, Alban “nabla” Diquet saves all!
    His research shows that
    1. Most of iOS apps (and even iOS itself) use
    the same system function to check certificate
    2. The functions can be hooked/patched to
    make any certificate valid

    View Slide

  12. SSL pinning versus SSLKillSwitch
    The nabla’s tool, called SSLKillSwitch, is a MobileSubstrate extension.
    It hooks 3 important iOS SSL stack functions:
    ● SSLSetSessionOption(...)
    ● SSLCreateContext(...)
    ● SSLHandshake(...)
    Of course, SSLKillSwitch is not the only tool of this kind, but I believe it’s first and
    most used.

    View Slide


  13. SSL pinning versus SSLKillSwitch

    View Slide

  14. Modern techniques to sniff/prevent sniffing SSL traffic
    In 2016, iOS app developers start to implement custom SSL validation techniques.
    The techniques include numerous features, e.g.
    1. Pinning public keys (SubjectPublicKeyInfo (SPKI)) vs. certificate pinning
    2. Client-side certificates
    3. iOS SSL stack functions integrity check…
    4. ...and so on
    SSLKillSwitch and similar tools are not the absolute weapon against SSL pinning
    anymore!

    View Slide

  15. Modern techniques to sniff/prevent sniffing SSL traffic

    View Slide

  16. Modern techniques to sniff/prevent sniffing SSL traffic

    View Slide

  17. Summary
    Everything is bad!

    View Slide

  18. QUESTIONS?

    View Slide

  19. Twitter: @kov4l3nko
    Mail: [email protected]
    Blog: https://kov4l3nko.github.io

    View Slide