I’m developing a project which filters traffic in a network. (like internet gateway or firewall).I want to redirect a http connection request (containing certain keywords in hostname like “porn”) to another host by using “http 301 redirect”(only for port:80). Now I can do that by sending back a packet with the following header to the source.
HTTP/1.1 301 Moved Permanently
Please tell me how to do this. Should i modify the packet and send it back to the source? If I do this what are the necessary changes to be made in the packet information (like checksum, dest_ip, source_ip, etc.).
Or Can I make a new packet and send it back to the source?
Thanks serpentfly, I would go for “creating new packet” but can you please refer to some resource where new packet creation is demonstrated. I’m a student and I don’t know much on how to create a new one..