Block deleted CCcam users
This script was written to work on standard Linux machine with iptables firewall installed. However, i see no reason why this script (with some modifications) wouldn’t work on any Enigma1 / Enigma2 based image with iptables installed. Idea was to block unwanted users from trying to connect to your CCcam server. directly on firewall. There can be few reasons for this:
* you deleted the F: line but client still tries to connect every 15 seconds
* client has a valid login, but keeps on reconnecting every 15 seconds because his line was hacked, or simply bad connection
In order for this script to work i had to make some presumptions:
* script will be run by cron daemon every XX minutes
* CCcam is running in debug mode (-d switch) and log is being written on disk
* log is deleted/moved after every script run
* script uses iptables firewall to block users
* firewall is beeing “cleaned” once a day
* person reading this knows what he/she is doing and understands the conecept
Script has two parts.
First one goes trough CCcam log file, finds “invalid user” and blocks all traffic FROM this addresses. Meaning you will still have to connect to their server.
Second part blocks users with to many connection attempts in specified period of time. You have to set values inside the script maximum number of reconnect attempts between two script runs, and how long you would like person to be blocked. When block expires user will be allowed to connect, if problem keeps repeating it will be blocked again. This way person will be allowed to connect every XX minutes, and user will not see your server offline for hours or days.
* you deleted the F: line but client still tries to connect every 15 seconds
* client has a valid login, but keeps on reconnecting every 15 seconds because his line was hacked, or simply bad connection
In order for this script to work i had to make some presumptions:
* script will be run by cron daemon every XX minutes
* CCcam is running in debug mode (-d switch) and log is being written on disk
* log is deleted/moved after every script run
* script uses iptables firewall to block users
* firewall is beeing “cleaned” once a day
* person reading this knows what he/she is doing and understands the conecept
Script has two parts.
First one goes trough CCcam log file, finds “invalid user” and blocks all traffic FROM this addresses. Meaning you will still have to connect to their server.
Second part blocks users with to many connection attempts in specified period of time. You have to set values inside the script maximum number of reconnect attempts between two script runs, and how long you would like person to be blocked. When block expires user will be allowed to connect, if problem keeps repeating it will be blocked again. This way person will be allowed to connect every XX minutes, and user will not see your server offline for hours or days.