Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Lore <skizzo82@yahoo.com>
To: Henrik Nordstrom <hno@marasystems.com>
Cc: Netfilter Users <netfilter@lists.netfilter.org>
Subject: Re: libipq: problems changing destination port
Date: Mon, 31 Oct 2005 20:27:24 +0100 (CET)	[thread overview]
Message-ID: <20051031192724.16806.qmail@web52802.mail.yahoo.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0510311732330.16659@filer.marasystems.com>

This makes a lot of sense... and I think this will
save a lot of time to those who'll try to change the
port to an outgoing packet using LibIPQ.

the only way to make it work is another chain on
netfilters that passes every incoming packet to
userspace so that the port can be reverted to the
original one... so the sender is fooled and behaves
like it is directly connected to the server.

Thanks alot.

One more question:
I get every outgoing packet to userspace, get the ip
and port, connect to server to check if it has the
required services and daemon (the latter is part of my
project) and if both are true I redirect every
outgoing packet of that kind (port and IP) to a
predefined port. (if only the former is true, packets
are verdicted as NF_ACCEPT without any change)
As we ascertained, in the case service and daemon are
available, I have to change the port of all incoming
packet of that connection...
Do you think has better performance to add a new chain
for every port used (via execv) or to use a chain that
redirects every incoming packet to userspace, so that
I have to do a clean NF_ACCEPT to every incoming
connection that is not of my kind?

Thanks again and again...
Byez
lore

--- Henrik Nordstrom <hno@marasystems.com> ha scritto:


> On Mon, 31 Oct 2005, Lore wrote:
> 
> > 16:27:50.094991 IP (tos 0x0, ttl  64, id 39743,
> offset
> > 0, flags [DF], proto: TCP (6), length: 60)
> > 192.168.0.4.32788 > geronte.cs.unibo.it.2026: S,
> cksum
> > 0x5034 (correct), 2890202236:2890202236(0) win
> 5840
> > <mss 1460,sackOK,timestamp 14378819 0,nop,wscale
> 2>
> >
> > 16:27:50.119230 IP (tos 0x0, ttl  64, id 625,
> offset
> > 0, flags [DF], proto: TCP (6), length: 40)
> > 192.168.0.4.32788 > geronte.cs.unibo.it.2026: R,
> cksum
> > 0x36fd (correct), 2890202237:2890202237(0) win 0
> 
> Looks like you suceeded just fine, but failed to
> undo your rewrite on 
> return traffic...
> 
> in the above return traffic seems missing. The
> picture I see is
> 
> 
> 192.168.0.4.32788 -> geronte.cs.unibo.it.2026 (2022)
> SYN
> 
> [not shown]
> geronte.cs.unibo.it.2026 -> 192.168.0.4.32788
> SYN+ACK
> 
> 192.168.0.4.32788 -> geronte.cs.unibo.it.2026 RESET
> 
> Where I suspect the RESET is actually "I have no
> interest in talking to 
> geronte.cs.unibo.it:2026, go agay please! I want to
> talk to 
> geronte.cs.unibo.it:2022".
> 
> 
> Does this make any sense to you?
> 
> Regards
> Henrik
> 



	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da
10MB 
http://mail.yahoo.it


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it


  reply	other threads:[~2005-10-31 19:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-29 12:59 libipq: problems changing destination port Lore
2005-10-29 21:54 ` Henrik Nordstrom
2005-10-31 15:37   ` Lore
2005-10-31 16:35     ` Henrik Nordstrom
2005-10-31 19:27       ` Lore [this message]
2005-11-01  0:24         ` Henrik Nordstrom
2005-11-01 15:11           ` Martijn Lievaart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051031192724.16806.qmail@web52802.mail.yahoo.com \
    --to=skizzo82@yahoo.com \
    --cc=hno@marasystems.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox