How to Install DDoS Deflate

When you run this Perl script, it will then run an netstat command check how many times each IP is connected and if there are more then the number of connections you specified then it will automatically run a command in APF for the IP to be banned.

Installing:

wget http://www.inetbase.com/scripts/ddos/install.sh
chmod 0700 install.sh
./install.sh

Uninstalling:

wget http://www.inetbase.com/scripts/ddos/uninstall.ddos
chmod 0700 uninstall.ddos
./uninstall.ddos

How to Close Open DNS Servers

How do I check my system?
Go to www.dnsreport.com

Edit the /etc/named.conf file such.

And then look for:

key “rndckey” {
};

After this add the following, replacing mainIP and secondaryIP with your systems nameservers.

acl “trusted” {
mainIP;secondaryIP;127.0.0.1;
};

After that’s done you want to add the section that says only the trusted is allowed for certain functions. Check your options area and make sure you add the following:

allow-recursion { trusted; };
allow-notify { trusted; };
allow-transfer { trusted; };

Then Restart DNS

How to Ban an IP Address From The Server

If you are running iptables, you can enter:

iptables -A INPUT -s ipaddress -j DROP

If you have APF firewall installed

apf -d ipaddress

Restore off a mounted slave disk

rsync -vrplogDtH /mnt/old/usr/local/apache/conf /usr/local/apache
rsync -vrplogDtH /mnt/old/var/named /var
rsync -vrplogDtH /mnt/old/home/* /home
rsync -vrplogDtH /mnt/old/usr/local/cpanel /usr/local
rsync -vrplogDtH /mnt/old/var/lib/mysql /var/lib
rsync -vrplogDtH /mnt/old/var/cpanel /var
rsync -vrplogDtH /mnt/old/usr/share/ssl /usr/share
rsync -vrplogDtH /mnt/old/var/ssl /var
rsync -vrplogDtH /mnt/old/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
rsync -vrplogDtH /mnt/old/var/log/bandwidth /var/log
rsync -vrplogDtH /mnt/old/usr/local/frontpage /usr/local
rsync -vrplogDtH /mnt/old/var/spool/cron /var/spool

-v, –verbose increase verbosity
-r, –recursive recurse into directories
-l, –links copy symlinks as symlinks
-o, –owner preserve owner (super-user only)
-g, –group preserve group
-D same as –devices –specials
-t, –times preserve modification times
-H, –hard-links preserve hard links

Next from : cd /mnt/old/etc

rsync -vrplogDtH secondarymx domainalias valiases vfilters exim* proftpd* pure-ftpd* passwd* group* *domain* *named* wwwacct.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl /etc

Repairing MyISAM mySQL Tables and Databases:

Repairing MyISAM mySQL Tables/Databases.
Please note that we assume your mySQL data directory is /var/lib/mysql

cd /var/lib/mysql/DBNAME
myisamchk -r *.MYI

« Prev - Next »