Jump to content

Capturing a packet from ethernet and transfering to Apache


abakash

Recommended Posts

Hi,

  I am working on a firewall and need to capture packets from the ethernet and then do some analysis on it before sending it to Apache application. I am been able to capture the packets but they are also received by the Apache at the same instant. But I need to analyze the packet before it is received by apache. Any help in this regard would be highly appreciated.

 

Abakash

 

Link to comment
Share on other sites

Im not sure you can do it - as you said - apache gets the packet at the same instant. Iptables would be a better level to go down to, but Im not sure if it has enough low level detail that you are looking for.

 

Why do you want to analyse the visitor before it hits apache? I suggest you use a proxy which can hand off the request to a certain webserver on a local port etc.

Is this for ssl certs etc.?

 

-steve

Link to comment
Share on other sites

Actually what I am trying to do is, running a Web Application Firewall(WAF) and the Apache server on the same system on the same port(80). So, when a packet comes, it needs to be analyzed by the WAF before passing it to the Apache server module. But being running on the same port, packet is received by both at the same instant. Which is not at all helping my cause. I am stuck and don't know how to proceed. Any help would be great!!!!

Link to comment
Share on other sites

Ya, I was thinking about it. But, I am not sure how easily I can forward the packet to another port? I felt i would need to store the packet, then modify the port number in the packet and then forward it.

 

Can this work? Can u help me with some tutorial with how the packet can be stored and then modified?

 

or is there any better way of doing it?

 

Thanks

 

Abakash

Link to comment
Share on other sites

I really can't see a solution at the level you are attempting to do this. IMO you would need to use iptables and get this done well before you get to the webserver stage.

 

Iptables is a huge subject in itself, there is a simple tutorial here but really, Id'e find a decent sys admin.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.