How to : Auto ban Illegal CCcam Users in Debian

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

    • Official Post

    After some time, You see peers that don't delete you're line once removed or worse, they hand out the line to all kind of people who try to gain access to you're server.


    For this i took the basic idea of a script from Unlocker-al and put together this little ban script.





    This script will scan you're debug file for illegal users, sort out the username and ip and insert the IP in ip-tables.


    If you want, the script can also mail you the result so you know what users are put in ip-tables and gives you the advantage to check if it's not a valid user.


    You can put this script in the crontab to enable automatic checking.
    The following is an example how to install.



    PHP
    ./CCcam.x86 -dv > /home/debug.txt


    Then change the following lines in the script to match the debug file and it's location.





    PHP
    workdir="/"



    Should be :



    PHP
    workdir="/home"


    and this line :




    PHP
    firewall="/"


    Should be changed to where you want the firewall rules to be saved Code:




    PHP
    firewall="/emu/log/"


    To insert it in the crontab, edit it and insert this line:




    PHP
    00 */1  * * * root /emu/script/./illegal.sh


    This will run the script every whole hour.


    For the mail function to work, you have to do the following:




    PHP
    apt-get install nail
    apt-get install exim4
    dpkg-reconfigure exim4-config


    Insert here a valid email address





    PHP
    EMAIL=""


    It will mail you every time it runs and finds an illegal user. If no user is found, it will not mail you.


    Not my work, thanks to the original author.

  • be careful when using this script. If a connected peer has an ip change whilst being an idle peer then requests an ecm under his recently changed ip address this script will ban him/her as it will see a double login / illegal user attempt


    new2

    Dont forget to hit the thanks button!!!!!!!!!!!!!



    :41_002:



    Some articles may discuss topics that are illegal, so this information is provided for educational purposes only, your use of the content, downloads and files, or any part thereof, is made solely at your own risk and responsibility. Viewing Pay TV without a valid subscription is illegal. !! Linuxsat-Support.com cannot be held responsible for the content of any information stored or posted on this forum.

  • Start CCcam and log to /home/debug.txt


    Hi,
    Thanks for your reply.
    I am struggling with fail2ban and not working.
    I see failed peer in emu/log/debug.txt file but I can not see his IP as "banned".
    Also check /var/log/auth.log and fail2ban.log files.


    PC: Debian 5.0


    illegal.sh :



    CCcam.cfg file:

    Code
    CHANNELINFO FILE : /var/etc/CCcam.channelinfo
    PROVIDERINFO FILE : /var/etc/CCcam.providers
    LOG WARNINGS : /emu/log/debug.txt
    CAID PRIO FILE : /var/etc/CCcam.prio
    DEBUG : yes
    WEBINFO USERNAME : admin
    WEBINFO PASSWORD : password
    WEBINFO LISTEN PORT : 9222
    SERVER LISTEN PORT : 9999
    SHOW TIMING : YES


    rc.local :

    Code
    /var/bin/CCcam.x86 -dv > /emu/log/debug.txt -C /var/etc/CCcam.cfg &



    Thanks in advance
    Hislitermos

  • master G

    Added the Label Article

Participate now!

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