franz payer tactical network solutions ://defcon.org/images/defcon-21/dc-21... · what i’m going...

41
Franz Payer Tactical Network Solutions http://cyberexplo.it

Upload: others

Post on 11-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Franz Payer Tactical Network Solutions

http://cyberexplo.it

Page 2: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Acknowledgements

q Zachary Cutlip q Craig Heffner q Tactical Network Solutions

Page 3: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Special Thanks

q Ronald Jenkees §  Independent artist §  http://www.ronaldjenkees.com

Page 4: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Legal

q EFF (www.eff.org) q DMCA (Digital Millennium Copyright Act) q CFAA (Computer Fraud and Abuse Act) q Opinions/views expressed here are mine,

not my employer’s

Page 5: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

What I’m going to talk about

q Background info q Music streaming basics q Security investigation process q Exploit demo q Questions

Page 6: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

End-Goal

q Google-Chrome Extension §  Mimics music player when possible §  Duplicates requests otherwise

q Alternative §  Duplicates request + caches §  Hex-dump analysis

Page 7: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Wall of shame

Page 8: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

What is streaming?

q A way to constantly receive and present data while it is being delivered by a provider – Wikipedia

q Capture data pieces §  Reassembly §  Encryption

Page 9: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

What is streaming?

q Protocols §  Custom protocol – Desktop apps §  HTTP/HTTPS – Browser apps

q  2 types §  Static

○  http://cd09.128.music.static.jango.com/music/10/47/34/1047349946.mp3

§  Dynamic ○  http://stream126-he.grooveshark.com/stream.php?

streamKey=1202c0ba6260e12c0b84d64b72845181d3195496_51eaabf9_24f1b63_2cb51a8_e0616020_36_0

Page 10: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Types of music players

q Flash §  Majority §  May still use JavaScript §  Must decompile §  Separate environment

q HTML5 §  Experimental §  Entirely in JavaScript §  Usually minified

Page 11: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Where’s the vulnerability?

q Browser does heavy lifting q Two ways to exploit

§  Copy requests ○  Easy ○  Suspicious ○  Limitations

§  Generate requests ○  Difficult ○  Undetectable w/ sessions

Page 12: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Investigation process

q Breadth before depth q  Locate music file in network traffic

§  Filter by XHR traffic + sort by type q  Inspect any parameters in the request q  Locate origin of those parameters

§  Page URL §  Page source §  localStorage §  JavaScript

q Attempt to replicate the request

Page 13: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Target: Aimini

q Flash q Almost nonexistent security q Good first target

§  Don’t even need to look at the code

Page 14: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Analyzing network traffic

Page 15: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

The easy way out

Page 16: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

The easy way out

Page 17: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Analyzing the song request

Page 18: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Looking for parameters

Page 19: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Target: Grooveshark

q HTML5 (http://html5.grooveshark.com/) q Several factors of authentication q Minified JavaScript q Not for the faint of heart q Keep track of what you are doing

Page 20: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

JavaScript beautifier

q You’re going to need it q  http://jsbeautifier.org/

Page 21: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Analyzing the song request

Page 22: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Analyzing more.php

Page 23: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Analyzing more.php

Page 24: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

So now what? q We need:

§  streamKey q How do we get it?

§  more.php - getStreamKeyFromSongIDEx §  Session - ? §  Token - ? §  UUID - ? §  songID - ?

q more.php - getCommunicationToken

Page 25: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Looking through app.min.js

Page 26: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Recap q We need:

§  streamKey q How do we get it?

§  more.php - getStreamKeyFromSongIDEx §  Session – window.GS.config §  Token - ? §  UUID - ? §  songID - window.GS.models.queue.models

q more.php - getCommunicationToken

Page 27: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Looking for variables – app.min.js

Page 28: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Recap q We need:

§  streamKey q How do we get it?

§  more.php - getStreamKeyFromSongIDEx §  Session – window.GS.config §  Token - ? §  UUID – copied function from app.min.js §  songID - window.GS.models.queue.models

q more.php - getCommunicationToken

Page 29: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Looking for variables – app.min.js

Page 30: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Looking for variables – app.min.js

Page 31: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Looking for variables – app.min.js

Page 32: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Looking for variables – app.min.js

Page 33: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Recap q We need:

§  streamKey q How do we get it?

§  more.php - getStreamKeyFromSongIDEx §  Session – window.GS.config §  Token - getCommunicationToken §  UUID – copied function from app.min.js §  songID - window.GS.models.queue.models

q more.php - getCommunicationToken

Page 34: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Demo Time

Page 35: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Things I learned

q Downloading music is inconvenient q Services were fairly easy to exploit q  Impossible to completely protect streaming

Page 36: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Things you should know

q People have bad security (shocker) q Several services will patch their code now q Several services won’t patch their code q The same web-traffic logging will work with

some video streaming websites too.

Page 37: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Case Study: Last.fm

q Heavily secured §  Cap bandwidth to match playback speed §  One use tokens §  Users may only have 1 stream open at a time

q Could not exploit §  Would require large amount of time §  Hundreds of lines of obfuscated code §  Bandwidth cap prevents stealing of entire library

Page 38: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Mitigations

q Current technology §  One-time use tokens §  Encrypted streams (rtmpe) §  Returning songs in pieces §  Code obfuscation

q Future proofing: §  HTML5 audio tag with DRM support

q  “HTTP Live Streaming as a Secure Streaming Method” – Bobby Kania, Luke Gusukuma

Page 39: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

References q  Browsershark

§  https://chrome.google.com/webstore/detail/browsershark/jhbjnipjccjloncefdoknhicbnbjaefh

§  Or bit.ly/18UpQtb §  https://github.com/fpayer/browsershark

q  Blog §  http://cyberexplo.it/

q  HTTP Live Streaming as a Secure Streaming Method §  http://vtechworks.lib.vt.edu/bitstream/handle/10919/18662/

Instructions%20for%20HTTP%20Live%20Streaming%20Final.pdf

q  JS Beautifier §  http://jsbeautifier.org/

Page 40: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Contact

q  Twitter: @franz780 q  [email protected]

Page 41: Franz Payer Tactical Network Solutions ://defcon.org/images/defcon-21/dc-21... · What I’m going to talk about ! Background info ! Music streaming basics ! Security investigation

Questions?