Hacking CA system challenge *Tandberg [ NO Keys Allowed in Chat Section/s ]*

xosef1234

Registered
Messages
107
CWs (almost ;)):
Code:
38 6B 01 23 EF 03 D8 D5
Code:
A8 FD 18 9A 70 71 0C 95
I am just wondering if there is any chance to get the EMM key out of the EMM Pid, similar as to how it is possible in PowerVU.... but I do not see where there could be encrypted 00h bytes
 
Last edited:
Messages
44
We need to find out which of the two encrypted CWs is the even and with is the odd one.
So is the first ECW the even and the second the odd or
is the first ECW the odd and the second the even?

So post the first encrypted video packet.
Is this a video packet encrypted with the odd or even CW?
Is the first or the second decrypted CW in the ECM able to decrpyt the video packet?
 

K2TSET

Registered
Messages
125
The 3 first video pactkets which CW: A8 FD 18 BD 70 71 0C ED fits for

47 45 15 96 F1 18 84 3F AB AC 75 80 29 B8 32 2C
47 45 15 94 6C C4 43 5B 0D E4 31 76 9E ED 9E E2
47 45 15 9E 6E 68 50 1F AD 18 3C 52 72 6C D1 15

Sicne we have 9x then I will say EVEN key

PID 13 0x1fff00 Packet Identifier
Scrambling control 2 0xc0 '00' = Not scrambled.
For DVB-CSA only:[11]
'01' (0x40) = Reserved for future use
'10' (0x80) = Scrambled with even key
'11' (0xC0) = Scrambled with odd key
Adaptation field exist 1 0x20 Boolean flag
Contains payload 1 0x10
Continuity counter 4 0xf Sequence number of payload packets (0x00 to 0x0F).
Incremented only when a payload is present (i.e., payload value is true)
Note: the total number of bits above is 32 and is called the transport stream 4-byte prefix or Transport Stream Header.
 
Messages
44
@xosef1234 and K2TSET: Correct

So here is the updated ECM info:
47 45 6F 10: TS header
00: Offset
81: Table ID
70 18: & 0x0FFF -> Section length
EE: Tag ECM_TAG_CW_DESCRIPTOR
16: Length
00 00 16 AB: Entitlement ID
A9 D4 0A 26 FE 79 CB AF: encrypted ODD CW
09 AC 49 F5 B3 42 B3 71: encrypted EVEN CW
AA 02: Checksum


So the next step is writing and posting an offline decrypter like JimBizkit has done it:
http://www.sat-universe.com/showthread.php?t=295123&page=2
It should be able to decrypt my example file.

After this is done we can continue with an other Tandberg recording I have.
We will see that the offline decrypter isn't able to decrypt it and we must enhance it a little bit so that the decryption works with both recordings.
 

harshy

Registered
Messages
736
Will the offline decrypted be able to decrypt the entire recording, if for example I recorded 5 minutes of feed encrypted with this encryption, the offline tool can show all of it?

I suspect with the 0lympics and winbledon there will be a number of opportunities to record these feeds, the latter using t@ndberg dcw when it was last tested
 
Messages
44
Will the offline decrypted be able to decrypt the entire recording, if for example I recorded 5 minutes of feed encrypted with this encryption, the offline tool can show all of it?
My posted Olympic record is a cut from a longer recored.
With the infos we have collected in this thread it's only possible to decrypt my short posted record.
So the first version of our offline decoder will not be able to play the longer recored I have nor is it able to play an other record from an other freq I have.

My offline decoder can decrypt not only the short record I have posted, but also the longer and it can decrypt also the record from the other freq I have.

So we must enhance our offline decoder a little bit so that it can at least decode the same recordings as mine.
 
Last edited:

drhans

Registered
Messages
116
@xosef1234 and K2TSET: Correct

