Проблема в том, что scapy
не знает, как распознать ответ, потому что вы честно строите ICMP-пакет трудным путем. Если вы построите его с ICMP()
, он будет работать ...
>>> from scapy.all import ICMP, IP, sr1
>>> aa = IP(dst='192.168.0.1')/ICMP()
>>> sr1(aa)
Begin emission:
Finished to send 1 packets.
*
Received 1 packets, got 1 answers, remaining 0 packets
<IP version=4L ihl=5L tos=0x0 len=28 id=21747 flags= frag=0L ttl=60 proto=icmp
chksum=0x1a77 src=192.168.0.1 dst=4.121.2.25 options=[] |<ICMP type=echo-reply
code=0 chksum=0x0 id=0x0 seq=0x0 |<Padding
load='\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |>>>
>>>