Python: MITM with scapy

0

Good morning,

I am starting to create my own (in) computer security tools, I was playing with Python and Scapy, I created my own arpspoof and I used it in another tool that intercepts the data I receive, and processes them accordingly. I achieved that, together with the IP redirection, the device can connect to the internet and my program can see the navigation. Now my question is how can I intercept and modify these received packets? I tried changing the headers of the IP layer and TCP (correcting the checksums), but then the router never answered me, and the device runs out of internet. What can I do?

def handler(packet):
    packet[TCP].sport = 80 # por ejemplo
                           # acá vendría cualquier tipo de cambios

    sendp(packet)          # cuando intercepto sin editar el paquete 
                           # no es necesario enviar
    pass

startARPpoison()
sniff(iface=interface, prn=handler, filter="tcp port 80")  # solo me interesa http 
    
asked by Somanos 15.10.2018 в 04:31
source

0 answers