Python

Python Scapy模块

2018-05-18  本文已影响225人  __周__
对数据包的操作
summary()   displays a list of summaries of each packet(显示每一个数据包的摘要)
nsummary()  same as previous, with the packet number(和上面额一样,多了一个数据包数量)
conversations()     displays a graph of conversations(显示通讯的图)
show()  displays the prefered representation (usually nsummary())(显示优先的事)
filter()    returns a packet list filtered with a lambda function(返回被lambda表达式过滤后的数据包列表)
hexdump()   returns a hexdump of all packets(返回所有数据包的十六进制数据)
hexraw()    returns a hexdump of the Raw layer of all packets(返回所有数据包的原始协议的十六进制数据)
padding()   returns a hexdump of packets with padding(显示填充过的数据包的十六进制数据)
nzpadding()     returns a hexdump of packets with non-zero padding(显示没有用零填充过的数据包的十六进制数据)
plot()  plots a lambda function applied to the packet list(设置一个lambda函数应用到数据包列表)
make table()    displays a table according to a lambda function(根据lambda函数显示一个列表)
发送数据包
>>> send(IP(dst="1.1.1.1")/ICMP())
.
Sent 1 packets.
>>> sendp(Ether()/IP(dst="1.1.1.1",ttl=(1,4)), iface="eth1")
....
Sent 4 packets.
>>> sendp("I'm travelling on Ethernet", iface="eth1", loop=1, inter=0.2)
................^C
Sent 16 packets.
>>> sendp(rdpcap("/tmp/pcapfile")) # tcpreplay
...........
Sent 11 packets.
发送和接收数据包(sr)

https://blog.csdn.net/dj1174232716/article/details/44891203

上一篇 下一篇

猜你喜欢

热点阅读