So here is the updated ECM info:
47 45 6F 10: TS header
00: Offset
81: Table ID
70 18: & 0x0FFF -> Section length
EE: Tag ECM_TAG_CW_DESCRIPTOR
16: Length
00 00 16 AB: Entitlement ID
A9 D4 0A 26 FE 79 CB AF: encrypted ODD CW
09 AC 49 F5 B3 42 B3 71: encrypted EVEN CW
AA 02: Checksum


So the next step is writing and posting an offline decrypter like JimBizkit has done it:
http://www.sat-universe.com/showthread.php?t=295123&page=2
It should be able to decrypt my example file.

After this is done we can continue with an other Tandberg recording I have.
We will see that the offline decrypter isn't able to decrypt it and we must enhance it a little bit so that the decryption works with both recordings.

I'm no real developer but wanted to try this, so far, so good, but I got stuck at the very essential part... how the hell do I decrypt an 8-byte array using DES in C++? I tried to adapt this code:

MAIN.cpp

but no idea what I'm really doing, here's what I tried:

Code:
Des odd;
odd.key[0] = ecmKey[0];
odd.key[1] = ecmKey[1];
odd.key[2] = ecmKey[2];
odd.key[3] = ecmKey[3];
odd.key[4] = ecmKey[4];
odd.key[5] = ecmKey[5];
odd.key[6] = ecmKey[6];
odd.key[7] = ecmKey[7];
odd.keygen();
cout << odd.Decrypt(&encrypted_odd_cw) << endl;

where ecmKey is 4a f4 25 4f 6e 13 2c c1
and encrypted_odd_cw is A9 D4 0A 26 FE 79 CB AF

but the code above does not work at all, the program doesn't run, it just crashes... Anyone could help? Thanks
 

drhans

Registered
Messages
116
ok so I realized the des key should be in bits, that's probably the biggest error I was making
 

007.4

VIP
Messages
364
@drhans
4a f4 25 4f 6e 13 2c c1
is not the ECM key.

It is EMM Key index 0x31.
This is used to decrypt the encrypted ECM key found at the end of EMM table 83h.

For those testing, the next two DCWs (with corrected checksums) for the video section 20s though 40s are

OddCW 58AC1D2182563008
EvenCW 0766AD1A9778ABBA
 

drhans

Registered
Messages
116
well so a very dumb and slow but probably working tool is coming up here...

https://mega.nz/#!I5IDSZ6T!I4fqHvSHvnhhvhY7XhY0XS3_OLIHkjUafemFXRvJQhI

password for zip is S@tUn1v3rs3

it worked for me to decrypt the video file...

usage is like this:

tandberg.exe ECM_PID_DEC VIDEO_PID_DEC AUDIO_PID_DEC ECM_KEY INPUT OUTPUT

for example for this video clip that would be:

tandberg.exe 1391 1301 1311 "7B 4B D5 9B 22 7A 61 00" ts_0100_11141H_28500_prg3.ts decrypted_file.ts

(key and anything else with spaces must be in quotes)
 

JimBizkit

Registered
Messages
128
There are multiple ECM keys in the EMMs. Only one is active. How to know which ECM key to use?

Edit: Wrong! I was reading block index not correctly.
 
Last edited:

007.4

VIP
Messages
364
@JimBizkit
I think you mean multiple EMM keys. The key index of which EMM key to use is contained in EMM table 83h. You use this key to decrypt the ECM key.
The plain ECM key (only one) is used to decrypt the ECM to give the even and odd CWs.
======
@All
I've now determined the EMM key table for Arena Sports on 39°E and assuming they use the same master EMM key it is totally different to the one obtained from Colibri's log. Furthermore, it appears to change on the fly within the space of a few minutes.

eg
encrypted EMMs for the same EMM key block

Code:
Key index block 1x =    82 70 8A 00 51 17 E3 F0 84 E4 82 FF [B]FD[/B]   92 B6 D3 6A 74 ....
and then a minute or so later
Key index block 1x  =   82 70 8A 00 52 C5 DE F0 84 E4 82 FF [B]FD[/B]   FA F2 0E 6C 61 ....

