Python Forum

Full Version: How to send a HTTP response packet using scapy
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How would I use scapy 2.4.3+ to spoof a http response? I tried using the packet below, however on the target machine (which has been arp spoofed, where the machine of the spoofer does not have port fowarding, resulting in the http request having to be answered by the spoofed packet, that is what I am trying to do), the provided HTML from the packet does not get rendered, once its sent using scapy.send(packet). So how would I adapt the packet below, to send a HTTP packet that would render on the target machine?

packet = scapy.IP(src=server_ip, dst=target_ip)/scapy.TCP() / HTTP() / HTTPResponse(Server=server_ip) / "<html><p>Hi</p></html>"