Hey, heres my Tutorial How to block some DDoS Attacks =)
nano /etc/sysctl.conf
add this
save it, and do this: sysctl -p or reboot your server.
now we install csf firewall by doing this:
to test if it will work correctly on your server
If you see this, everything seems to be fine.
If not, you have to activate the Modules by pasting this:
then we have to make some changes to make the csf firewall work creamy
nano /etc/csf/csf.conf
then u change
to
to activate it and stop testing mode.
to
so you cant ping the server =)
to
to
to
note if "ipt_recent" module not working, you can skip this step.
to
ok, now we have csf firewall installed.
now you do syn deflate
if it says
it should be fine, if not you create the cronjob manually.
by typing
and pasting this:
Now we do synblock.
To block some Attacks by Hand.
u change Intervall to 0
u change MAX_REQ to 15
then u save it and if u are under attack u can type synblock -m
then u let it load a bit...
then u press ctrl + c and press synblock -b
and some ips should be blocked.
Hope I helped a bit.
Questions? Or you are under DDoS and need help blocking it?
PM ME!
nano /etc/sysctl.conf
add this
Code
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.default.rp_filter = 1save it, and do this: sysctl -p or reboot your server.
now we install csf firewall by doing this:
Code
cd
mkdir csf
cd csf
wget http://www.configserver.com/free/csf.tgz
tar xfvz csf.tgz
cd csf
./install.shto test if it will work correctly on your server
Code
cd /etc/csf
./csftest.plCode
[root@loadbalancing1 csf]# ./csftest.pl
Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing ipt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OKIf you see this, everything seems to be fine.
If not, you have to activate the Modules by pasting this:
Code
modprobe iptable_nat
modprobe ipt_owner
modprobe ipt_recentthen we have to make some changes to make the csf firewall work creamy
nano /etc/csf/csf.conf
then u change
Code
TESTING = "1"Code
TESTING = "0"Code
# Allow incoming PING
ICMP_IN = "1"Code
# Allow incoming PING
ICMP_IN = "0"Code
# Allow outgoing PING
ICMP_OUT = "1"Code
# Allow outgoing PING
ICMP_OUT = "0"Code
DROP_PF_LOGGING = "0"Code
DROP_PF_LOGGING = "1"Code
SYNFLOOD = "0"
SYNFLOOD_RATE = "100/s"
SYNFLOOD_BURST = "150"Code
SYNFLOOD = "1"
SYNFLOOD_RATE = "300/s"
SYNFLOOD_BURST = "300"note if "ipt_recent" module not working, you can skip this step.
Code
PORTFLOOD = ""Code
PORTFLOOD = "80"Code
/etc/init.d/csf startok, now we have csf firewall installed.
now you do syn deflate
Code
wget http://www.Anti-Hack.net/scripts/synd/install.sh
mv install.sh?drgn=1 install.sh
chmod 0700 install.sh
./install.shCode
cd /usr/local/synd
./synd.sh --cronif it says
Code
Stopping crond: [ OK ]
Starting crond: [ OK ]
Stopping crond: [ OK ]
Starting crond: [ OK ]it should be fine, if not you create the cronjob manually.
by typing
Code
crontab -eCode
*/1 * * * * root /usr/local/synd/synd.shNow we do synblock.
Code
wget http://www.Anti-Hack.net/scripts/synblock/install.sh
mv install.sh?drgn=1 install.sh
chmod 0700 install.sh
./install.shTo block some Attacks by Hand.
Code
cd /usr/local/synblock
nano synblock.confu change Intervall to 0
Code
#Intervall des Monitors
speed=0u change MAX_REQ to 15
Code
MAX_REQ=15then u save it and if u are under attack u can type synblock -m
then u let it load a bit...
then u press ctrl + c and press synblock -b
and some ips should be blocked.
Hope I helped a bit.
Questions? Or you are under DDoS and need help blocking it?
PM ME!



