Question

I am writing python two scripts using scapy one executed on server side and the other on client side. On client side, the script sends UDP packets to a closed port on server. The aim of my scripts, is to test if client will accept invalid ICMP packets received from server. On server side, I am going to sniff for incoming traffic and respond every UDP packet with an ICMP port unreachable, and everytime I will modify a field in ICMP packet (false value) to test if the packet is received. My question is: when I modify the Raw field (payload) ,is it normal that client will accept this ICMP packet ? I mean there is no control done on Raw field. I hope my question is clear. Thank you very much.

Was it helpful?

Solution

Well, at least for the ID and sequence fields, these can be any 16-bit numbered combination and the kernel will accept the packet and forward it to all registered ICMP socket handlers.

But if the checksum field is incorrect, the receiving kernel will not pass the header up to the handlers (it will however to link layer sniffers). Also, from what I tested, if you change the type/code flags to incorrect combinations of known numbers, or numbers undefined by the protocol, the receiving kernel does not pass that to handlers (but it is still seen by link layer sniffers).

Note I didn't use scapy, just straight python/socket code, and my system is Linux.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top