Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Packet editing

by ig (Vicar)
on May 22, 2009 at 00:51 UTC ( [id://765582]=note: print w/replies, xml ) Need Help??


in reply to Packet editing

As you are wanting to manipulate the HTTP protocol payload, you should probably use something more structured and high level than raw IP packet manipulation.

Net::Proxy::Tutorial provides an introduction to what you can do with the Net::Proxy module. You might also be able to use HTTP::Proxy. There are proxy modules for many protocols.

Replies are listed 'Best First'.
Re^2: Packet editing
by Anonymous Monk on May 24, 2009 at 15:21 UTC
    Yes, but the thing is that i can't use a proxy for this. The only thing I can do is intercept the packets. The thing I want to do looks like what ettercap filters do. Like this: http://www.irongeek.com/i.php?page=security/ettercapfilter
      Yes, but the thing is that i can't use a proxy for this. The only thing I can do is intercept the packets.

      I take it that you mean you cannot reconfigure the clients to direct their queries to the proxy explicitly. This does not prevent you using software that provides easy access to the HTTP protocol layer and HTML documents therein.

      Software that allows you to intercept relevant packets on the network and manipulate the communications protocols without configuration of the clients are sometimes called "transparent" or "intercepting" proxies.

      You can do this with ettercap but there are other packages that provide easier access to the HTTP protocol layer. There are Perl modules that do this and many other applications, as ikegami has pointed out in Re: Packet editing.

      There are Perl modules that provide rich features for inspecting and modifying HTTP protocol communications and HTML documents.

      There are intercepting proxies that are not written in Perl that provide access to the HTTP protocol and HTML documents and may provide better performance than you could achieve with Perl. Wikipedia has links to some of these.

      The squid proxy is popular and I have successfully used it many times. It can be used as an intercepting proxy, though I have not used it to manipulate the HTML myself. But, as noted previously, there are many others that you might investigate.

      I suggest that you cannot create a reasonably competent proxy to manipulate HTML documents in HTTP protocol streams by manipulation of individual IP packets, whether with ettercap or any other packet filtering software. You will have better results with less effort if you start with a better tool.

        Thanks alot for you wisdom. This will definitely work out for me!! This will solve all the problems with incomplete packets, and accomplish precisely what I want: http://search.cpan.org/~book/HTTP-Proxy-0.23/lib/HTTP/Proxy/BodyFilter/tags.pm Much respect, p0c

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://765582]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-26 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found