Re: Intercepting a packet, changing it and re-injecting into the network



On Fri, Dec 22, 2006 at 12:43:29PM -0300, Fabr?cio Barros Cabral wrote:
Hello everybody!

I'm developing a network application which needs *to intercept* a packet
(not just *copy* a packet, like libpcap does), move this packet into my
application (userland), do some checking in the packet and according
with some heuristics, the application may change the payload and
re-inject the modified packet into the network. Note that sometimes,
I'll change the payload, drop the packet or just let it go.

So, how can a I do that in FreeBSD? I can use 6.1, 7.1, any version.

The feature you're looking for is divert(4) sockets. You use IPFW to
decide which packets to divert to userland and can reinject them as
needed.

-- Brooks

Attachment: pgpAHuTVT89qu.pgp
Description: PGP signature



Relevant Pages

  • alt.2600 FAQ Revision .014 (2/4)
    ... One type of firewall is the packet filtering firewall. ... Dropping packets instead of rejecting them greatly increases the time required to scan your network. ... Port scanning UDP ports is much slower than port scanning TCP ports. ... Chartreuse Use the electricity from your phone line Cheese Connect two phones to create a diverter Chrome Manipulate Traffic Signals by Remote Control ...
    (alt.2600)
  • RE: Freebsd Theme Song
    ... from the network into the ethernet receiver. ... It takes a certain amount of time to get the packet out of ... At low data rates polling is less ... >Subject: Re: Freebsd Theme Song ...
    (freebsd-questions)
  • Re: [PATCH 1/1] network memory allocator.
    ... Kevent network AIO uses usual alloc_skb, naio is called when packet is ... data and main system can work with that free memory. ... You do not see the point of network tree allocator. ...
    (Linux-Kernel)
  • Re: very slow convergence of ntp to correct time.
    ... Many years ago the Proteon routers dropped the first packet ... David> after the cache timed out; ... cause issues for others when they are reconfiguring part of the network. ...
    (comp.protocols.time.ntp)
  • [TOOL] IPTraf, IP Network Monitoring Software
    ... IPTraf is a console-based network statistics utility for Linux. ... LAN station packet and byte counts. ... Includes TCP flag information, packet and byte counts, ... * General and detailed interface statistics showing IP, TCP, UDP, ICMP, ...
    (Securiteam)