Linux Netfilter discussions
 help / color / mirror / Atom feed
* about ipt_string
@ 2007-08-23  1:19 CrackyBlue
  2007-08-26 21:02 ` Michael Rash
  0 siblings, 1 reply; 2+ messages in thread
From: CrackyBlue @ 2007-08-23  1:19 UTC (permalink / raw)
  To: netfilter

Hi,

I am just wondering why this script don't block 
 
iptables -A INPUT -p tcp -m string --string 'bittorent' --algo kmp -d 0/0
--dport 80 -j REJECT

I have iptables 1.3.8 and 2.6.17 kernel and ipt_string is already loaded


Thanks



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: about ipt_string
  2007-08-23  1:19 about ipt_string CrackyBlue
@ 2007-08-26 21:02 ` Michael Rash
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Rash @ 2007-08-26 21:02 UTC (permalink / raw)
  To: netfilter

On Aug 23, 2007, CrackyBlue wrote:

> Hi,
> 
> I am just wondering why this script don't block 
>  
> iptables -A INPUT -p tcp -m string --string 'bittorent' --algo kmp -d 0/0
> --dport 80 -j REJECT
> 
> I have iptables 1.3.8 and 2.6.17 kernel and ipt_string is already loaded

The Snort community has two rules that are designed to detect Bittorrent
communications in the 'p2p.rules' file, and you could use fwsnort to
recast these into iptables rules:

http://www.cipherdyne.org/fwsnort/

The Snort rule ID's are 2180 and 2181, and if you want fwsnort to use the
REJECT target against Bittorrent traffic, then use the --ipt-reject
argument like so:

# fwsnort --snort-sids 2180,2181 --ipt-reject
[+] Parsing Snort rules files...
[+] Found sid: 2180 in p2p.rules
    Successful translation.
[+] Found sid: 2181 in p2p.rules
    Successful translation.

[+] Logfile: /var/log/fwsnort.log
[+] iptables script: /etc/fwsnort/fwsnort.sh

Here is an example iptables command that fwsnort will execute to block
Bittorrent traffic (where 192.168.10.0/24 is an internal network
protected by iptables):

$IPTABLES -A FWSNORT_FORWARD_ESTAB -s 192.168.10.0/24 -p tcp --dport
6881:6889 -m string --hex-string "|13|BitTorrent protocol" --algo bm
--to 84 -j REJECT --reject-with tcp-reset

(If you want to try this, then please install fwsnort-1.0.2 since there
have been some bug fixes).

--
Michael Rash
http://www.cipherdyne.org/
Key fingerprint = 53EA 13EA 472E 3771 894F  AC69 95D8 5D6B A742 839F


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-26 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-23  1:19 about ipt_string CrackyBlue
2007-08-26 21:02 ` Michael Rash

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox