Thursday, October 15, 2009

Mbox Config Tutorial

 Mbox Tutorial 



- You should remove all G-Lines And Y lines form your Gbox's cwshare.cfg before you run Mbox unless you use a different cwshare.cfg in a different path with G and Y lines removed ( set for different path in mbox.cfg than the one for Gbox )or Mbox won't run .

- You can use same ignore.list and ident.info for gbox with mbox, they go in the same path /var/keys ( unless you change the path in the settings as explained in this Tut )


- Unlike Gbox, Mbox can not read local cards directly ( not yet at least ) , that is why you need Newcs so you can share your local and have it appear as Local to other peers - explanation in examples here.

- A working cwshare & newcs example added to end of tutorial.


To start Mbox you need to configure mbox.cfg first.
These parameters you must set before you can start Mbox:


D: { 0 }
//D: { x }
//x=0 -> disable
//x=1 -> enable dbox2 cw writing
//x=2 -> enable STAPI for IPBOX
//x=3 -> enable STAPI for Kathrein

T: { /tmp/ }
// T option -> where to store temp files ... (share.info,debug.txt ,etc.)
// T: { folder_path_to_files, example: T: { /tmp/ } }

K: { /var/keys/ }
// K option -> where is cwshare.cfg file
// K: { folder_path_to_files, example: K: { /var/keys/ } }

P: { /tmp/pmt.tmp }
// P option -> PMT location (Dont used with linux and windows)
// you must be tuned to channel so image can generate this file
// { /tmp/pmt.tmp } for resivers and images that create this file <- use this
if you can
// { 1/tmp/camd.socket } for enigma 1
// { 2/tmp/camd.socket } for enigma 2



Now for the start of Mbox you need to know where the mbox.cfg path is.
The default path for mbox.cfg is /var/keys/
For other paths you must start mbox with path as argument!!!

For some receivers like Ipbox and Kathrein there is no /var/keys/ so you must
start mbox always with arguments.

Example:

without arguments
./mbox or ./var/bin/mbox

with arguments
./mbox /data/keys/mbox.cfg or ./var/bin/mbox /data/keys/mbox.cfg

To STOP Mbox you need to create mbox.kill.
Put this mbox.kill in the temp dir of Mbox.T: path (look
your settings in mbox.cfg)

Example T: { /tmp/ }: touch /tmp/mbox.kill


Other parameters of mbox.cfg that are interesting:

M: { 1 }
// M option -> Mode option
// M: { x }
// x=0 -> local mode no NET
// x=1 -> NET mode
// default 0
Z: { 12 } { 127.0.0.1 8000 }
// Z option -> control sending/writing current informations
// Z: { xy } { IP port }
// x=0 -> don't print time stamp (in console screen and in debug file)
// x=1 -> print time stamp ( .... )
// y=0 -> no writing/sending informations to debug file/destination IP
// y=1 -> send informations to destination IP but not in debug file
// y=2 -> write informations to debug file but don't send to destination IP
// y=3 -> write/send informations to debug file/destination IP
// IP port -> destination IP and UDP port where to send informations

Only debug file: Z: { 12 } { 127.0.0.1 8000 }
only send debug to IP: Z: { 11 } { 127.0.0.1 8000 }
Both file and IP: Z: { 13 } { 127.0.0.1 8000 }

L: { 1 }
// L option -> how mbox to menage virtual card(s) with level 0
// ( only for peer(s) who have and can reshare virtual cards but don't want to
use LEVEL 0 card(s) for them self)
// L: { x }
// x=0 -> don't load any virtual cards with LEVEL 0, you can't use them for
your self
// x=1 -> load all virtual cards with LEVEL 0 ,you will be using them for
your self
// default 1

If you run Mbox on a server then you can't use level0 cards
so you have to set:
L: { 0 }


About the cwshare.cfg:

If you don't use a brascet and you must set some other
options after the brascet then don't leave it empty.
Put a zero in it so Mbox knows it's not used.

Example: C: { 127.0.0.1 15000 dummy dummy 01 02 03 04 05 06 07 08 09 10 11 12 13
14 } { 0 } { 0 }

When using Mbox and Newcs on the same box/server then Mbox
can see those cards as local.
But you must make a connection ( C-line in cwshare.cfg) with IP 127.0.0.1.
Only then you will have these cards as local in your Mbox server.


About D line in cwshare.cfg file ...
Now you can set what provids boxids you want to reshare with another peer(s)
- two formats are supported - the normal gbox dline format & Mbox new dline format-

