在数据包中添加有效载荷 [英] Adding payload in packet

查看:341
本文介绍了在数据包中添加有效载荷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用Scapy将图像或文档(以MB为单位)作为数据包插入数据包吗?

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)

推荐答案

是的,您可以像这样发送原始数据.在此示例中,数据将采用ASCII编码.

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)

这篇关于在数据包中添加有效载荷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