Bypassing Flash

Yoan BlancMon, 18 Sep 2006, ,

This slashdot entry MySpace Music Player Hacked inspired me. How should I do if I want to hack a any MP3 flash player ? I don’t tell you how to do this kind of hack but how it’s possible to do and what are the tools. The main goal of this entry is how a site can protect itself (if it’s possible). Knowing our enemies’ tools is the better way to beat them.

One way is to have the same behaviour of the web browser and the Flash player. But how to know this behaviour ? Wireshark (formerly Ethereal) gives you the access to the HTTP requests. You know now what you will fake.

Sometimes there is a small protection hardwrited (that’s pretty bad) in the player. Next step is to extract the ActionScript of the player. Flare is there for you.

Now this to act, with a little piece of doc like the excellent Mark Pilgrim’s Dive Into Python and some time to kill, you gonna make it.

The interesting question is how to protect yourself ? AtomAPI authentication isn’t a bad starting point. But you’re not protected from the Hooking guys or the Audio Hijack dudes. Doing like some major radios and playing, at the beginning of the song, another sound (like a jingle) can be an interesting solution. And why not having a system that you can only download a portion of the song and the flash player will append the pieces ? I’m not an expert of Flash. Probably, if you recode every mp3 in a very low bitrate nobody will care about your songs.

Un récent article sur slashdot MySpace Music Player Hacked m’a fait réfléchir sur comment peut-on s’y prendre pour réaliser ce type de facilité.

La première étape me semble être : connaître le comportement du système. Un outil comme Wireshark (connu sous le nom d’Ethereal) permet d’obtenir toutes les requêtes HTTP et leurs réponses afin de bien comprendre ce qui s’y passe. Ne pas oublier bien sûr de fouiner un peu dans l’HTML des pages.

Parfois, il peut y avoir une protection écrite en dur (c’est mal) dans le client Flash. Un outil comme Flare est là pour vous.

Maintenant, sortez le serpent de sa boite, l’excellent documentation Dive Into Python de Mark Pilgrim et passez une ou deux heures sur le problème et vous devriez y arriver.

Maintenant le point important de ce poste, qui n’a pas vocation de vous inciter à hacker le premier système de lecture de fichiers mp3 venu mais de mettre en évidence les outils dont disposent les personnes aillant pour but de garnir leur iPod tout neuf de mp3 tout aussi neuf — Je ne possède aucun lecteur mp3 —, comment un site peut-il se protéger ? Je pense que l’authentification de l’AtomAPI est un bon moyen de garantir que l’on parle (en tant que serveur) toujours à la bonne personne (son client player Flash et pas un méchant script). Mais vous ne serez toujours pas à l’abri des Hookeurs ou des Audio Hijackeurs. Un autre solution pour ceux qui enregistre la sortie audio dans un fichier audio serait de faire comme les radios qui ont des jingles qu’elles passent au beau milieu des chansons. Quant aux hookeurs (vive le franglais) pourquoi pas avoir un système qui ne retourne qu’une partie du fichier et Flash aurait la charge de remettre de l’ordre. De toute façon à partir du moment où le fichier peut-être entendu, il peut être enregistré.

Ne négligez jamais la débrouilladise des utilisateurs et ne reposez jamais un système de protection sur l’obscurantisme.

Digg it!, so del.icio.us, blogmarks, reddit.