Adding payload in packet

2020-07-06 01:50发布

Can I insert image or document (in MBs) as a data in packet using scapy?

This is what I did to send data.

data = "University of texas at San Antonio"
a = IP(dst="129.132.2.21")/TCP()/data
send(a)

1条回答
冷血范
2楼-- · 2020-07-06 02:10

Yes, you can send raw data like this. In this example, data will be ASCII encoded.

>>> data = 'University of Texas at San Antonio'
>>> a = IP(dst='129.132.2.21') / TCP() / Raw(load=data)
>>> sendp(a)
查看更多
登录 后发表回答