Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well dunno how to start but i will try to explain what is going on.
On my website i have lots of users and lots of haters. Some of the haters were trying to shutdown my website but was unsuccessful. Until now! . Some one figure out if they do Ddoss-dos attacks from irc with spoofed ip's and with a lot of bandwidth, they would bring my connection down to 0 . Which happened
Well i have tried to put some iptables rules and hoped that will help but no luck still.
I'm using debian with the latest 2.4.x kernel...
Here are some of the log's that i am getting from netstat...
tcp 0 0 my.url.com sh cncln.online.ln.cn:1945 SYN_RECV
tcp 0 0 my.url.com sh cncln.online.ln.cn:1986 SYN_RECV
tcp 0 0 my.url.com sh 198.105.47.159:1205 SYN_RECV
tcp 0 0 my.url.com sh cncln.online.ln.cn:1650 SYN_RECV
tcp 0 0 my.url.com sh 198.105.47.104:1919 SYN_RECV
tcp 0 0 my.url.com sh 198.105.47.104:1919 SYN_RECV
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379
Rep:
Setup a firewall! Iptables with following enable in it
Enable flood control
Drop all Spoofing and bad addresses
Do Sanity check and drop
Make sure NEW incoming tcp connections are SYN packets
Drop all incoming fragments
Drop all incoming malformed XMAS packets
Drop all incoming malformed NULL packets
Bad incoming source ip address 0.0.0.0/8
Bad incoming source ip address 127.0.0.0/8
Bad incoming source ip address 10.0.0.0/8 and all other private ips
etc
May also want to check out Apache's mod_dosevasive. It has some tools to defend against DOS attacks. But the more important thing is to setup the firewall as mentioned above. Probably the most important rules would be:
Code:
# Limit SYN packet requests
$IPTABLES -N syn-flood
$IPTABLES -A INPUT -i $INTERFACE -p tcp --syn -j syn-flood
$IPTABLES -A syn-flood -m limit --limit 1/s --limit-burst 4 -j RETURN
$IPTABLES -A syn-flood -j DROP
This will limit the amount of SYN packets coming into your server.
Last edited by TruckStuff; 02-02-2005 at 08:48 AM.
i do have iptables set up and use all kinds of settings that i red of the internet
iptables -A INPUT -s any/0 -p tcp --syn -j DROP
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts /for smurf etc..
sysctl -w net.ipv4.tcp_max_syn_backlog="2048" to max the open pipes..
but im unsure how to setup the other things u mentioned.. Sanity check, xmas, null...
But what I've seen is that even if i drop the syn_ack they still get recieved, so there is no chance of saving that bw but it still succedes in killing my connection and makes it almost impossible to ssh to the box
TruckStuff:
* The apache is off, this is towards the ssh port or any port that they find open...
* should i really RETURN the syn requests? isn't it better to DROP that to?
i have tried but i got some´errors when i run it..
etc/rc.d/init.d/giptables: line 39: /etc/rc.d/init.d/functions: No such file or directory
/etc/rc.d/init.d/giptables: line 42: /etc/sysconfig/network: No such file or directory
/etc/rc.d/init.d/giptables: line 45: [: =: unary operator expected
Starting up GIPTables Firewall: /etc/rc.d/init.d/giptables: line 92: success: command not found
/etc/rc.d/init.d/giptables: line 93: failure: command not found
The firewall still works tho, but i never like error messages when it comes to a fw that´s supposed to save my ass
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379
Rep:
Quote:
Originally posted by GNU i have tried but i got some´errors when i run it..
etc/rc.d/init.d/giptables: line 39: /etc/rc.d/init.d/functions: No such file or directory
/etc/rc.d/init.d/giptables: line 42: /etc/sysconfig/network: No such file or directory
/etc/rc.d/init.d/giptables: line 45: [: =: unary operator expected
Starting up GIPTables Firewall: /etc/rc.d/init.d/giptables: line 92: success: command not found
/etc/rc.d/init.d/giptables: line 93: failure: command not found
The firewall still works tho, but i never like error messages when it comes to a fw that´s supposed to save my ass
This works without problem on RHL/RHEL may be some code need to change on Debian
do you have syn_cookies enabled?
i don't know where it is in debian but in red hat you hav to edit /etc/sysctl.conf and add the following line:
net.ipv4.tcp_syncookies=1
or try: #sysctl -w net.ipv4.tcp_syncookies=1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.