Skip to contentSkip to conversation

how to block kazaa ?

DISCUSSION [email protected] 6 participants 7 messages Feb 26, 2003

lore
Share & tools
lore
#0 lore raw

hello

i have some problems in my lan environment. most of my clients using kazaa to dowmload mp3 and mpg files. these progams eating most of my small bandwidth so can i put some rules to "block" these kazaa and other p2p program ?

right now my linux boxes is just act as very simple NAT router using iptables

thank you very much

#1 lore raw
Quoted 7 lines · On Tuesday 25 February 2003 09:44 pm, [email protected] wrote:

hello

i have some problems in my lan environment. most of my clients using kazaa to dowmload mp3 and mpg files. these progams eating most of my small bandwidth so can i put some rules to "block" these kazaa and other p2p program ?

Quoted 5 lines

right now my linux boxes is just act as very simple NAT router using iptables

thank you very much

If you want simply to keep them from working, then the answer is to DROP traffic in FORWARD chain to/from the ports used for server or peer communication. For Gnutella/Limewire/Morpheus and kin, this means:

iptables -A FORWARD -p tcp --dport 6346:6347 -j DROP iptables -A FORWARD -p udp --dport 6346:6347 -j DROP

for EDonkey & Overnet:

iptables -A FORWARD -p tcp --dport 4660:4666 -j DROP iptables -A FORWARD -p udp --dport 4660:4666 -j DROP

for older Kazaa apparently this suffices:

iptables -A FORWARD -p tcp --dport 1214 -j DROP
iptables -A FORWARD -p udp --dport 1214 -j DROP

But newer implementations apparently support port-hopping, so it seems that the only confirmed way to stop it with iptables is with the STRING match from patch-o-matic, and block anything with the string "kazaa" (don't recall case requirements) in it. Compiling a custom kazaa-blocking kernel may be more than you want to do, though.

If you want to be 'polite' then use the REJECT target instead of DROP, at least for connections initiated from the LAN. If you want to be thorough, then LOG the traffic, find out who it is, and beat the kazaa out of them with a keyboard... :^)

Also, if the primary bottleneck is outbound, you might find that using the mangle table in prerouting to set TOS for certain desirable traffic and enacting pfifo queuing discipline will help a great deal - IE change TOS to a favorable value (0x10 perhaps) for specific traffic like HTTP SMTP POP3 IMAP or any VNC or such and then setting TOS to a 'bulk traffic' value (0x02 for example) for the remainder, or for the P2P traffic if it is identifiable. The pfifo qdisc will always send the 0x10 traffic, and send 0x02 only if there is nothing else waiting to be sent.

j

#6 lore raw
In reply to [email protected]

On Wed, 26 Feb 2003 09:44:33 +0700,
<[email protected]> wrote in message
<003d01c2dd40$fe922030$210aa8c0@sabirin>:

Quoted 7 lines

hello

i have some problems in my lan environment. most of my clients using kazaa to dowmload mp3 and mpg files. these progams eating most of my small bandwidth so can i put some rules to "block" these kazaa and other p2p program ?

Quoted 6 lines

right now my linux boxes is just act as very simple NAT router using iptables

thank you very much

..'iptables -A FORWARD -p tcp -m tcp -i eth1 --dport $kaaza-ports \
-j REJECT', or expand it to 'iptables -A FORWARD -p tcp -m tcp -m \
multiport- d$destination -i eth1 -j REJECT --dports $kaaza-ports'

..ditto for other protocols. Instead of "REJECT", there is also DROP, MIRROR, and my favorite, TARPIT, in Patch-o-matic.

Signature · 4 lines
..med vennlig hilsen = with Kind Regards from Arnt... ;-)
...with a number of polar bear hunters in his ancestry...
  Scenarios always come in sets of three: 
  best case, worst case, and just in case.
#2 lore raw
In reply to Joel Newkirk

hello,
Just going thru the thread so that i could learn form others
problem. One thing I could not understand is, how to custom compile a kazaa-blocking kernel?

Quoted 7 lines

