Re:Re: Re: [tcpdump-workers] A limitation of libpcap?

2002-05-16 Thread maer727

Thanks, Guy pal!

I have received your mail. Everything is Ok now. 

Best regards,
George Ma

-  Original Message  -
From: Guy Harris 
To: [EMAIL PROTECTED] 
Subject: Re: Re: [tcpdump-workers] A limitation of libpcap?
Sent: Thu May 16 16:11:03 CST 2002

 On Thu, May 16, 2002 at 04:03:16PM +0800, [EMAIL PROTECTED] wrote:
  Your reply gives me a hint. But where to see your 
  response to my other messages? I have not got any other 
  mails from the mail list.
 
 Perhaps mail messages get delivered out-of-order by the mail server for
 tcpdump.org (i.e., if mail message A arrives on that machine before mail
 message B arrives, mail message A might still be delivered to you
 *after* mail message B is delivered to you), or perhaps they got
 delivered to tcpdump.org's mail server out-of-order by my ISP, or

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe



Re:Re: Re: [tcpdump-workers] A limitation of libpcap?

2002-05-16 Thread maer727

Thanks, Guy pal!

I have read some documents of libnet. I find libnet can only 
create ( called injection) packages and can not modify the 
content of a TCP package. 

Do you know some other ways on how to modify the content of a 
TCP package? 

Best regards,
George Ma

-  Original Message  -
From: Guy Harris 
To: [EMAIL PROTECTED] 
Cc: [EMAIL PROTECTED] 
Subject: Re: Re: [tcpdump-workers] A limitation of libpcap?
Sent: Thu May 16 16:52:17 CST 2002

 On Thu, May 16, 2002 at 04:33:03PM +0800, [EMAIL PROTECTED] wrote:
  My condition is as the following. I have a Squid proxy server 
  whose address is 210.12.46.37:3128 and a windows client whose 
  address is 210.12.46.39. 
  
  I want to write a deamon process to check whether the windows 
  client are visiting a specific www site. For example, www.yahoo.com. 
  
  If so, I want to change some content, for example, change 
  Yahoo! Shopping to Shopping Yahoo!. :-) 
 
 Hmm.
 
 That really sounds like a job for ICAP:
 
   http://www.i-cap.org/home.html
 
 ICAP is a protocol to let you perform, to use the ugly marketoon phrase
 they invented, content adaptation, which means modifying stuff that
 comes from Web sites before you show it to the user, e.g. to filter out
 viruses, insert ads, and the like.
 
 It might be possible to have Squid send replies from www.yahoo.com to
 an ICAP server which could rewrite the pages.
 
 A Google search for
 
   squid icap
 
 might find information on Squid and ICAP.
 
 This might be easier than trying to use a libpcap-based daemon.
 
  Now I have used libpcap-0.7.1 to get the related HTTP package. I have 
  also get the information that the origin package is sent from 
  210.12.46.37:3128 to 210.12.46.39:4116. 
  
  I have also allocated a new memory space to copy the origin message 
  and change the related content. 
  
  Now I meet trobles, how to send the package? Which port should I use 
  to send to message? I think I can not use port 3128 because Squid is 
  using the port. But if I send the message from other port, will the 
  windows client accept the message?
 
 Unless you send the package from the *same port* that it originally came
 from, the client will not recognize it as a reply.
 
 Unfortunately, if the client has already seen the reply from Squid,
 it'll then think that packet is a duplicate packet, and will discard it.
 
 I.e., unless I'm missing something, you can't make things work using
 libpcap in that fashion - a libpcap-based application is passive, and
 can't *actively* modify packets, unless it can, by some mechanism
 *other* than libpcap, prevent Squid's packets from getting to the
 client.
 
  Another question, will the package 
  be sent twice? (first, origin package; then, modified messge).
 
 Yes, as I said in my other message - and that's likely to be a problem,
 as per my previous paragraphs.
 
 Again, I'd suggest you look at using ICAP (or directly modifying Squid)
 instead.

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe



Re:Re: Re:Re: Re: [tcpdump-workers] A limitation of libpcap?

2002-05-16 Thread maer727

Thanks, Jan pal!

Let me have a try. :-)

Best regards, 
George Ma

-  Original Message  -
From: Honza Pomahac 
To: [EMAIL PROTECTED] 
Subject: Re: Re:Re: Re: [tcpdump-workers] A limitation of libpcap?
Sent: Fri May 17 05:04:40 CST 2002

 If you are using Linux, using netfilter/iptables QUEUE target could solve
 your problem.
 More information can be found on http://www.netfilter.org/ and
 http://www.speakeasy.org/~roux/dmn/pdumpq/.
 
 Jan Pomahac
 
 
 
 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, May 16, 2002 3:18 PM
 Subject: Re:Re: Re: [tcpdump-workers] A limitation of libpcap?
 
 
  Thanks, Guy pal!
 
  I have read some documents of libnet. I find libnet can only
  create ( called injection) packages and can not modify the
  content of a TCP package.
 
  Do you know some other ways on how to modify the content of a
  TCP package?
 
  Best regards,
  George Ma
 
 
 

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe