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.
./CCcam.x86 -dv > /home/debug.txt
then change the following lines in the script to match the debug file and it's location.
workdir="/"
Should be
workdir="/home"
and this line
firewall="/"
Should be changed to where you want the firewall rules to be saved
firewall="/emu/log/"
To insert it in the crontab, edit it and insert this line:
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:
apt-get install nail
apt-get install exim4
dpkg-reconfigure exim4-config
Insert here a valid email adress
EMAIL=""
and it will mail you every time it runs and finds an illegal user. If no user is found, it will not mail you.
Re-Shared Post
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.
./CCcam.x86 -dv > /home/debug.txt
then change the following lines in the script to match the debug file and it's location.
workdir="/"
Should be
workdir="/home"
and this line
firewall="/"
Should be changed to where you want the firewall rules to be saved
firewall="/emu/log/"
To insert it in the crontab, edit it and insert this line:
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:
apt-get install nail
apt-get install exim4
dpkg-reconfigure exim4-config
Insert here a valid email adress
EMAIL=""
and it will mail you every time it runs and finds an illegal user. If no user is found, it will not mail you.
Re-Shared Post
Comment