DRMed TV stream

For some time I’m living with a friend who now uses Linux on her computer, but mostly because she likes the idea of Linux, and also because the Ubuntu install breaks less often than the Windows Vista preinstalled on that computer, works faster etc., but not because she likes coding or digging in the intestines to customise things or make rare things work.  As a result every some time I’m asked to make this and that work. This week’s request was to enable her to watch a TV programme she likes, one that is aired on the TVN24 channel.  Since I don’t watch TV, she bought a three-day online subscription to TVN24 after she googled an Ubuntu forums post where someone had success watching TV on Ubuntu.  So it turns out the channel indeed can be watched online if you have a Microsoft DRM-enabled player.  Also it turns out that mplayer does support Microsoft DRM decoding using code borrowed from the FreeMe2 opensource DRM decoder.

That is, only if you have the DRM key, particularly the SID which is a 30 or so digit number and which seems to be unique to the TV channel or a group of songs or a movie if you buy it through one of the online services.  It’s as simple as passing -demux lavf -lavfdopts cryptokey=<The-SID>.  Apparently the SID doesn’t change very often so it would probably enable you to watch the TV beyond the subscription period, but that wasn’t my goal, I just need an open-source player. The activation or deactivation of the subscriptions are handled using some non-cryptographic methods (IOW security through obscurity only).  That means that the SID is well hidden in Windows when Windows Media Player downloads the DRM keys, and it seems the method of hiding it is different in each new version.  Windows Media Player also checks that you’re using the latest DRM version every time you download a new DRM license.  I’m not sure if the method of requesting and downloading the licenses also changes, I’d guess it changes less often or is completely standardised.  Unfortunately all software that I was able to find to extract the SID is based on reading the Windows key storage structures, registry etc. from disk (which change), rather than interpreting the network communications between the client and the server.  It seems the central place for all this software is the undrm.info website which has been pretty stagnant since 2008, so none of these programs work with the latest Windows Media Player anymore.

We restored the Windows Vista partition to a bootable state and launched the closed-source player there, but I have a tcpdump of all the communication that was happening between the client and the license server up to when it started playing.  The protocol (as of 2008) has been beautifully documented by Beale Screamer and it seems the dump contains all of the elements mentioned there.  I’d love to implement the algorithms from that documentation to try to calculate the SID, if I had a week of vacations on a desert island or was retired :)  But if anyone else has time to play with it and wants that achieve undying fame (or an undying subscription to the various TV channels), I’ll happily give you the TCP log, a sample encrypted fragment of the wmv stream, or give links to other places that use Ms DRM, and links to existing code and documentation.

One Response to “DRMed TV stream”

  1. dmc France Says:

    Could not agree far more with you.

Leave a comment