Edit HTTP header prior to forwarding

142 views Asked by At

I want to create a python programme that edits the headers of a of HTTP message before forwarding it in a Man in the Middle attack.

I allowed port forwarding in /proc/sys/net/ipv4/ip_forward

I am ARP spoofing with arpspoof

Could I edit the headers before retransmitting them in python or do I need to dabble with C built sockets below the application layer?

1

There are 1 answers

0
rodolk On

Why don't you use sockets in python?

https://docs.python.org/release/2.5.2/lib/socket-example.html

Or just a python HTTP server and you make it run as a proxy. You read the HTTP request, modify the headers as necessary and resend it.

https://docs.python.org/3.3/library/http.server.html