So the EMM key table appears to be different for each provider and furthermore it changes very often.
 

JimBizkit

Registered
Messages
128
_https://mega.nz/#!gpoSnb6T!kneVSL2PtSpEXEfldvPtYNx2rSw7R7rDZOBHHFLNs78

usage: poc <input file> <service id> <output file>
Code:
poc ts_0100_11141H_28500_prg3.ts 3 out.ts

decrypted file will not open with vlc for me, but works fine with dvb players



Code:
[Emu] info: FFDecsa parallel mode = 32
[Emu] stream found pmt pid: 576
[Emu] stream found emm_pid: 1F4
[Emu] stream found ecm_pid: 56F
[Emu] stream found video pid: 515
[Emu] stream found audio pid: 51F
[Emu] stream found audio pid: 520
[Emu] stream found audio pid: 521
[Emu] stream found audio pid: 522
[Emu] stream found audio pid: 523
[Emu] stream found audio pid: 524
[Emu] stream found audio pid: 525
got nano E4 keys (block_index 0)
ecm key for entitlement 16AB found! (using emm_key_index: 0)
7B 4B D5 9B 22 7A 61 00 
 
odd cw:
80 D1 00 51 ED 92 AD 2C 
even cw:
A8 FD 18 BD 70 71 0C ED 
 
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
 
odd cw:
80 D1 00 51 ED 92 AD 2C 
even cw:
07 66 AD 1A 97 78 AB BA 
 
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
 
odd cw:
58 AC 1D 21 82 56 30 08 
even cw:
07 66 AD 1A 97 78 AB BA 
 
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
 
odd cw:
58 AC 1D 21 82 56 30 08 
even cw:
72 01 37 AA 88 16 7F 1D 
 
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
 
odd cw:
B4 29 B5 92 6B CE 9D D6 
even cw:
72 01 37 AA 88 16 7F 1D 
 
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
 
odd cw:
B4 29 B5 92 6B CE 9D D6 
even cw:
E9 69 C1 13 A3 D8 10 8B 
 
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 0)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
 
odd cw:
7C 44 CC 8C 1C 9F 6D 28 
even cw:
E9 69 C1 13 A3 D8 10 8B 
 
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
 
odd cw:
7C 44 CC 8C 1C 9F 6D 28 
even cw:
ED F6 3C 1F 03 CD 5C 2C 
 
got nano E4 keys (block_index 2)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
 
odd cw:
30 E4 D7 EB 5C D0 E5 11 
even cw:
ED F6 3C 1F 03 CD 5C 2C 
 
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
 
odd cw:
30 E4 D7 EB 5C D0 E5 11 
even cw:
58 E2 72 AC AE CB EF 68 
 
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
got nano E4 keys (block_index 1)
 
odd cw:
86 FA 8D 0D 0A 85 37 C6 
even cw:
58 E2 72 AC AE CB EF 68 
 
got nano E4 keys (block_index 1)
got nano E4 keys (block_index 2)
 
Last edited:

harshy

Registered
Messages
736
Hello JimBizKit

Many thanks for offline tool

I got poc is not recognized as an internal or external command, do I need to download on a machine which has cuda?
 

JimBizkit

Registered
Messages
128
you need to compile it (this is the source code). on a linux device or with cygwin on windows you need the gcc and make packages installed, then go to the folder with a command line (shell) and enter
make
and it will compile.

or just start to learn programming with c under linux and you will understand it soon.
 
Last edited:

JimBizkit

Registered
Messages
128
here is poc version 1.1. now the pcr stream is included and playback with vlc works
_https://mega.nz/#!RchmlKiS!tFtCmvkjbwh37rXZaAO09lYh9jSXRYHtp9av_NIxg0s
 
Top