Filter or change tcp packets
- From: "Nowitzki Rados" <Nowitzki.Rados@xxxxxxxxx>
- Date: Wed, 23 Apr 2008 15:52:44 +0200
Hello, I need to filter packets that are comming from certain server (IP
address/port number). Server sends packets to my client program, but some of
those packets cause client to crash (those packets are generated by other
server users because of hole in chat program). So I tried to configure
iptables
to search data section of tcp packets comming from that IP address
and if it finds "unwanted pattern that crash client", it should drop
packets. I managed to do that, but it seems like it was bad solution.
Problem is that when packet from server is dropped by iptables, my client
application stop working properly (I think it stops comunication with server
because of packet loss, but I am not sure). I read that when iptables drop
packet it does not notify sender about it. Does that means that sender
continue to send same packet over and over again? (and because there is no
response from client side they stop to communicate).
If that is true is there any way to drop packet and to tell server to send
next one? Altough I can see another problem there because if that happens
client side would have wrong sequence number for next packet? Anyone have
idea how could I solve this problem?
I also thought about changing tcp packet data. Is there any way to do
something like this:
-when packet arives, program (or iptables) search pattern in its data
-if pattern is found, program (or iptables, but i doubt it has that feature)
change data in tcp packet, so that "unwanted pattern that cause buffer
overflow" is removed from it.
-changed packet is forwarded to client like nothing happened
I think this would solve my problem, but I know that I would have to write
this program myself, and it probably means some driver level programming. Is
it possible to do something like this? Any links where I can read more about
it?
If anyone have solution to this problem (with iptables, or on by any other
means), or can give me any useful info on subject, I would be very
thankfull.
Thanks!
p.s. sorry for my bad English, it is not my main language.
.
- Follow-Ups:
- Re: Filter or change tcp packets
- From: Pascal Hambourg
- Re: Filter or change tcp packets
- From: Rick Jones
- Re: Filter or change tcp packets
- Prev by Date: Pictures conversion with ImageMagick
- Next by Date: Re: Port 57 vs 587
- Previous by thread: Pictures conversion with ImageMagick
- Next by thread: Re: Filter or change tcp packets
- Index(es):
Relevant Pages
|