But newer implementations apparently support port-hopping, so it seems that the only confirmed way to stop it with iptables is with the STRING match from patch-o-matic, and block anything with the string "kazaa" (don't recall case requirements) in it. Compiling a custom kazaa-blocking kernel may be more than you want to do, though.

Thanks a lot.

with regards,
Nimit.

#5 lore raw
In reply to Joel Newkirk
Quoted 1 line · Joel Newkirk

But newer implementations apparently support port-hopping, so it seems that the only confirmed way to stop it with iptables is with the STRING match from patch-o-matic, and block anything with the string "kazaa" (don't recall case requirements) in it. Compiling a custom kazaa-blocking kernel may be more than you want to do, though.

This strikes me as a pretty bad idea; it'll block more than just kazaa packets. For one thing, it would block a description of how to implement the block, unless it were obfuscated to get past itself, which seems silly to me. And maybe people talking about kazaa also. And even random binary sequences aren't that unlikely to have problems. The odds of a given seven random bytes matching are only 1/2^(5*8)=1/2^40. But if you transfer 1GB/day, multiply that by (2^30)/5. Then you're talking about odds of 5 in 1024 that you'll have at least one random packet blocked per day. I predict emails, compressed files, etc. that won't transfer for no apparently reason because part of it consistently won't transfer.

Quoted 1 line

Also, if the primary bottleneck is outbound, you might find that using the mangle table in prerouting to set TOS for certain desirable traffic and enacting pfifo queuing discipline will help a great deal - IE change TOS to a favorable value (0x10 perhaps) for specific traffic like HTTP SMTP POP3 IMAP or any VNC or such and then setting TOS to a 'bulk traffic' value (0x02 for example) for the remainder, or for the P2P traffic if it is identifiable. The pfifo qdisc will always send the 0x10 traffic, and send 0x02 only if there is nothing else waiting to be sent.

I like this much more. It solves the real problem of bandwidth usage while still allowing them to do it. And I'll guess that the port hopping only moves on if it doesn't work, not if it has a less favorable TOS value. So it will stay on the easily-identifiable ports. Or like you said, you could increase the TOS for packets you're sure aren't P2P stuff if that doesn't work out.

Scott

#3 lore raw
In reply to Nimit Gupta
Quoted 4 lines · Nimit Gupta

hello,
Just going thru the thread so that i could learn form others
problem. One thing I could not understand is, how to custom compile a kazaa-blocking kernel?

Sorry, what I was referring to was using Patch-O-Matic to add newer features to netfilter, like the string match and Arnt Karlsen's favored TARPIT target, and then recompiling the kernel to incorporate the patches. It's not really a 'kazaa-blocking' kernel, just in this case one compiled especially because of the desire to block kazaa.

j

Quoted 11 lines
Quoted 6 lines

But newer implementations apparently support port-hopping, so it seems that the only confirmed way to stop it with iptables is with the STRING match from patch-o-matic, and block anything with the string "kazaa" (don't recall case requirements) in it. Compiling a custom kazaa-blocking kernel may be more than you want to do, though.

Thanks a lot.

with regards,
Nimit.

#4 lore raw
In reply to Nimit Gupta

Hi

there is no such tool for specifically for kazaa but you can add up string module from POM

check netfilter.org... extensions how to
http://www.netfilter.org/documentation/HOWTO//netfilter-extensions-HOWTO.htm
l

hare
----- Original Message -----
From: "Nimit Gupta" <[email protected]>
To: "Joel Newkirk" <[email protected]>
Cc: <[email protected]>; <[email protected]>
Sent: Wednesday, February 26, 2003 10:37 AM
Subject: Re: how to block kazaa ?

Quoted 21 lines

hello,
Just going thru the thread so that i could learn form others problem. One thing I could not understand is, how to custom compile a kazaa-blocking kernel?

Quoted 7 lines

But newer implementations apparently support port-hopping, so it seems that the only confirmed way to stop it with iptables is with the STRING match from patch-o-matic, and block anything with the string "kazaa" (don't recall case requirements) in it. Compiling a custom kazaa-blocking kernel may be more than you want to do, though.

Thanks a lot.

with regards,
Nimit.