How Do I Crack Satellite and Cable Pay TV Slides
How Do I Crack Satellite and Cable Pay TV Slides
How Do I Crack Satellite and Cable Pay TV Slides
Chris Gerlinsky
@akacastor
chris@pdrnorth.com
Satellite Cable
Modulation: Modulation:
DC2 QPSK ~27 Mbit QAM 256 ~38 Mbit
8PSK Turbo FEC ~38 Mbit
Out-of-band:
QPSK 2 Mbit
Video format:
MPEG-2 or H.264 Transport Stream (MPEG TS)
Encryption:
Digicipher 2 (not DVB standard)
MPEG Transport Stream
27 – 38 Mbit
188-byte packets
Categorized by 13-bit PID
(0 - 0x1FFF)
PAT contains list of programs: PID carrying PMT ECM are sent in pairs
PMT contains list of PIDs for video, audio, ECM Cable: EMM are OOB
Genpix SkyWalker-1 USB satellite interface
http://updatelee.blogspot.ca/2010/09/genpix-skywalker-1-linux-driver-mods.html
https://bitbucket.org/updatelee/v4l-updatelee
Hauppauge HVR 950Q ATSC / QAM USB interface
Using dvbsnoop to view PMT PID 0x129 TS sub-decoding (1 packet(s) stored for PID 0x0129):
=====================================================
TS contains Section...
SI packet (length=41):
PID: 297 (0x0129)
DC2 tables
VCT – Virtual Channel Table
NIT – Network Information Table
NTT – Network Text Table
MGT – Master Guide Table
DVB equivalent
BAT – Bouquet Association Table
SDT – Service Description Table
EIT – Event Information Table
Working Key
56-bit DES
Lifetime: 133 ms to 1 second
TVpass slot
MPEG decoder
Power supply
STB controller
Battery
TVpass slot Cable tuner
(underneath) OOB tuner
Power supply
STB controller
ACP
Battery
Transport Stream input
(from tuner)
SPI slave
Battery
MISO
MOSI
Jumpers to hold STB /RST
SCK
SCK
/SS
/SS
and to connect MISO,
to act as SPI master
< 80 05 00 05
> 55 05 09 FE 16 00 10 D3 99 FA 20 00 64
^^^^^^^^^^^^^^
UA# - Unit Address of STB
< 80 12 00 12
> 55 12 13 00 00 02 04 03 04 02 04 03 04 0C 6D 05 14 0D FC 00 00 00 80
^^^^^^^^^^^ ^^^^^^^^^^^
|| Keyselect for next category epoch
Keyselect for current category epoch
< 80 13 02 00 00 11
> 55 13 22 00 C0 4C 61 87 11 00 51 A1 00 DF 23 80 E0 01 98 D1 3F 00 80 41 00 08 20 48 00 00 00 D0 41 15 81 00 44 B1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Subscription tiers
> 55 87 13 00 11 22 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^^ ^^ ^^^^^^^^ ^^ ^^ ^^
|| || || || || Next program key epoch
|| || || || Current program key epoch
|| || || Encryption mode – ZK / FP / FW S
|| || Service ID of this channel
|| 00 = Tuner0, 80 = Tuner1
07 = Response to Cmd07
87 = Unprompted response due to change in access rights (channel change etc)
Software disassembly (IDA)
Simulator
Sim65:
a 65c02 simulation system
http://www.wsxyz.net/sim65/
✗ Keys: Seed keys, category keys, program keys only exist in RAM
ECM40 – Working Key
40 00 11 00 2D 80 07 2B 16 FA 22 04 00 00 00 BB
40 00 11 00 2D 80 07 2B 16 FB 22 04 00 00 01 42
40 00 11 00 2D 80 07 2B 16 FC 22 04 00 00 00 D2
^^^^^^^^ ^^^^^^^^ ^^ ^^
Service ID Frame Count HW Crypt Mode
40 00 11 00 2D 80 07 2B 16 FB 22 04 00 00 01 42
ECM40 Frame Count 2B16FB
41 40 41 10 20 00 2D 80 07 75 6E 2A CE 13 09 E3
40 9E F1 9F E7 76 9A 7E BC 00 00 00 08 05 00 01 ECM41 Validity Start 2ACE13 (current key)
35 03 00 00 06 03 00 00 83 03 00 00 A9 03 00 00
C0 03 00 02 54 03 01 00 AB 69 1C D1 12 A8 CE D5
95 10 93 00 13 27 49 45 00 00 00 00 00 01 86 C0 95 10 94 00 13 27 49 45 00 00 00 00 00 03 84 C0
00 75 00 00 40 75 77 07 CD E5 79 84 A7 12 BD 46 00 75 00 00 40 DB 9B 83 88 DA 80 81 FE CD 14 50
30 60 41 D2 B2 02 04 03 04 02 04 03 04 01 00 01 FC A7 ED 27 69 02 04 03 04 02 04 03 04 05 40 03
DF 30 14 00 00 00 00 C0 02 00 00 00 81 13 5E 20 DF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1C 42 00 00 46 20 00 00 00 10 40 00 00 00 08 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2F 0F 10 FF FF FF 11 FF FF FF 12 FF FF FF 13 FF 00 DF 00 00 00 00 00 00 00 00 00 00 00 00 00 00
FF FF 14 FF FF FF 15 FF FF FF 16 FF FF FF 17 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
FF FF 18 FF FF FF 19 FF FF FF 1A FF FF FF 1B FF 00 00 DF 00 00 00 00 00 00 00 00 00 00 00 00 00
FF FF 1C FF FF FF 1D FF FF FF 1E FF FF FF 1F FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
FF FF 00 00 00
95 10 A6 00 13 27 49 45 00 00 00 00 00 00 BE C0
00 75 00 00 40 29 20 8E 2D 88 B1 6B 44 1C 10 C3
C3 FB 21 B3 EB 02 04 03 04 02 04 03 04 0D 6C 09
90 0D AA 00 00 00 00 00 00 00 00 00 00 02 10 20
00 80 01 DF 00 60 87 03 00 50 F1 00 DF 23 00 80
00 80 91 33 80 00 40 00 00 22 48 00 00 01 00 41
05 80 00 44 0F 00 FF FF FF 01 FF FF FF 02 FF FF
FF 03 FF FF FF 04 FF FF FF 05 FF FF FF 06 FF FF
FF 07 FF FF FF 08 FF FF FF 09 FF FF FF 0A FF FF
FF 0B FF FF FF 0C FF FF FF 0D FF FF FF 0E FF FF
FF 0F FF FF FF
0013274945 Unit Address (UA) 8-byte Encrypted Category key (next)
00 EMM part # 02040304 Keyselect
BEC0 Bitmap indicating data items to follow 02040304 Keyselect (next)
00 Hardware crypto select 7-byte Geographic location
75 Category Epoch 1020 Provider ID
8-byte Encrypted Category key 00 Start of tier bank 0
Decryption using Fixed Working Key
Encrypted Decrypted
transport stream DES descrambler MPEG transport stream
decrypt TS using
fixed working key
ECM40 processing
Encrypted Decrypted
ECM use fixed program key to
transport stream MPEG transport stream
decrypt working key
from ECM40
encryp
ted vid
DES descrambler
eo & a
By the bit
262,144 bits total
105 bit errors
= 0.04 % error rate (99.96% accuracy)
By the byte
32,768 bytes total
104 byte errors
= 0.32 % error rate (99.68% accuracy)
screwdriver handle
Transport Stream scrambling
188-byte TS packet
47 12 34 00 4-byte header
01 01 01 01 01 01 01 01 02 02 02 02 02 02 02 02 03 03 03 03 03 03 03 03 04 04 04 04 04 04 04 04
05 05 05 05 05 05 05 05 06 06 06 06 06 06 06 06 07 07 07 07 07 07 07 07 08 08 08 08 08 08 08 08
09 09 09 09 09 09 09 09 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12
13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16
17 17 17 17 17 17 17 17 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20
21 21 21 21 21 21 21 21 22 22 22 22 22 22 22 22 23 23 23 23 23 23 23 23
Analyzing scrambling
➔ Flip bits in ciphertext to observe results in decrypted result (CBC/ECB/OFB modes)
● one bit flipped corrupts one 8-byte block plus corresponding bit in next block: CBC mode
➔ Observe timing of decryption, look for changes in timing due to algorithm differences
● changes to algorithm such as number of rounds should have effect on timing
➔ Use DES HW as oracle
● send test data through ACP, controlling data, key, and all H/W registers
➔ Use DES weak keys (all 0 or all 1) and observe if behaviour matches standard DES
● encryption and decryption operations are equivalent when using key made of all 0 or all 1 bits
DES “weak keys”
Weak key Non-weak key
With DES key of all zero bits, If even one bit is nonzero, encryption and
encryption and decryption have same effect. decryption produce different effects.
Cracking Hardware Customization: DES key XOR taps
● Using H/W DES engine: Decrypt 23 blocks of 00 data, with 00 key, and customization enabled
● In software: Try decrypting 00 data with all combinations of key having 1 or more bits flipped
● Check for decryption matching any of the 23 blocks
● Positive results seen within seconds – some XOR masks have as few as 3 bits set
Cracking Hardware Customization: DES data XOR taps
DES hardware 8-bit register:
00 = standard DES
01 – FF = customization
XOR gates
M
EM
from EMM95 module
Encrypted Decrypted
transport stream ECM41 processing ECM40 processing MPEG transport stream
ECM
use category key to use program key to video playable using
included in transport
stream are tables for
decrypt program key decrypt working key common MPEG decoders
conditional access from ECM41 from ECM40 and software players
(example: VLC)
encr
ypte
d vide
DES descrambler
o&
a udi with h/w customization
o
(key XOR)
Weaknesses