LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-16-2004, 10:15 AM   #1
arthurb
LQ Newbie
 
Registered: Sep 2004
Location: Warsaw, Poland
Distribution: sarge
Posts: 7

Rep: Reputation: 0
ip_conntrack and worms


Hello,

Recently, I've been having trouble with rampaging connections taking up my ip_conntrack_max on my router, which connects ~250 pc's to the internet. The problem seems to be coming from users with computers infected by blaster, sasser, etc. Although the ports used by these worms are blocked by iptables, they still generate new connections in /proc/net/ip_conntrack .

The problem is that I can't physically disconnect such users, because their boxes generate packets with false ip adresses that match the MAC adresses of their factual owners. If I disconnect such a user by zeroing him out in /etc/ethers, the legitimate user loses access to the net, while the computer with the worm stays at large.

Any ideas about what to do?

thanks
arthur
 
Old 12-16-2004, 10:59 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
hello...

i don't understand your question very well...

are you asking how to prevent the worms on your lan from connecting to the external network??
 
Old 12-16-2004, 11:03 AM   #3
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310

Rep: Reputation: 35
Why don't you try to clean up the source of the problem. That would be installing anti-virus software, spyware removal, and doing windows updates on all the computers.
 
Old 12-16-2004, 11:17 AM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Re: ip_conntrack and worms

Quote:
Originally posted by arthurb
I can't physically disconnect such users, because their boxes generate packets with false ip adresses that match the MAC adresses of their factual owners.
ummm... WHAT?? you just blew my mind there for a second...

=)


no, but seriously, maybe you could you elaborate a little on this... i can't be the only one that doesn't fully comprehend your issue...


Last edited by win32sux; 12-16-2004 at 11:18 AM.
 
Old 12-18-2004, 11:00 AM   #5
arthurb
LQ Newbie
 
Registered: Sep 2004
Location: Warsaw, Poland
Distribution: sarge
Posts: 7

Original Poster
Rep: Reputation: 0
sorry, you're right, I wasn't too clear on the issue :-)

The thing is, I can't get rid of the problem at the source, because I don't own the computers on the LAN, I am merely the ISP. The computers belong to the users, and I can't really go about installing spybot adaware, etc. on all of them (about ~250), as this would involve barging into hundreds of apartments.

The other issue is that I can't pinpoint which computers are scanning the network, because all the packets come with false IP addresses and false MAC addresses. Both of these usually match the IP and MAC of perfectly innocent users on my LAN. What I do on my router is I have a file called /etc/ethers, where I enter each IP on my network alongside its correct MAC address. Then I run
Code:
arp -f
That way, only computers with correct IP/MAC pairs will get their packets routed.

Now, when I need to disconnect a user, I substitute his MAC for the number "0" in /etc/ethers. I cannot do so with users who are pumping blaster or sasser, since this would only disconnect innocent users and the villians would still be sending packets.

I wouldn't mind their sending packets, (they're dropped by my firewall anyway) if it weren't for the fact that this fills up my /proc/net/ip_conntrack . After a while, I get the error message:

Code:
ip_conntrack: table full, dropping packet
This starts slowly, but after a couple of hours or days, the connections generated by the trojans take precendence, and the router starts dropping packets from legitimate users.

Hence my question:

a) is there any way that I can pinpoint who is generating the packets? (the IP and MAC are false, so no luck there)

or if that is not possible

b) is there any way that I can keep the bogus connections generated by the worms from filling up my ip_conntrack? (eg. by having the kernel clear the ip_conntrack once in a while without having to restart the router?)

thanks, hope it's clear this time :-)

arthur
 
Old 12-18-2004, 11:46 AM   #6
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
you can check the current size of your ip_conntrack table with:

Code:
cat /proc/sys/net/ipv4/ip_conntrack_max
you can increase it with:

Code:
echo "new bigger size" > /proc/sys/net/ipv4/ip_conntrack_max
 
Old 12-18-2004, 12:52 PM   #7
arthurb
LQ Newbie
 
Registered: Sep 2004
Location: Warsaw, Poland
Distribution: sarge
Posts: 7

Original Poster
Rep: Reputation: 0
Yes, thank you,

but the problem is that the ip_conntrack_max is already maxed out at 65535.

And that is unfortunately only a temporary solution, because raising the limit just buys you time before the new connections fill it up again.

But I have found the following solution, although I do not yet know if it works:

Code:
echo "21600" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established
This will (hopefully) flush ip_conntrack after 6h instead of 5 days.

I have also found that the following code will drop packets before they get registered by ip_conntrack :

Code:
iptables -t raw -A PREROUTING -p tcp --dport 135 -j NOTRACK
that one being for blaster, but easily modifiable for other worms. (only works with patch-o-matic)

Thanks for your suggestions.

Arthur
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
polygraph ip_conntrack question blackzone Linux - Networking 0 01-20-2005 02:48 AM
ip_conntrack table full Skunk_Face Linux - Security 1 11-01-2004 05:14 PM
Worms! desmond33 Linux - Security 6 04-29-2004 03:14 AM
ip_conntrack Belize Linux - General 3 03-23-2004 02:45 AM
With all the worms going around... seabass55 Linux - Networking 5 08-22-2003 04:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration