Sleep parameter oscam

There are 5 replies in this Thread which was already clicked 4,740 times. The last Post () by supermariocs.

    • Official Post

    If you`ve got a client that constantly leaves it on a channel thats not being used you can use the sleep parameter to solve this.
    This will only work with camd35 protocol.
    I`ve not implemented this parameter yet so if anyone has used it with success please add to this thread.


    oscam.user


  • You can write your own script to make it work even in Cccam.
    I think I have it somewhere. Will post when I find. But this is the procedure:
    - run wget in crontab to download activeclients list from 16001 and save the list (filename1)
    - run again the same thing after x period of time you wish and save it as (filename 2).
    - repeat those actions in rotation so you will delete the oldest file and create new one all the time.
    - clean the files from unnecessary fields and leave only client name, IP and channels he's watching
    - compare the files and look for clients that have identical lines (watching same channels).
    - cut their IP and send it to Iptables for a ban. Just make sure you flush the IP tables at least once a day.
    - you can also cut the sid and ban from him only the specific channel through CCcam.cfg but this demands much more work since you need to find his F line and add this SID in specific location in CCcam.cfg. I wouldnt mess with this thing. Simple IP ban for limited time would do the job.
    CHEERS

  • your saying if guy leaves channel i.e (sports1) on all night, this will more or less knock him off till box becomes active again.. if so i think this is good guys.. badly needed

  • Well... we can make it work if you really want. Even this 3 hours zapping request. It will require to join forces and start writing the script since I dont have enough time to write it alone.
    We can monitor debug file and extract data from there. If user is watching the same channel for 3 hours, we ban him on IP tables.
    And then release him for 10 minutes and if he's still on the same channel, ban again. Something like fail2ban script.

  • OK
    Here is the plan:
    - Record last 10 minutes of debug file in intervals of 6 hours (can be changed to 3 hours).
    - Rotate always latest 2 files and erase older ones.Use filter to extract only user data (username and sid).
    - Compare two files and see if last watched channel (sid) is exactly the same in both files (for each user separately).
    - If lines are exactly the same, this means user has been watching the same channel for at least 6 hours.
    - For users that have been watching the same channel, find their IP and send it to iptables (DROP).
    (iptables need to be flushed 2-3 minutes before we execute the compare&ban script. So we can test again those users that have been previously banned)


    Possible problems:
    - Need to find a simplest way to extract IP address from user name. CCcam debug contain this data, but it can be very old and buried deep inside the log. For example, if user connected on 18.8.2011 and stayed online till 20.8.2011 without disconnecting, then this could be problematic to find.
    I was thinking to use web interface (16001) and get the IP from there.
    - If the user watched channel 1 when we first save the log, and then changed to other channels but again returned to channel 1 on next sampling time, he will get banned although he did changed channels in the middle.


    Any ideas, help or improvements are WELCOME!!
    :30_002:

OSCam Support Forum

Configs, discussion, downloads and guides for OSCam Softcam.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!