This is standard D line ( gbox format )
=======================
D: { IP { port1 port2 { pass { level1 level2 }}}}


This is my new upgraded D line ( To use for Mbox exchange -Mbox format-)
===============================
D: { IP { port1 port2 { pass { level1 level2 }}}}
{ 0000 } { 0 } send filter
{ 0000 } { 0 } receive filter


D: { IP { port1 port2 { pass { level1 level2 }}}}
{ xxyy !!in hex!!!} { provid-boxid-boxid;provid;provid-boxid; ...!!in hex!!!} send filter
{ xxyy !!in hex!!!} { provid-boxid-boxid;provid;provid-boxid; ...!!in hex!!!} receive filter

for both brascets

xx -> 00 disabled
xx -> 01 allow only this cards for provid to be reshared received
xx -> 02 denied only this cards for provid to be reshared received

yy -> how much provids is in next brascet dont caculate boxids

1st example:
============

D: { IP { port1 port2 { pass { level1 level2 }}}}
{ 0102 } { 0001006A;0001006C-0A0A-0B0B; }
{ 0102 } { 00010080;00010081-0A0A-0B0B; }



{ 0102 } { 0001006A;0001006C-0A0A-0B0B; }

xx is 01 ,ALL cards for (0001006A) provid is SENT to peer AND cards with boxid
0A0A,0B0B for provid 0001006C, ALL others provids(cards) will NOT be sent!!

yy is 02 ,there is only 2 provids in next bracket dont caculate boxids


{ 0102 } { 00010080;00010081-0A0A-0B0B; }
xx is 01 ,ALL cards for (00010080) provid is RECEIVED from peer AND cards with
boxid 0A0A,0B0B for provid 00010081, ALL others provids will be IGNORED!!

yy is 02 ,there is only 2 provids in next bracket dont caculate boxids



2nd example:
============

D: { IP { port1 port2 { pass { level1 level2 }}}}
{ 0202 } { 0001006A;0001006C-0A0A-0B0B; }
{ 0202 } { 00010080;00010081-0A0A-0B0B; }


{ 0202 } { 0001006A;0001006C-0A0A-0B0B; }
xx is 02 ,ALL cards for this (0001006A) provid is NOT sent to peer AND cards
with boxid 0A0A,0B0B for provid 0001006C, ALL others provids(cards) are !!

yy is 02 ,there is only 2 provids in next bracket dont caculate boxids


{ 0202 } { 00010080;00010081-0A0A-0B0B; }
xx is 02 ,ALL cards for (00010080) provid is NOT RECEIVED from peer AND cards
with boxid 0A0A,0B0B for provid 00010081, all others provids will be received!!

yy is 02 ,there is only 2 provids in next bracket dont caculate boxids




NOTICE: MBOX WILL NOT COMPLAIN IF YOU USE OLD D LINE STYLE !!!!!!!!!!!!!



Connecting to newcamd server program Newcs
==========================================

example:
C: { server_ip server_listening_port username password des_key } { x } {
xxxxyyyy:xxxxyyyy;......}
C: { 127.0.0.1 15000 dummy dummy 01 02 03 04 05 06 07 08 09 10 11 12 13 14 } {
10 } { 0100006a:0100006B;}

[second brascet] -> { x } max. number ecms in buffer ,decimal !!!!!

[third brascet] { 0100006a:0100006B;} is used if you want to change caidprovid
from what newcs detected to caidprovid to use with gboxx protocol so 0100006A
will be 0100006B in gboxx protocol




Resending ECM(s) on timeout interval
====================================
O: { xxxx yyyy }

example:
O: { 4000 2000 }

4000 (4 seconds)-> resend current ecm on boxid if no dcw
2000 (2 seconds)-> wait 2 more seconds for dcw ,if no dcw on time resend ecm(s)
to all boxid's



NDS system ->Resending ECM(s) on timeout interval
=================================================
N: { xxxx yyyy }

example:
N: { 400 200 }

default disabled...


Add more cards for CaidProvid
=============================
X+: { xxxxyyyy:zz;xxxxyyyy:zz; } // zz -> max. is 30 !!!!!

example:
X+: { 0100006A:15; }

With X+ active, for caidprovid:0100006A max. cards for use is 15.



About the 12000.list or the port.list:
You need the 12000.list file to run Mbox with your local
cards!!!
If you are sure that your card can decrypt all Sids then put ONLY this in the
port.list file:

