austin
austin

Reputation: 115

Include IP header in payload of ICMP request using scapy

Currently trying to send some test ICMP packets using scapy, but cannot seem to figure out how to include a payload in the ICMP header. Specifically, I am testing a time exceeded error, here is my code:

I have tried looking extensively online for documentation regarding this, but to no avail.

send(IP(dst="123.123.0.1",src="123.123.0.0")/ICMP(type=11))

(ignore ips)

If anyone has any advice it would be much appreciated.

Upvotes: 1

Views: 3303

Answers (1)

akshif
akshif

Reputation: 191

You can send a payload by stacking it after ICMP() layer

send(IP(dst="123.123.0.1", src="123.123.0.0") / ICMP() / b"payload")

Upvotes: 3

Related Questions