SF: { 0000 }

Now you must make file called "port.list" in
K: path (look your settings in mbox.cfg)


"Port" is newcs port, look into the newcs.xml file and search for
newcamd_port.
Code:
......
12000ort> .......

So the file will be called 12000.list.
If you have 17050then the filename will be 17050.list


Pls use SID pids , CHIDs for Irdeto or G line, because now mbox send only one
ECM and wait response from newcs before it send new ECM.

//this is for forbiden SID pids or Irdeto chids ..
//example
SF: { 04A0 } -> forbiden SID pid -> your card cant decrypt this channel
SF: { 0220 }
IF: { 0203 } -> forbiden Irdeto ChID -> your card cant decrypt this ChID
IF: { 0302 }
G: { 0100006A } -> dont list and reshare this provid from your card if card
cant decrypt that, mbox will just flood newcs with bad ECMs for this provid.


//max forbiden SID pids or ChIDs is 150.
//max G lines is 15.


//OR to enable SID pids or Irdeto chids
//example
SA: { 04A0 } -> enable SID pid -> your card can decrypt this channel
SA: { 0220 }
IA: { 0203 } -> enable Irdeto ChID -> your card can decrypt this ChID
IA: { 0302 }
G: { 0100006A } -> dont list and reshare this provid from your card if card
cant decrypt that, mbox will just flood newcs with bad ECMs for this provid.

//NOTE: YOU CANT MIX FORBIDEN AND ENABLED PIDS.



About the add.data file:

You don't need the add.data file to run Mbox!!!

The add.data file gives you the option to:

- change I,X,O,N line
- to delete running D line
- to add new D line(without filter rules)
- to resend "R" hello msg to all peers while mbox is running.

Write new values in "add.data" file and put it in folder from P:
line. (look your settings in mbox.cfg)

NOTE: Max time to wait before changes take affect is 2
minutes, new values for I,X,O,N will NOT be saved in cwshare.cfg but new D or C
line will be saved.
"add.data" file will be deleted after reading (read add.data.example)
!


#D: { ip { port1 port2 { pass { level1 level 2 }}}} -> remove running D line
D: { ip { port1 port2 { pass { level1 level 2 }}}} -> add new D line without
restarting mbox,new D line will be saved in cwshare.cfg
R ->Resend hello msg to all peers
X: { x } -> Change running X value
I: { x } -> Change running I value
O: { xxxx yyyy } -> Change running timeout intervals
N: { xxxx yyyy } -> Change running timeout intervals for NDS system
C: { server_ip server_listening_port username password des_key } { x } {
xxxxyyyy:xxxxyyyy;......} -> add new C line
===========================================

Here is An example of a working cwshare.cfg and newcs.xml ( you must adjust according to your own set-up )

cwshare.cfg :

I: { 02 }
O: { 4000 2000 }
N: { 400 200 }

M: { xxxxx.dyndns.info { SamePASS of your GBOX }} <-- Same line in your gbox's cwshare, do not change anything here .

Add a similar Cline to read your Local as follows - It depends on your newcs.xml ( explained below -note matching colors- ).
C: { 127.0.0.1 34000 dummy dummy 01 02 03 04 05 06 07 08 09 10 11 12 13 14 } { 0 } { 0 } <-- check above for { 0 } { 0 } , it depends on your card .

your same Dlines from gbox goes here now.


NewCS example : for a local Irdeto card in lower slot of DM ( single slot boxes = lower slot ) Pay SPecial attention to colored parts and how they're matched.. these are the most important that will be used in the Cline we mentioned above.

newcs.xml ( found in /var/tuxbox/config )




lower
sci
600
/dev/sci0
odd
normal
Yes
Yes
No
No
No


0000000000000000
000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000
No
000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000
00000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 000000000000
No
yes
34000
Yes
no
0000
round




No
16000

localhost



20
-1



8080
yes



newcs


newcssam


admin



NewCSpwd
normal
init
console,tcp
normal,init
1001
normal,init


Yes
newcs
01 02 03 04 05 06 07 08 09 10 11 12 13 14

dummy
dummy
127.0.0.1
on
off
No



mpcs
dummy
No
No
No

lower
smargo

0




* Since we chose the port 34000 in our newcs.xml and therefore in our Cline in cwshare .. we must create a file called 34000.list that goes in /var/keys ( try putting the line SF: { 0000 } in this file till you figure out what needs to be put according to above tutorial .. depends on the card you have .

0 comments:

Post a Comment